wifi: iwlwifi: mvm: Correctly set link configuration
authorIlan Peer <ilan.peer@intel.com>
Wed, 4 Oct 2023 09:36:34 +0000 (12:36 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:59:02 +0000 (11:59 +0100)
[ Upstream commit 35b9281fb710ea9fa47dca56774f4a9606fe9154 ]

In case the link puncturing is changed such that the channel
is no longer punctured, configure the FW correctly indicating
the EHT parameters changed (with a 0 punctured map).

Allow EHT parameters configuration only when the link really
supports EHT.

Fixes: 55eb1c5fa4b2 ("wifi: iwlwifi: mvm: add support for the new LINK command")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.2666ef86e032.I4b0e95722660acc5345ceefba7e8866a69572e8e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/mvm/link.c
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c

index ace82e2c5bd913bf54c917d2a67f1067b0622670..4f8d2a3191ec7c9c7c543df8fb7d0cfa18ff009b 100644 (file)
@@ -194,11 +194,14 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
                flags_mask |= LINK_FLG_MU_EDCA_CW;
        }
 
-       if (link_conf->eht_puncturing && !iwlwifi_mod_params.disable_11be)
-               cmd.puncture_mask = cpu_to_le16(link_conf->eht_puncturing);
-       else
-               /* This flag can be set only if the MAC has eht support */
-               changes &= ~LINK_CONTEXT_MODIFY_EHT_PARAMS;
+       if (changes & LINK_CONTEXT_MODIFY_EHT_PARAMS) {
+               if (iwlwifi_mod_params.disable_11be ||
+                   !link_conf->eht_support)
+                       changes &= ~LINK_CONTEXT_MODIFY_EHT_PARAMS;
+               else
+                       cmd.puncture_mask =
+                               cpu_to_le16(link_conf->eht_puncturing);
+       }
 
        cmd.bss_color = link_conf->he_bss_color.color;
 
index 778a311b500bcef17efa50fb3ea701e895ae1b00..a3a2e9a1fa7bdea4ecda6add1feaec27fdc58e1d 100644 (file)
@@ -653,7 +653,7 @@ iwl_mvm_mld_link_info_changed_station(struct iwl_mvm *mvm,
        }
 
        /* Update EHT Puncturing info */
-       if (changes & BSS_CHANGED_EHT_PUNCTURING && vif->cfg.assoc && has_eht)
+       if (changes & BSS_CHANGED_EHT_PUNCTURING && vif->cfg.assoc)
                link_changes |= LINK_CONTEXT_MODIFY_EHT_PARAMS;
 
        if (link_changes) {