]> Pileus Git - ~andy/linux/blobdiff - net/mac80211/wme.c
Merge tag 'mfd-3.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
[~andy/linux] / net / mac80211 / wme.c
index 906f00cd6d2f65053281c617254f9f50681ec403..afba19cb6f87af534f67904b96c0efcd7f421896 100644 (file)
@@ -191,6 +191,15 @@ void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
 
        /* qos header is 2 bytes */
        *p++ = ack_policy | tid;
-       *p = ieee80211_vif_is_mesh(&sdata->vif) ?
-               (IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT >> 8) : 0;
+       if (ieee80211_vif_is_mesh(&sdata->vif)) {
+               /* preserve RSPI and Mesh PS Level bit */
+               *p &= ((IEEE80211_QOS_CTL_RSPI |
+                       IEEE80211_QOS_CTL_MESH_PS_LEVEL) >> 8);
+
+               /* Nulls don't have a mesh header (frame body) */
+               if (!ieee80211_is_qos_nullfunc(hdr->frame_control))
+                       *p |= (IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT >> 8);
+       } else {
+               *p = 0;
+       }
 }