diff mbox series

mac80211: Use ATF by NL80211_EXT_FEATURE_AIRTIME_FAIRNESS

Message ID 20220513071948.2419-1-evelyn.tsai@mediatek.com (mailing list archive)
State Rejected
Delegated to: Johannes Berg
Headers show
Series mac80211: Use ATF by NL80211_EXT_FEATURE_AIRTIME_FAIRNESS | expand

Commit Message

Evelyn Tsai May 13, 2022, 7:19 a.m. UTC
Except for using debugfs to change airtime_flags (AIRTIME_USE_TX/RX),
turn ATF into a proper NL80211_EXT_FEATURE, so the driver can determine
whether using airtime scheduling.

Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
---
 net/mac80211/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Toke Høiland-Jørgensen May 13, 2022, 9:44 a.m. UTC | #1
Evelyn Tsai <evelyn.tsai@mediatek.com> writes:

> Except for using debugfs to change airtime_flags (AIRTIME_USE_TX/RX),
> turn ATF into a proper NL80211_EXT_FEATURE, so the driver can determine
> whether using airtime scheduling.

So the reason we didn't do this from the beginning was that the driver
would just not call ieee80211_register_airtime() if it did not support
airtime fairness. Why is this not applicable to your use case?

-Toke
diff mbox series

Patch

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 5311c3cd3050..89542bed7d89 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -717,7 +717,9 @@  struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
 			IEEE80211_DEFAULT_AQL_TXQ_LIMIT_H;
 	}
 
-	local->airtime_flags = AIRTIME_USE_TX | AIRTIME_USE_RX;
+	if (wiphy_ext_feature_isset(local->hw.wiphy,
+				    NL80211_EXT_FEATURE_AIRTIME_FAIRNESS))
+		local->airtime_flags = AIRTIME_USE_TX | AIRTIME_USE_RX;
 	local->aql_threshold = IEEE80211_AQL_THRESHOLD;
 	atomic_set(&local->aql_total_pending_airtime, 0);