]> git.baikalelectronics.ru Git - kernel.git/commitdiff
wifi: mac80211: correct SMPS mode in HE 6 GHz capability
authorJohannes Berg <johannes.berg@intel.com>
Thu, 25 Aug 2022 18:57:32 +0000 (20:57 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 26 Aug 2022 07:56:36 +0000 (09:56 +0200)
If we add 6 GHz capability in MLO, we cannot use the SMPS
mode from the deflink. Pass it separately instead since on
a second link we don't even have a link data struct yet.

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

index 9f3e1d7d0d0c717a9e3f1f7aeeefc62e0509d6f2..9f358977a6b9b852557b0718ca0a31e1c72ef09d 100644 (file)
@@ -2386,6 +2386,7 @@ u8 *ieee80211_ie_build_he_cap(ieee80211_conn_flags_t disable_flags, u8 *pos,
                              const struct ieee80211_sta_he_cap *he_cap,
                              u8 *end);
 void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata,
+                                   enum ieee80211_smps_mode smps_mode,
                                    struct sk_buff *skb);
 u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef);
 int ieee80211_parse_bitrates(enum nl80211_chan_width width,
index 6991c4c479daf1ddd9fb0a2504d6cc3768a9e730..5a99b8f6e465ff6b5f29907c839f4eaabae16152 100644 (file)
@@ -634,7 +634,7 @@ int mesh_add_he_6ghz_cap_ie(struct ieee80211_sub_if_data *sdata,
        if (!iftd)
                return 0;
 
-       ieee80211_ie_build_he_6ghz_cap(sdata, skb);
+       ieee80211_ie_build_he_6ghz_cap(sdata, sdata->deflink.smps_mode, skb);
        return 0;
 }
 
index 82cf4ad8bf422cb572ab27e1daa4231cb313b4d2..00d0c433fa2ba2e2d4ab69878c7d3d39c4bf4e65 100644 (file)
@@ -695,6 +695,7 @@ static bool ieee80211_add_vht_ie(struct ieee80211_sub_if_data *sdata,
 static void ieee80211_add_he_ie(struct ieee80211_sub_if_data *sdata,
                                struct sk_buff *skb,
                                struct ieee80211_supported_band *sband,
+                               enum ieee80211_smps_mode smps_mode,
                                ieee80211_conn_flags_t conn_flags)
 {
        u8 *pos, *pre_he_pos;
@@ -719,7 +720,7 @@ static void ieee80211_add_he_ie(struct ieee80211_sub_if_data *sdata,
        /* trim excess if any */
        skb_trim(skb, skb->len - (pre_he_pos + he_cap_size - pos));
 
-       ieee80211_ie_build_he_6ghz_cap(sdata, skb);
+       ieee80211_ie_build_he_6ghz_cap(sdata, smps_mode, skb);
 }
 
 static void ieee80211_add_eht_ie(struct ieee80211_sub_if_data *sdata,
@@ -1100,7 +1101,7 @@ static size_t ieee80211_assoc_link_elems(struct ieee80211_sub_if_data *sdata,
                                               offset);
 
        if (!(assoc_data->link[link_id].conn_flags & IEEE80211_CONN_DISABLE_HE)) {
-               ieee80211_add_he_ie(sdata, skb, sband,
+               ieee80211_add_he_ie(sdata, skb, sband, smps_mode,
                                    assoc_data->link[link_id].conn_flags);
                ADD_PRESENT_EXT_ELEM(WLAN_EID_EXT_HE_CAPABILITY);
        }
index 37324a22371aa00b1c627ae9f79fc20381fa78c0..a292e63377c330404b7af26d1866d0c1780f4591 100644 (file)
@@ -3084,6 +3084,7 @@ end:
 }
 
 void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata,
+                                   enum ieee80211_smps_mode smps_mode,
                                    struct sk_buff *skb)
 {
        struct ieee80211_supported_band *sband;
@@ -3110,7 +3111,7 @@ void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata,
        cap = le16_to_cpu(iftd->he_6ghz_capa.capa);
        cap &= ~IEEE80211_HE_6GHZ_CAP_SM_PS;
 
-       switch (sdata->deflink.smps_mode) {
+       switch (smps_mode) {
        case IEEE80211_SMPS_AUTOMATIC:
        case IEEE80211_SMPS_NUM_MODES:
                WARN_ON(1);