mac80211: add a powersave handling fix
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 338-mac80211-fix-tim-recalculation-after-PS-response.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Fri, 26 Aug 2016 21:57:16 +0200
3 Subject: [PATCH] mac80211: fix tim recalculation after PS response
4
5 Handle the case where the mac80211 intermediate queues are empty and the
6 driver has buffered frames
7
8 Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation")
9 Signed-off-by: Felix Fietkau <nbd@nbd.name>
10 ---
11
12 --- a/net/mac80211/sta_info.c
13 +++ b/net/mac80211/sta_info.c
14 @@ -1616,7 +1616,6 @@ ieee80211_sta_ps_deliver_response(struct
15
16 sta_info_recalc_tim(sta);
17 } else {
18 - unsigned long tids = sta->txq_buffered_tids & driver_release_tids;
19 int tid;
20
21 /*
22 @@ -1648,7 +1647,8 @@ ieee80211_sta_ps_deliver_response(struct
23 for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) {
24 struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]);
25
26 - if (!(tids & BIT(tid)) || txqi->tin.backlog_packets)
27 + if (!(driver_release_tids & BIT(tid)) ||
28 + txqi->tin.backlog_packets)
29 continue;
30
31 sta_info_recalc_tim(sta);