aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-01-09 05:05:31 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-01-10 03:43:34 -0500
commit0a1cb80975b67e29d572b28c1621203d1d74f4d3 (patch)
treee91a130026f180de9cc883b92c25662e2bbc70cd /net
parent852c0153df5082311f50c062275813905f39f56e (diff)
mac80211: fix PS-Poll driver release TID
Using ffs() for the PS-Poll release TID is wrong, it will cause frames to be released in order 0 1 2 3 4 5 6 7 instead of the correct 7 6 5 4 3 0 2 1. Fix this by adding a new function that implements "highest priority TID" properly. Reported-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/sta_info.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 703081d04e88..93bfd6700cbf 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1227,6 +1227,17 @@ static void ieee80211_send_null_response(struct ieee80211_sub_if_data *sdata,
1227 rcu_read_unlock(); 1227 rcu_read_unlock();
1228} 1228}
1229 1229
1230static int find_highest_prio_tid(unsigned long tids)
1231{
1232 /* lower 3 TIDs aren't ordered perfectly */
1233 if (tids & 0xF8)
1234 return fls(tids) - 1;
1235 /* TID 0 is BE just like TID 3 */
1236 if (tids & BIT(0))
1237 return 0;
1238 return fls(tids) - 1;
1239}
1240
1230static void 1241static void
1231ieee80211_sta_ps_deliver_response(struct sta_info *sta, 1242ieee80211_sta_ps_deliver_response(struct sta_info *sta,
1232 int n_frames, u8 ignored_acs, 1243 int n_frames, u8 ignored_acs,
@@ -1288,7 +1299,8 @@ ieee80211_sta_ps_deliver_response(struct sta_info *sta,
1288 hweight16(driver_release_tids) > 1) { 1299 hweight16(driver_release_tids) > 1) {
1289 more_data = true; 1300 more_data = true;
1290 driver_release_tids = 1301 driver_release_tids =
1291 BIT(ffs(driver_release_tids) - 1); 1302 BIT(find_highest_prio_tid(
1303 driver_release_tids));
1292 break; 1304 break;
1293 } 1305 }
1294 } 1306 }