aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-02-27 06:18:30 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-29 14:14:54 -0500
commit02f2f1a951f87644166926862ec32fb13511e2f3 (patch)
tree77d5ac88a112aeb9f18887277dabf311b7ec0e8a /net/mac80211/tx.c
parent5eb02e44adc92a71bae3ff60acb1eea5ada14e93 (diff)
mac80211: handle non-bufferable MMPDUs correctly
This renames the IEEE80211_TX_CTL_POLL_RESPONSE TX flag to IEEE80211_TX_CTL_NO_PS_BUFFER and also uses it for non-bufferable MMPDUs (all MMPDUs but deauth, disassoc and action frames.) Previously, mac80211 would let the MMPDU through but not set the flag so drivers supporting some hardware aids for avoiding the PS races would then reject the frame. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 7c021f255716..570737df2d22 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -448,18 +448,23 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
448 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; 448 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
449 struct ieee80211_local *local = tx->local; 449 struct ieee80211_local *local = tx->local;
450 450
451 if (unlikely(!sta || 451 if (unlikely(!sta))
452 ieee80211_is_probe_resp(hdr->frame_control) ||
453 ieee80211_is_auth(hdr->frame_control) ||
454 ieee80211_is_assoc_resp(hdr->frame_control) ||
455 ieee80211_is_reassoc_resp(hdr->frame_control)))
456 return TX_CONTINUE; 452 return TX_CONTINUE;
457 453
458 if (unlikely((test_sta_flag(sta, WLAN_STA_PS_STA) || 454 if (unlikely((test_sta_flag(sta, WLAN_STA_PS_STA) ||
459 test_sta_flag(sta, WLAN_STA_PS_DRIVER)) && 455 test_sta_flag(sta, WLAN_STA_PS_DRIVER)) &&
460 !(info->flags & IEEE80211_TX_CTL_POLL_RESPONSE))) { 456 !(info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER))) {
461 int ac = skb_get_queue_mapping(tx->skb); 457 int ac = skb_get_queue_mapping(tx->skb);
462 458
459 /* only deauth, disassoc and action are bufferable MMPDUs */
460 if (ieee80211_is_mgmt(hdr->frame_control) &&
461 !ieee80211_is_deauth(hdr->frame_control) &&
462 !ieee80211_is_disassoc(hdr->frame_control) &&
463 !ieee80211_is_action(hdr->frame_control)) {
464 info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER;
465 return TX_CONTINUE;
466 }
467
463#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 468#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
464 printk(KERN_DEBUG "STA %pM aid %d: PS buffer for AC %d\n", 469 printk(KERN_DEBUG "STA %pM aid %d: PS buffer for AC %d\n",
465 sta->sta.addr, sta->sta.aid, ac); 470 sta->sta.addr, sta->sta.aid, ac);