diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2012-01-30 15:18:00 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-30 15:48:20 -0500 |
commit | 608383bfc04aa222c3e9e896c32f56a5e5deaff0 (patch) | |
tree | cb608bbe456f3aaa030f90977f6f9e60f6b2a413 /net/mac80211/sta_info.c | |
parent | 2ab694d302b489c5aa49c360dc97149b77c96586 (diff) | |
download | op-kernel-dev-608383bfc04aa222c3e9e896c32f56a5e5deaff0.zip op-kernel-dev-608383bfc04aa222c3e9e896c32f56a5e5deaff0.tar.gz |
mac80211: Fix incorrect num_sta_ps decrement in ap_sta_ps_end
If the driver blocked this specific STA with the help of
ieee80211_sta_block_awake we won't clear WLAN_STA_PS_STA later but
still decrement num_sta_ps. Hence, the next data frame from this
STA will trigger ap_sta_ps_end again and also decrement num_sta_ps
again leading to an incorrect num_sta_ps counter.
This can result in problems with powersaving clients not waking up
from PS because the TIM calculation might be skipped due to the
incorrect num_sta_ps counter.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r-- | net/mac80211/sta_info.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 0c79593..1fb4770 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -997,9 +997,11 @@ EXPORT_SYMBOL(ieee80211_find_sta); static void clear_sta_ps_flags(void *_sta) { struct sta_info *sta = _sta; + struct ieee80211_sub_if_data *sdata = sta->sdata; clear_sta_flag(sta, WLAN_STA_PS_DRIVER); - clear_sta_flag(sta, WLAN_STA_PS_STA); + if (test_and_clear_sta_flag(sta, WLAN_STA_PS_STA)) + atomic_dec(&sdata->bss->num_sta_ps); } /* powersave support code */ |