Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a74a8c84 authored by Johannes Berg's avatar Johannes Berg
Browse files

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: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent c9d26423
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1405,7 +1405,7 @@ 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 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
 *	sizeof(void *), size is determined in hw information.
 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid
+3 −10
Original line number Diff line number Diff line
@@ -1011,15 +1011,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 (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_WME))
		sta->sta.wme = set & BIT(NL80211_STA_FLAG_WME);

	if (mask & 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,
	band = chanctx_conf->def.chan->band;
	sta = sta_info_get_bss(sdata, peer);
	if (sta) {
		qos = test_sta_flag(sta, WLAN_STA_WME);
		qos = sta->sta.wme;
	} else {
		rcu_read_unlock();
		return -ENOLINK;
+2 −1
Original line number Diff line number Diff line
@@ -77,7 +77,8 @@ static ssize_t sta_flags_read(struct file *file, char __user *userbuf,
			    TEST(AUTH), TEST(ASSOC), TEST(PS_STA),
			    TEST(PS_DRIVER), TEST(AUTHORIZED),
			    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(UAPSD), TEST(SP), TEST(TDLS_PEER),
			    TEST(TDLS_PEER_AUTH), TEST(4ADDR_EVENT),
+1 −1
Original line number Diff line number Diff line
@@ -1038,7 +1038,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
		}

		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 &&
		    sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_20_NOHT &&
+1 −3
Original line number Diff line number Diff line
@@ -431,14 +431,12 @@ __mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *hw_addr)
		return NULL;

	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_ASSOC);
	sta_info_pre_move_state(sta, IEEE80211_STA_AUTHORIZED);

	set_sta_flag(sta, WLAN_STA_WME);
	sta->sta.wme = true;

	return sta;
}

Loading