aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-03-21 03:09:55 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-03-30 04:47:16 -0400
commit527871d7206dac2733d0bae52f5a328811d299ee (patch)
treeae1f8e35f545365d82647b322803cc3d4d8b5321
parenta73f8e21f3f93159bc19e154e8f50891c22c11db (diff)
mac80211: make sta.wme indicate whether QoS is used
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>
-rw-r--r--include/net/mac80211.h3
-rw-r--r--net/mac80211/cfg.c3
-rw-r--r--net/mac80211/ibss.c2
-rw-r--r--net/mac80211/mlme.c2
-rw-r--r--net/mac80211/tx.c4
5 files changed, 8 insertions, 6 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 94c8c62800c3..201bc68e0cff 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1557,7 +1557,8 @@ struct ieee80211_sta_rates {
1557 * @supp_rates: Bitmap of supported rates (per band) 1557 * @supp_rates: Bitmap of supported rates (per band)
1558 * @ht_cap: HT capabilities of this STA; restricted to our own capabilities 1558 * @ht_cap: HT capabilities of this STA; restricted to our own capabilities
1559 * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities 1559 * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities
1560 * @wme: indicates whether the STA supports QoS/WME. 1560 * @wme: indicates whether the STA supports QoS/WME (if local devices does,
1561 * otherwise always false)
1561 * @drv_priv: data area for driver use, will always be aligned to 1562 * @drv_priv: data area for driver use, will always be aligned to
1562 * sizeof(void *), size is determined in hw information. 1563 * sizeof(void *), size is determined in hw information.
1563 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid 1564 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 49401238ac39..301215be59ef 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1073,7 +1073,8 @@ static int sta_apply_parameters(struct ieee80211_local *local,
1073 clear_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE); 1073 clear_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE);
1074 } 1074 }
1075 1075
1076 if (mask & BIT(NL80211_STA_FLAG_WME)) 1076 if (mask & BIT(NL80211_STA_FLAG_WME) &&
1077 local->hw.queues >= IEEE80211_NUM_ACS)
1077 sta->sta.wme = set & BIT(NL80211_STA_FLAG_WME); 1078 sta->sta.wme = set & BIT(NL80211_STA_FLAG_WME);
1078 1079
1079 if (mask & BIT(NL80211_STA_FLAG_MFP)) { 1080 if (mask & BIT(NL80211_STA_FLAG_MFP)) {
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 17eda3575d7d..6da4e72f8178 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1016,7 +1016,7 @@ static void ieee80211_update_sta_info(struct ieee80211_sub_if_data *sdata,
1016 } 1016 }
1017 } 1017 }
1018 1018
1019 if (sta && elems->wmm_info) 1019 if (sta && elems->wmm_info && local->hw.queues >= IEEE80211_NUM_ACS)
1020 sta->sta.wme = true; 1020 sta->sta.wme = true;
1021 1021
1022 if (sta && elems->ht_operation && elems->ht_cap_elem && 1022 if (sta && elems->ht_operation && elems->ht_cap_elem &&
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 8a06b1abc47a..0cbcde11fae3 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2990,7 +2990,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
2990 sta->sta.mfp = false; 2990 sta->sta.mfp = false;
2991 } 2991 }
2992 2992
2993 sta->sta.wme = elems.wmm_param; 2993 sta->sta.wme = elems.wmm_param && local->hw.queues >= IEEE80211_NUM_ACS;
2994 2994
2995 err = sta_info_move_state(sta, IEEE80211_STA_ASSOC); 2995 err = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
2996 if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT)) 2996 if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT))
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 34b0e7545cc5..018f029d0c95 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2088,8 +2088,8 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
2088 if (ieee80211_vif_is_mesh(&sdata->vif)) 2088 if (ieee80211_vif_is_mesh(&sdata->vif))
2089 wme_sta = true; 2089 wme_sta = true;
2090 2090
2091 /* receiver and we are QoS enabled, use a QoS type frame */ 2091 /* receiver does QoS (which also means we do) use it */
2092 if (wme_sta && local->hw.queues >= IEEE80211_NUM_ACS) { 2092 if (wme_sta) {
2093 fc |= cpu_to_le16(IEEE80211_STYPE_QOS_DATA); 2093 fc |= cpu_to_le16(IEEE80211_STYPE_QOS_DATA);
2094 hdrlen += 2; 2094 hdrlen += 2;
2095 } 2095 }