wifi: mac80211: make ieee80211_he_cap_ie_to_sta_he_cap() MLO-aware
authorJohannes Berg <johannes.berg@intel.com>
Mon, 30 May 2022 21:52:41 +0000 (23:52 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 20 Jun 2022 10:55:32 +0000 (12:55 +0200)
Add the link_id parameter and adjust the code accordingly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/he.c
net/mac80211/ieee80211_i.h
net/mac80211/mesh_plink.c
net/mac80211/mlme.c

index 2c9554174bcfd8275c44235a4bd1b9fc59d5bf2a..e30659b1242bcdadb566fc54371c2f0cfb2f6632 100644 (file)
@@ -1770,7 +1770,7 @@ static int sta_apply_parameters(struct ieee80211_local *local,
                                                  (void *)params->he_capa,
                                                  params->he_capa_len,
                                                  (void *)params->he_6ghz_capa,
-                                                 sta);
+                                                 sta, 0);
 
        if (params->eht_capa)
                ieee80211_eht_cap_ie_to_sta_eht_cap(sdata, sband,
index 20448dda8c4d4559c9de1982094d8f93f537726b..e48e9a021622dafb2089682a2b02b48050f837a1 100644 (file)
@@ -10,7 +10,7 @@
 
 static void
 ieee80211_update_from_he_6ghz_capa(const struct ieee80211_he_6ghz_capa *he_6ghz_capa,
-                                  struct sta_info *sta)
+                                  struct sta_info *sta, unsigned int link_id)
 {
        enum ieee80211_smps_mode smps_mode;
 
@@ -49,7 +49,7 @@ ieee80211_update_from_he_6ghz_capa(const struct ieee80211_he_6ghz_capa *he_6ghz_
                break;
        }
 
-       sta->sta.deflink.he_6ghz_capa = *he_6ghz_capa;
+       sta->sta.link[link_id]->he_6ghz_capa = *he_6ghz_capa;
 }
 
 static void ieee80211_he_mcs_disable(__le16 *he_mcs)
@@ -108,9 +108,9 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
                                  struct ieee80211_supported_band *sband,
                                  const u8 *he_cap_ie, u8 he_cap_len,
                                  const struct ieee80211_he_6ghz_capa *he_6ghz_capa,
-                                 struct sta_info *sta)
+                                 struct sta_info *sta, unsigned int link_id)
 {
-       struct ieee80211_sta_he_cap *he_cap = &sta->sta.deflink.he_cap;
+       struct ieee80211_sta_he_cap *he_cap = &sta->sta.link[link_id]->he_cap;
        struct ieee80211_sta_he_cap own_he_cap;
        struct ieee80211_he_cap_elem *he_cap_ie_elem = (void *)he_cap_ie;
        u8 he_ppe_size;
@@ -153,11 +153,13 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
 
        he_cap->has_he = true;
 
-       sta->deflink.cur_max_bandwidth = ieee80211_sta_cap_rx_bw(sta, 0);
-       sta->sta.deflink.bandwidth = ieee80211_sta_cur_vht_bw(sta, 0);
+       sta->link[link_id]->cur_max_bandwidth =
+               ieee80211_sta_cap_rx_bw(sta, link_id);
+       sta->sta.link[link_id]->bandwidth =
+               ieee80211_sta_cur_vht_bw(sta, link_id);
 
        if (sband->band == NL80211_BAND_6GHZ && he_6ghz_capa)
-               ieee80211_update_from_he_6ghz_capa(he_6ghz_capa, sta);
+               ieee80211_update_from_he_6ghz_capa(he_6ghz_capa, sta, link_id);
 
        ieee80211_he_mcs_intersection(&own_he_cap.he_mcs_nss_supp.rx_mcs_80,
                                      &he_cap->he_mcs_nss_supp.rx_mcs_80,
index 0948d074c4b9bfa608dd847715f78558ae99e457..c3387ffe27f5d9904ed73a5d3dbcb9932d59608e 100644 (file)
@@ -2153,7 +2153,7 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
                                  struct ieee80211_supported_band *sband,
                                  const u8 *he_cap_ie, u8 he_cap_len,
                                  const struct ieee80211_he_6ghz_capa *he_6ghz_capa,
-                                 struct sta_info *sta);
+                                 struct sta_info *sta, unsigned int link_id);
 void
 ieee80211_he_spr_ie_to_bss_conf(struct ieee80211_vif *vif,
                                const struct ieee80211_he_spr *he_spr_ie_elem);
index b64614cd314d84af1bfabdf00de7bbbee83b3e1d..e24bd48bc9156eb2fd7756f75775ece270cc1437 100644 (file)
@@ -447,7 +447,7 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,
        ieee80211_he_cap_ie_to_sta_he_cap(sdata, sband, elems->he_cap,
                                          elems->he_cap_len,
                                          elems->he_6ghz_capa,
-                                         sta);
+                                         sta, 0);
 
        if (bw != sta->sta.deflink.bandwidth)
                changed |= IEEE80211_RC_BW_CHANGED;
index cdbf7a5dc2ba759cf396d9bb28c2b15c671c6e70..b6ee8da076639f8c4d43751acb4c784253ef6a35 100644 (file)
@@ -3579,7 +3579,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
                                                  elems->he_cap,
                                                  elems->he_cap_len,
                                                  elems->he_6ghz_capa,
-                                                 sta);
+                                                 sta, 0);
 
                bss_conf->he_support = sta->sta.deflink.he_cap.has_he;
                if (elems->rsnx && elems->rsnx_len &&