aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 }