提交 a74a8c84 编写于 作者: J Johannes Berg

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: NArik Nemtsov <arik@wizery.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 c9d26423
...@@ -1405,7 +1405,7 @@ struct ieee80211_sta_rates { ...@@ -1405,7 +1405,7 @@ struct ieee80211_sta_rates {
* @supp_rates: Bitmap of supported rates (per band) * @supp_rates: Bitmap of supported rates (per band)
* @ht_cap: HT capabilities of this STA; restricted to our own capabilities * @ht_cap: HT capabilities of this STA; restricted to our own capabilities
* @vht_cap: VHT 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 WME. Only valid during AP-mode. * @wme: indicates whether the STA supports QoS/WME.
* @drv_priv: data area for driver use, will always be aligned to * @drv_priv: data area for driver use, will always be aligned to
* sizeof(void *), size is determined in hw information. * sizeof(void *), size is determined in hw information.
* @uapsd_queues: bitmap of queues configured for uapsd. Only valid * @uapsd_queues: bitmap of queues configured for uapsd. Only valid
......
...@@ -1011,15 +1011,8 @@ static int sta_apply_parameters(struct ieee80211_local *local, ...@@ -1011,15 +1011,8 @@ static int sta_apply_parameters(struct ieee80211_local *local,
clear_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE); clear_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE);
} }
if (mask & BIT(NL80211_STA_FLAG_WME)) { if (mask & BIT(NL80211_STA_FLAG_WME))
if (set & BIT(NL80211_STA_FLAG_WME)) { sta->sta.wme = set & BIT(NL80211_STA_FLAG_WME);
set_sta_flag(sta, WLAN_STA_WME);
sta->sta.wme = true;
} else {
clear_sta_flag(sta, WLAN_STA_WME);
sta->sta.wme = false;
}
}
if (mask & BIT(NL80211_STA_FLAG_MFP)) { if (mask & BIT(NL80211_STA_FLAG_MFP)) {
if (set & BIT(NL80211_STA_FLAG_MFP)) if (set & BIT(NL80211_STA_FLAG_MFP))
...@@ -3352,7 +3345,7 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev, ...@@ -3352,7 +3345,7 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
band = chanctx_conf->def.chan->band; band = chanctx_conf->def.chan->band;
sta = sta_info_get_bss(sdata, peer); sta = sta_info_get_bss(sdata, peer);
if (sta) { if (sta) {
qos = test_sta_flag(sta, WLAN_STA_WME); qos = sta->sta.wme;
} else { } else {
rcu_read_unlock(); rcu_read_unlock();
return -ENOLINK; return -ENOLINK;
......
...@@ -77,7 +77,8 @@ static ssize_t sta_flags_read(struct file *file, char __user *userbuf, ...@@ -77,7 +77,8 @@ static ssize_t sta_flags_read(struct file *file, char __user *userbuf,
TEST(AUTH), TEST(ASSOC), TEST(PS_STA), TEST(AUTH), TEST(ASSOC), TEST(PS_STA),
TEST(PS_DRIVER), TEST(AUTHORIZED), TEST(PS_DRIVER), TEST(AUTHORIZED),
TEST(SHORT_PREAMBLE), TEST(SHORT_PREAMBLE),
TEST(WME), TEST(WDS), TEST(CLEAR_PS_FILT), sta->sta.wme ? "WME\n" : "",
TEST(WDS), TEST(CLEAR_PS_FILT),
TEST(MFP), TEST(BLOCK_BA), TEST(PSPOLL), TEST(MFP), TEST(BLOCK_BA), TEST(PSPOLL),
TEST(UAPSD), TEST(SP), TEST(TDLS_PEER), TEST(UAPSD), TEST(SP), TEST(TDLS_PEER),
TEST(TDLS_PEER_AUTH), TEST(4ADDR_EVENT), TEST(TDLS_PEER_AUTH), TEST(4ADDR_EVENT),
......
...@@ -1038,7 +1038,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, ...@@ -1038,7 +1038,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
} }
if (sta && elems->wmm_info) if (sta && elems->wmm_info)
set_sta_flag(sta, WLAN_STA_WME); sta->sta.wme = true;
if (sta && elems->ht_operation && elems->ht_cap_elem && if (sta && elems->ht_operation && elems->ht_cap_elem &&
sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_20_NOHT && sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_20_NOHT &&
......
...@@ -431,14 +431,12 @@ __mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *hw_addr) ...@@ -431,14 +431,12 @@ __mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *hw_addr)
return NULL; return NULL;
sta->plink_state = NL80211_PLINK_LISTEN; sta->plink_state = NL80211_PLINK_LISTEN;
sta->sta.wme = true;
sta_info_pre_move_state(sta, IEEE80211_STA_AUTH); sta_info_pre_move_state(sta, IEEE80211_STA_AUTH);
sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC); sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC);
sta_info_pre_move_state(sta, IEEE80211_STA_AUTHORIZED); sta_info_pre_move_state(sta, IEEE80211_STA_AUTHORIZED);
set_sta_flag(sta, WLAN_STA_WME);
sta->sta.wme = true;
return sta; return sta;
} }
......
...@@ -2677,8 +2677,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, ...@@ -2677,8 +2677,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
if (ifmgd->flags & IEEE80211_STA_MFP_ENABLED) if (ifmgd->flags & IEEE80211_STA_MFP_ENABLED)
set_sta_flag(sta, WLAN_STA_MFP); set_sta_flag(sta, WLAN_STA_MFP);
if (elems.wmm_param) sta->sta.wme = elems.wmm_param;
set_sta_flag(sta, WLAN_STA_WME);
err = sta_info_move_state(sta, IEEE80211_STA_ASSOC); err = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT)) if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT))
......
...@@ -1179,7 +1179,7 @@ static void ieee80211_send_null_response(struct ieee80211_sub_if_data *sdata, ...@@ -1179,7 +1179,7 @@ static void ieee80211_send_null_response(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb; struct sk_buff *skb;
int size = sizeof(*nullfunc); int size = sizeof(*nullfunc);
__le16 fc; __le16 fc;
bool qos = test_sta_flag(sta, WLAN_STA_WME); bool qos = sta->sta.wme;
struct ieee80211_tx_info *info; struct ieee80211_tx_info *info;
struct ieee80211_chanctx_conf *chanctx_conf; struct ieee80211_chanctx_conf *chanctx_conf;
...@@ -1834,7 +1834,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) ...@@ -1834,7 +1834,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHORIZED); sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHORIZED);
if (test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE)) if (test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE))
sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_SHORT_PREAMBLE); sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_SHORT_PREAMBLE);
if (test_sta_flag(sta, WLAN_STA_WME)) if (sta->sta.wme)
sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_WME); sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_WME);
if (test_sta_flag(sta, WLAN_STA_MFP)) if (test_sta_flag(sta, WLAN_STA_MFP))
sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_MFP); sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_MFP);
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
* when virtual port control is not in use. * when virtual port control is not in use.
* @WLAN_STA_SHORT_PREAMBLE: Station is capable of receiving short-preamble * @WLAN_STA_SHORT_PREAMBLE: Station is capable of receiving short-preamble
* frames. * frames.
* @WLAN_STA_WME: Station is a QoS-STA.
* @WLAN_STA_WDS: Station is one of our WDS peers. * @WLAN_STA_WDS: Station is one of our WDS peers.
* @WLAN_STA_CLEAR_PS_FILT: Clear PS filter in hardware (using the * @WLAN_STA_CLEAR_PS_FILT: Clear PS filter in hardware (using the
* IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next * IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next
...@@ -69,7 +68,6 @@ enum ieee80211_sta_info_flags { ...@@ -69,7 +68,6 @@ enum ieee80211_sta_info_flags {
WLAN_STA_PS_STA, WLAN_STA_PS_STA,
WLAN_STA_AUTHORIZED, WLAN_STA_AUTHORIZED,
WLAN_STA_SHORT_PREAMBLE, WLAN_STA_SHORT_PREAMBLE,
WLAN_STA_WME,
WLAN_STA_WDS, WLAN_STA_WDS,
WLAN_STA_CLEAR_PS_FILT, WLAN_STA_CLEAR_PS_FILT,
WLAN_STA_MFP, WLAN_STA_MFP,
......
...@@ -316,8 +316,7 @@ ieee80211_tdls_add_setup_cfm_ies(struct ieee80211_sub_if_data *sdata, ...@@ -316,8 +316,7 @@ ieee80211_tdls_add_setup_cfm_ies(struct ieee80211_sub_if_data *sdata,
} }
/* add the QoS param IE if both the peer and we support it */ /* add the QoS param IE if both the peer and we support it */
if (local->hw.queues >= IEEE80211_NUM_ACS && if (local->hw.queues >= IEEE80211_NUM_ACS && sta->sta.wme)
test_sta_flag(sta, WLAN_STA_WME))
ieee80211_tdls_add_wmm_param_ie(sdata, skb); ieee80211_tdls_add_wmm_param_ie(sdata, skb);
/* add any custom IEs that go before HT operation */ /* add any custom IEs that go before HT operation */
......
...@@ -1844,7 +1844,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, ...@@ -1844,7 +1844,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
memcpy(hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN); memcpy(hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN);
hdrlen = 30; hdrlen = 30;
authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED);
wme_sta = test_sta_flag(sta, WLAN_STA_WME); wme_sta = sta->sta.wme;
} }
ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
u.ap); u.ap);
...@@ -1957,7 +1957,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, ...@@ -1957,7 +1957,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
if (sta) { if (sta) {
authorized = test_sta_flag(sta, authorized = test_sta_flag(sta,
WLAN_STA_AUTHORIZED); WLAN_STA_AUTHORIZED);
wme_sta = test_sta_flag(sta, WLAN_STA_WME); wme_sta = sta->sta.wme;
tdls_peer = test_sta_flag(sta, tdls_peer = test_sta_flag(sta,
WLAN_STA_TDLS_PEER); WLAN_STA_TDLS_PEER);
tdls_auth = test_sta_flag(sta, tdls_auth = test_sta_flag(sta,
...@@ -2035,7 +2035,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, ...@@ -2035,7 +2035,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
sta = sta_info_get(sdata, hdr.addr1); sta = sta_info_get(sdata, hdr.addr1);
if (sta) { if (sta) {
authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED);
wme_sta = test_sta_flag(sta, WLAN_STA_WME); wme_sta = sta->sta.wme;
} }
} }
......
...@@ -118,7 +118,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, ...@@ -118,7 +118,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
case NL80211_IFTYPE_AP_VLAN: case NL80211_IFTYPE_AP_VLAN:
sta = rcu_dereference(sdata->u.vlan.sta); sta = rcu_dereference(sdata->u.vlan.sta);
if (sta) { if (sta) {
qos = test_sta_flag(sta, WLAN_STA_WME); qos = sta->sta.wme;
break; break;
} }
case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP:
...@@ -145,7 +145,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, ...@@ -145,7 +145,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
if (!sta && ra && !is_multicast_ether_addr(ra)) { if (!sta && ra && !is_multicast_ether_addr(ra)) {
sta = sta_info_get(sdata, ra); sta = sta_info_get(sdata, ra);
if (sta) if (sta)
qos = test_sta_flag(sta, WLAN_STA_WME); qos = sta->sta.wme;
} }
rcu_read_unlock(); rcu_read_unlock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册