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/20260801145334.1166751-6-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2026-08-01 14:53:30 +00:00
parent 697badc27a
commit d5001f493f

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,