diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-07-22 08:50:47 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-08-15 08:38:08 -0400 |
commit | a74a8c846fb699f3277c0c21278bd4c414074b4a (patch) | |
tree | 35650df83624505b2a90a4195f350f0e3ecb3800 /net/mac80211 | |
parent | c9d26423e56ce1ab4d786f92aebecf859d419293 (diff) |
mac80211: don't duplicate station QoS capability data
We currently track the QoS capability twice: for all peer stations
in the WLAN_STA_WME flag, and for any clients associated to an AP
interface separately for drivers in the sta->sta.wme field.
Remove the WLAN_STA_WME flag and track the capability only in the
driver-visible field, getting rid of the limitation that the field
is only valid in AP mode.
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/cfg.c | 13 | ||||
-rw-r--r-- | net/mac80211/debugfs_sta.c | 3 | ||||
-rw-r--r-- | net/mac80211/ibss.c | 2 | ||||
-rw-r--r-- | net/mac80211/mesh_plink.c | 4 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 3 | ||||
-rw-r--r-- | net/mac80211/sta_info.c | 4 | ||||
-rw-r--r-- | net/mac80211/sta_info.h | 2 | ||||
-rw-r--r-- | net/mac80211/tdls.c | 3 | ||||
-rw-r--r-- | net/mac80211/tx.c | 6 | ||||
-rw-r--r-- | net/mac80211/wme.c | 4 |
10 files changed, 16 insertions, 28 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 927b4ea0128b..4d8989b87960 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1011,15 +1011,8 @@ static int sta_apply_parameters(struct ieee80211_local *local, | |||
1011 | clear_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE); | 1011 | clear_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE); |
1012 | } | 1012 | } |
1013 | 1013 | ||
1014 | if (mask & BIT(NL80211_STA_FLAG_WME)) { | 1014 | if (mask & BIT(NL80211_STA_FLAG_WME)) |
1015 | if (set & BIT(NL80211_STA_FLAG_WME)) { | 1015 | sta->sta.wme = set & BIT(NL80211_STA_FLAG_WME); |
1016 | set_sta_flag(sta, WLAN_STA_WME); | ||
1017 | sta->sta.wme = true; | ||
1018 | } else { | ||
1019 | clear_sta_flag(sta, WLAN_STA_WME); | ||
1020 | sta->sta.wme = false; | ||
1021 | } | ||
1022 | } | ||
1023 | 1016 | ||
1024 | if (mask & BIT(NL80211_STA_FLAG_MFP)) { | 1017 | if (mask & BIT(NL80211_STA_FLAG_MFP)) { |
1025 | if (set & BIT(NL80211_STA_FLAG_MFP)) | 1018 | if (set & BIT(NL80211_STA_FLAG_MFP)) |
@@ -3352,7 +3345,7 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev, | |||
3352 | band = chanctx_conf->def.chan->band; | 3345 | band = chanctx_conf->def.chan->band; |
3353 | sta = sta_info_get_bss(sdata, peer); | 3346 | sta = sta_info_get_bss(sdata, peer); |
3354 | if (sta) { | 3347 | if (sta) { |
3355 | qos = test_sta_flag(sta, WLAN_STA_WME); | 3348 | qos = sta->sta.wme; |
3356 | } else { | 3349 | } else { |
3357 | rcu_read_unlock(); | 3350 | rcu_read_unlock(); |
3358 | return -ENOLINK; | 3351 | return -ENOLINK; |
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 3db96648b45a..4a20fb8f1e23 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c | |||
@@ -77,7 +77,8 @@ static ssize_t sta_flags_read(struct file *file, char __user *userbuf, | |||
77 | TEST(AUTH), TEST(ASSOC), TEST(PS_STA), | 77 | TEST(AUTH), TEST(ASSOC), TEST(PS_STA), |
78 | TEST(PS_DRIVER), TEST(AUTHORIZED), | 78 | TEST(PS_DRIVER), TEST(AUTHORIZED), |
79 | TEST(SHORT_PREAMBLE), | 79 | TEST(SHORT_PREAMBLE), |
80 | TEST(WME), TEST(WDS), TEST(CLEAR_PS_FILT), | 80 | sta->sta.wme ? "WME\n" : "", |
81 | TEST(WDS), TEST(CLEAR_PS_FILT), | ||
81 | TEST(MFP), TEST(BLOCK_BA), TEST(PSPOLL), | 82 | TEST(MFP), TEST(BLOCK_BA), TEST(PSPOLL), |
82 | TEST(UAPSD), TEST(SP), TEST(TDLS_PEER), | 83 | TEST(UAPSD), TEST(SP), TEST(TDLS_PEER), |
83 | TEST(TDLS_PEER_AUTH), TEST(4ADDR_EVENT), | 84 | TEST(TDLS_PEER_AUTH), TEST(4ADDR_EVENT), |
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 9713dc54ea4b..5f9654d31a8d 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -1038,7 +1038,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | if (sta && elems->wmm_info) | 1040 | if (sta && elems->wmm_info) |
1041 | set_sta_flag(sta, WLAN_STA_WME); | 1041 | sta->sta.wme = true; |
1042 | 1042 | ||
1043 | if (sta && elems->ht_operation && elems->ht_cap_elem && | 1043 | if (sta && elems->ht_operation && elems->ht_cap_elem && |
1044 | sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_20_NOHT && | 1044 | sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_20_NOHT && |
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 63b874101b27..8d67c1ebfbda 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -431,14 +431,12 @@ __mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *hw_addr) | |||
431 | return NULL; | 431 | return NULL; |
432 | 432 | ||
433 | sta->plink_state = NL80211_PLINK_LISTEN; | 433 | sta->plink_state = NL80211_PLINK_LISTEN; |
434 | sta->sta.wme = true; | ||
434 | 435 | ||
435 | sta_info_pre_move_state(sta, IEEE80211_STA_AUTH); | 436 | sta_info_pre_move_state(sta, IEEE80211_STA_AUTH); |
436 | sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC); | 437 | sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC); |
437 | sta_info_pre_move_state(sta, IEEE80211_STA_AUTHORIZED); | 438 | sta_info_pre_move_state(sta, IEEE80211_STA_AUTHORIZED); |
438 | 439 | ||
439 | set_sta_flag(sta, WLAN_STA_WME); | ||
440 | sta->sta.wme = true; | ||
441 | |||
442 | return sta; | 440 | return sta; |
443 | } | 441 | } |
444 | 442 | ||
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 31a8afaf7332..0e8d59a0e17e 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -2677,8 +2677,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, | |||
2677 | if (ifmgd->flags & IEEE80211_STA_MFP_ENABLED) | 2677 | if (ifmgd->flags & IEEE80211_STA_MFP_ENABLED) |
2678 | set_sta_flag(sta, WLAN_STA_MFP); | 2678 | set_sta_flag(sta, WLAN_STA_MFP); |
2679 | 2679 | ||
2680 | if (elems.wmm_param) | 2680 | sta->sta.wme = elems.wmm_param; |
2681 | set_sta_flag(sta, WLAN_STA_WME); | ||
2682 | 2681 | ||
2683 | err = sta_info_move_state(sta, IEEE80211_STA_ASSOC); | 2682 | err = sta_info_move_state(sta, IEEE80211_STA_ASSOC); |
2684 | if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT)) | 2683 | if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT)) |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index c6ee2139fbc5..e1f957d5935e 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -1179,7 +1179,7 @@ static void ieee80211_send_null_response(struct ieee80211_sub_if_data *sdata, | |||
1179 | struct sk_buff *skb; | 1179 | struct sk_buff *skb; |
1180 | int size = sizeof(*nullfunc); | 1180 | int size = sizeof(*nullfunc); |
1181 | __le16 fc; | 1181 | __le16 fc; |
1182 | bool qos = test_sta_flag(sta, WLAN_STA_WME); | 1182 | bool qos = sta->sta.wme; |
1183 | struct ieee80211_tx_info *info; | 1183 | struct ieee80211_tx_info *info; |
1184 | struct ieee80211_chanctx_conf *chanctx_conf; | 1184 | struct ieee80211_chanctx_conf *chanctx_conf; |
1185 | 1185 | ||
@@ -1834,7 +1834,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | |||
1834 | sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHORIZED); | 1834 | sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHORIZED); |
1835 | if (test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE)) | 1835 | if (test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE)) |
1836 | sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_SHORT_PREAMBLE); | 1836 | sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_SHORT_PREAMBLE); |
1837 | if (test_sta_flag(sta, WLAN_STA_WME)) | 1837 | if (sta->sta.wme) |
1838 | sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_WME); | 1838 | sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_WME); |
1839 | if (test_sta_flag(sta, WLAN_STA_MFP)) | 1839 | if (test_sta_flag(sta, WLAN_STA_MFP)) |
1840 | sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_MFP); | 1840 | sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_MFP); |
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index d411bcc8ef08..89c40d5c0633 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -31,7 +31,6 @@ | |||
31 | * when virtual port control is not in use. | 31 | * when virtual port control is not in use. |
32 | * @WLAN_STA_SHORT_PREAMBLE: Station is capable of receiving short-preamble | 32 | * @WLAN_STA_SHORT_PREAMBLE: Station is capable of receiving short-preamble |
33 | * frames. | 33 | * frames. |
34 | * @WLAN_STA_WME: Station is a QoS-STA. | ||
35 | * @WLAN_STA_WDS: Station is one of our WDS peers. | 34 | * @WLAN_STA_WDS: Station is one of our WDS peers. |
36 | * @WLAN_STA_CLEAR_PS_FILT: Clear PS filter in hardware (using the | 35 | * @WLAN_STA_CLEAR_PS_FILT: Clear PS filter in hardware (using the |
37 | * IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next | 36 | * IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next |
@@ -69,7 +68,6 @@ enum ieee80211_sta_info_flags { | |||
69 | WLAN_STA_PS_STA, | 68 | WLAN_STA_PS_STA, |
70 | WLAN_STA_AUTHORIZED, | 69 | WLAN_STA_AUTHORIZED, |
71 | WLAN_STA_SHORT_PREAMBLE, | 70 | WLAN_STA_SHORT_PREAMBLE, |
72 | WLAN_STA_WME, | ||
73 | WLAN_STA_WDS, | 71 | WLAN_STA_WDS, |
74 | WLAN_STA_CLEAR_PS_FILT, | 72 | WLAN_STA_CLEAR_PS_FILT, |
75 | WLAN_STA_MFP, | 73 | WLAN_STA_MFP, |
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index 1b21050be174..f2cb3b6c1871 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c | |||
@@ -316,8 +316,7 @@ ieee80211_tdls_add_setup_cfm_ies(struct ieee80211_sub_if_data *sdata, | |||
316 | } | 316 | } |
317 | 317 | ||
318 | /* add the QoS param IE if both the peer and we support it */ | 318 | /* add the QoS param IE if both the peer and we support it */ |
319 | if (local->hw.queues >= IEEE80211_NUM_ACS && | 319 | if (local->hw.queues >= IEEE80211_NUM_ACS && sta->sta.wme) |
320 | test_sta_flag(sta, WLAN_STA_WME)) | ||
321 | ieee80211_tdls_add_wmm_param_ie(sdata, skb); | 320 | ieee80211_tdls_add_wmm_param_ie(sdata, skb); |
322 | 321 | ||
323 | /* add any custom IEs that go before HT operation */ | 322 | /* add any custom IEs that go before HT operation */ |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 464106c023d8..2051cc60f8ce 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1844,7 +1844,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1844 | memcpy(hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN); | 1844 | memcpy(hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN); |
1845 | hdrlen = 30; | 1845 | hdrlen = 30; |
1846 | authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); | 1846 | authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); |
1847 | wme_sta = test_sta_flag(sta, WLAN_STA_WME); | 1847 | wme_sta = sta->sta.wme; |
1848 | } | 1848 | } |
1849 | ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, | 1849 | ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, |
1850 | u.ap); | 1850 | u.ap); |
@@ -1957,7 +1957,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1957 | if (sta) { | 1957 | if (sta) { |
1958 | authorized = test_sta_flag(sta, | 1958 | authorized = test_sta_flag(sta, |
1959 | WLAN_STA_AUTHORIZED); | 1959 | WLAN_STA_AUTHORIZED); |
1960 | wme_sta = test_sta_flag(sta, WLAN_STA_WME); | 1960 | wme_sta = sta->sta.wme; |
1961 | tdls_peer = test_sta_flag(sta, | 1961 | tdls_peer = test_sta_flag(sta, |
1962 | WLAN_STA_TDLS_PEER); | 1962 | WLAN_STA_TDLS_PEER); |
1963 | tdls_auth = test_sta_flag(sta, | 1963 | tdls_auth = test_sta_flag(sta, |
@@ -2035,7 +2035,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
2035 | sta = sta_info_get(sdata, hdr.addr1); | 2035 | sta = sta_info_get(sdata, hdr.addr1); |
2036 | if (sta) { | 2036 | if (sta) { |
2037 | authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); | 2037 | authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); |
2038 | wme_sta = test_sta_flag(sta, WLAN_STA_WME); | 2038 | wme_sta = sta->sta.wme; |
2039 | } | 2039 | } |
2040 | } | 2040 | } |
2041 | 2041 | ||
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index d51422c778de..6459946f0b74 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c | |||
@@ -118,7 +118,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, | |||
118 | case NL80211_IFTYPE_AP_VLAN: | 118 | case NL80211_IFTYPE_AP_VLAN: |
119 | sta = rcu_dereference(sdata->u.vlan.sta); | 119 | sta = rcu_dereference(sdata->u.vlan.sta); |
120 | if (sta) { | 120 | if (sta) { |
121 | qos = test_sta_flag(sta, WLAN_STA_WME); | 121 | qos = sta->sta.wme; |
122 | break; | 122 | break; |
123 | } | 123 | } |
124 | case NL80211_IFTYPE_AP: | 124 | case NL80211_IFTYPE_AP: |
@@ -145,7 +145,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, | |||
145 | if (!sta && ra && !is_multicast_ether_addr(ra)) { | 145 | if (!sta && ra && !is_multicast_ether_addr(ra)) { |
146 | sta = sta_info_get(sdata, ra); | 146 | sta = sta_info_get(sdata, ra); |
147 | if (sta) | 147 | if (sta) |
148 | qos = test_sta_flag(sta, WLAN_STA_WME); | 148 | qos = sta->sta.wme; |
149 | } | 149 | } |
150 | rcu_read_unlock(); | 150 | rcu_read_unlock(); |
151 | 151 | ||