aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ht.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2022-06-15 09:20:45 +0200
committerJohannes Berg <johannes.berg@intel.com>2022-06-20 12:57:08 +0200
commitc71420db653aba30a234d1e4cf86dde376e604fa (patch)
tree1e29e5b76bc2b04a6a3e93f9b362f3380b60558b /net/mac80211/ht.c
parentwifi: mac80211: ethtool: use deflink for now (diff)
downloadlinux-dev-c71420db653aba30a234d1e4cf86dde376e604fa.tar.xz
linux-dev-c71420db653aba30a234d1e4cf86dde376e604fa.zip
wifi: mac80211: RCU-ify link STA pointers
We need to be able to access these in a race-free way under traffic while adding/removing them, so RCU-ify the pointers. This requires passing a link_sta to a lot of functions so we don't have to do the RCU handling everywhere. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ht.c')
-rw-r--r--net/mac80211/ht.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 111828b559a0..2eb3a409b70f 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -138,8 +138,9 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband,
const struct ieee80211_ht_cap *ht_cap_ie,
- struct sta_info *sta, unsigned int link_id)
+ struct link_sta_info *link_sta)
{
+ struct sta_info *sta = link_sta->sta;
struct ieee80211_sta_ht_cap ht_cap, own_cap;
u8 ampdu_info, tx_mcs_set_cap;
int i, max_tx_streams;
@@ -243,12 +244,11 @@ bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
sta->sta.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_3839;
apply:
- changed = memcmp(&sta->sta.link[link_id]->ht_cap,
- &ht_cap, sizeof(ht_cap));
+ changed = memcmp(&link_sta->pub->ht_cap, &ht_cap, sizeof(ht_cap));
- memcpy(&sta->sta.link[link_id]->ht_cap, &ht_cap, sizeof(ht_cap));
+ memcpy(&link_sta->pub->ht_cap, &ht_cap, sizeof(ht_cap));
- switch (sdata->vif.link_conf[link_id]->chandef.width) {
+ switch (sdata->vif.link_conf[link_sta->link_id]->chandef.width) {
default:
WARN_ON_ONCE(1);
fallthrough;
@@ -265,9 +265,9 @@ bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
break;
}
- sta->sta.link[link_id]->bandwidth = bw;
+ link_sta->pub->bandwidth = bw;
- sta->link[link_id]->cur_max_bandwidth =
+ link_sta->cur_max_bandwidth =
ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 ?
IEEE80211_STA_RX_BW_40 : IEEE80211_STA_RX_BW_20;