wifi: mac80211: add ieee80211_txq_aql_pending()

Add a function to allow drivers to query the pending AQL airtime
for a given txq, for both unicast and broadcast.
This will be used for mt76 to limit buffering in AP mode for power-save
stations.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/20260724115429.3921457-4-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Felix Fietkau
2026-07-28 16:02:03 +02:00
committed by Johannes Berg
parent 836c1addd3
commit 9a197e71eb
2 changed files with 29 additions and 0 deletions
+11
View File
@@ -6888,6 +6888,17 @@ void ieee80211_sta_register_airtime(struct ieee80211_sta *pubsta, u8 tid,
bool
ieee80211_txq_airtime_check(struct ieee80211_hw *hw, struct ieee80211_txq *txq);
/**
* ieee80211_txq_aql_pending - get pending AQL airtime for a txq
*
* @hw: pointer obtained from ieee80211_alloc_hw()
* @txq: pointer obtained from station or virtual interface
*
* Return: pending airtime (in usec) for the given txq.
*/
u32 ieee80211_txq_aql_pending(struct ieee80211_hw *hw,
struct ieee80211_txq *txq);
/**
* ieee80211_iter_keys - iterate keys programmed into the device
* @hw: pointer obtained from ieee80211_alloc_hw()
+18
View File
@@ -4262,6 +4262,24 @@ bool ieee80211_txq_airtime_check(struct ieee80211_hw *hw,
}
EXPORT_SYMBOL(ieee80211_txq_airtime_check);
u32 ieee80211_txq_aql_pending(struct ieee80211_hw *hw,
struct ieee80211_txq *txq)
{
struct ieee80211_local *local = hw_to_local(hw);
struct sta_info *sta;
if (unlikely(txq->tid == IEEE80211_NUM_TIDS))
return 0;
if (!txq->sta)
return atomic_read(&local->aql_mc_pending_airtime);
sta = container_of(txq->sta, struct sta_info, sta);
return atomic_read(&sta->airtime[txq->ac].aql_tx_pending);
}
EXPORT_SYMBOL(ieee80211_txq_aql_pending);
static bool
ieee80211_txq_schedule_airtime_check(struct ieee80211_local *local, u8 ac)
{