wifi: mt76: mt7603: tell mac80211 when the PS queue has run empty

mt7603_rx_loopback_skb() marks a TID as buffered when the hardware
redirects a frame into the driver PS queue, but nothing ever clears that
state again. mac80211 therefore keeps the TIM bit set for the station and
keeps routing every service period to the driver, which also prevents it
from releasing frames it has buffered itself.

Clear the buffered state for every requested TID that has no frames left
in the PS queue.

Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2026-08-01 17:45:48 +02:00
parent baac541c05
commit 56fe4e0c0a
+11
View File
@@ -464,8 +464,10 @@ mt7603_release_buffered_frames(struct ieee80211_hw *hw,
struct sk_buff_head list;
struct sk_buff *skb, *tmp, *last;
bool eosp_null, uapsd;
unsigned long drained;
u16 pending = 0;
u8 last_tid;
int i;
__skb_queue_head_init(&list);
@@ -489,6 +491,15 @@ mt7603_release_buffered_frames(struct ieee80211_hw *hw,
pending |= BIT(skb->priority);
spin_unlock_bh(&dev->ps_lock);
/*
* Without this, mac80211 keeps the TIM bit set for the station and
* keeps routing every service period to the driver, even though there
* is nothing left to release.
*/
drained = tids & ~pending;
for_each_set_bit(i, &drained, IEEE80211_NUM_TIDS)
ieee80211_sta_set_buffered(sta, i, false);
last = skb_peek_tail(&list);
if (!last) {
mt76_release_buffered_frames(hw, sta, tids, nframes, reason,