mac80211: QoS multicast frames have No Ack policy
[deliverable/linux.git] / net / mac80211 / wme.c
index a9fee2bc63001ffb2e863fc16581fedf3816d77c..d4f789a4e4f18b7cd7f79f03f03a45bfaf962fba 100644 (file)
@@ -72,7 +72,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
        case NL80211_IFTYPE_AP_VLAN:
                sta = rcu_dereference(sdata->u.vlan.sta);
                if (sta) {
-                       qos = get_sta_flags(sta) & WLAN_STA_WME;
+                       qos = test_sta_flag(sta, WLAN_STA_WME);
                        break;
                }
        case NL80211_IFTYPE_AP:
@@ -99,7 +99,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
        if (!sta && ra && !is_multicast_ether_addr(ra)) {
                sta = sta_info_get(sdata, ra);
                if (sta)
-                       qos = get_sta_flags(sta) & WLAN_STA_WME;
+                       qos = test_sta_flag(sta, WLAN_STA_WME);
        }
        rcu_read_unlock();
 
@@ -135,21 +135,27 @@ u16 ieee80211_downgrade_queue(struct ieee80211_local *local,
        return ieee802_1d_to_ac[skb->priority];
 }
 
-void ieee80211_set_qos_hdr(struct ieee80211_local *local, struct sk_buff *skb)
+void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
+                          struct sk_buff *skb)
 {
        struct ieee80211_hdr *hdr = (void *)skb->data;
 
        /* Fill in the QoS header if there is one. */
        if (ieee80211_is_data_qos(hdr->frame_control)) {
                u8 *p = ieee80211_get_qos_ctl(hdr);
-               u8 ack_policy = 0, tid;
+               u8 ack_policy, tid;
 
                tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
 
-               if (unlikely(local->wifi_wme_noack_test))
+               /* preserve EOSP bit */
+               ack_policy = *p & IEEE80211_QOS_CTL_EOSP;
+
+               if (unlikely(sdata->local->wifi_wme_noack_test) ||
+                   is_multicast_ether_addr(hdr->addr1))
                        ack_policy |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK;
-               /* qos header is 2 bytes, second reserved */
+               /* qos header is 2 bytes */
                *p++ = ack_policy | tid;
-               *p = 0;
+               *p = ieee80211_vif_is_mesh(&sdata->vif) ?
+                       (IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT >> 8) : 0;
        }
 }
This page took 0.024048 seconds and 5 git commands to generate.