]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
mac80211: make sta.wme indicate whether QoS is used
authorJohannes Berg <johannes.berg@intel.com>
Sat, 21 Mar 2015 07:09:55 +0000 (08:09 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 30 Mar 2015 08:47:16 +0000 (10:47 +0200)
Indicating just the peer's capability is fairly pointless
if the local device doesn't support it. Make the variable
track both combined, and remove the 'local support' check
in the TX path.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/mac80211.h
net/mac80211/cfg.c
net/mac80211/ibss.c
net/mac80211/mlme.c
net/mac80211/tx.c

index 94c8c62800c3b62c6d223da54047efc36686faa5..201bc68e0cffd19766c31e983c6e652d50c681f9 100644 (file)
@@ -1557,7 +1557,8 @@ struct ieee80211_sta_rates {
  * @supp_rates: Bitmap of supported rates (per band)
  * @ht_cap: HT capabilities of this STA; restricted to our own capabilities
  * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities
- * @wme: indicates whether the STA supports QoS/WME.
+ * @wme: indicates whether the STA supports QoS/WME (if local devices does,
+ *     otherwise always false)
  * @drv_priv: data area for driver use, will always be aligned to
  *     sizeof(void *), size is determined in hw information.
  * @uapsd_queues: bitmap of queues configured for uapsd. Only valid
index 49401238ac39804090d9e9acb0f257e4fbd564ad..301215be59ef0ca1cf798dd8947554d0f7276155 100644 (file)
@@ -1073,7 +1073,8 @@ static int sta_apply_parameters(struct ieee80211_local *local,
                        clear_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE);
        }
 
-       if (mask & BIT(NL80211_STA_FLAG_WME))
+       if (mask & BIT(NL80211_STA_FLAG_WME) &&
+           local->hw.queues >= IEEE80211_NUM_ACS)
                sta->sta.wme = set & BIT(NL80211_STA_FLAG_WME);
 
        if (mask & BIT(NL80211_STA_FLAG_MFP)) {
index 17eda3575d7d926fabae7832c33ae7fd47fe98ab..6da4e72f81788dae0dbfb161dd32d489bfaf68a8 100644 (file)
@@ -1016,7 +1016,7 @@ static void ieee80211_update_sta_info(struct ieee80211_sub_if_data *sdata,
                }
        }
 
-       if (sta && elems->wmm_info)
+       if (sta && elems->wmm_info && local->hw.queues >= IEEE80211_NUM_ACS)
                sta->sta.wme = true;
 
        if (sta && elems->ht_operation && elems->ht_cap_elem &&
index 8a06b1abc47a43f7a70cc9ce9fb5b6e154312665..0cbcde11fae399ccc24d50e5a21f9e244dd907f6 100644 (file)
@@ -2990,7 +2990,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
                sta->sta.mfp = false;
        }
 
-       sta->sta.wme = elems.wmm_param;
+       sta->sta.wme = elems.wmm_param && local->hw.queues >= IEEE80211_NUM_ACS;
 
        err = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
        if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT))
index 34b0e7545cc5e379041bf3ddd112d2ddc0931477..018f029d0c95701460ffeea630042f436f0d4d79 100644 (file)
@@ -2088,8 +2088,8 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
        if (ieee80211_vif_is_mesh(&sdata->vif))
                wme_sta = true;
 
-       /* receiver and we are QoS enabled, use a QoS type frame */
-       if (wme_sta && local->hw.queues >= IEEE80211_NUM_ACS) {
+       /* receiver does QoS (which also means we do) use it */
+       if (wme_sta) {
                fc |= cpu_to_le16(IEEE80211_STYPE_QOS_DATA);
                hdrlen += 2;
        }