Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: fix handling of PS filtering with fast-xmit

Fixes dropped packets in the tx path in case a non-PS station triggers
the tx filter.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Felix Fietkau and committed by
Johannes Berg
f7418bc1 babc305e

+6 -2
+1
net/mac80211/status.c
··· 101 101 * when it wakes up for the next time. 102 102 */ 103 103 set_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT); 104 + ieee80211_clear_fast_xmit(sta); 104 105 105 106 /* 106 107 * This code races in the following way:
+5 -2
net/mac80211/tx.c
··· 1218 1218 1219 1219 if (!tx->sta) 1220 1220 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; 1221 - else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) 1221 + else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { 1222 1222 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; 1223 + ieee80211_check_fast_xmit(tx->sta); 1224 + } 1223 1225 1224 1226 info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT; 1225 1227 ··· 2453 2451 2454 2452 if (test_sta_flag(sta, WLAN_STA_PS_STA) || 2455 2453 test_sta_flag(sta, WLAN_STA_PS_DRIVER) || 2456 - test_sta_flag(sta, WLAN_STA_PS_DELIVER)) 2454 + test_sta_flag(sta, WLAN_STA_PS_DELIVER) || 2455 + test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT)) 2457 2456 goto out; 2458 2457 2459 2458 if (sdata->noack_map)