]> git.baikalelectronics.ru Git - kernel.git/commitdiff
iwlwifi: mvm: restrict FW SMPS request
authorJohannes Berg <johannes.berg@intel.com>
Mon, 2 Aug 2021 14:28:20 +0000 (17:28 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 26 Aug 2021 20:33:22 +0000 (23:33 +0300)
The firmware SMPS request should only be honoured if the
connection is currently with HE and on 160 MHz, so check
that and then potentially reapply any request if the BW
changes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.0cdcac5660da.I9ee7956fd4f48399855d1f97728bc58b36caf112@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/ops.c

index 3a7f756c4545f19a274f4d75e16237754c3e7d9c..b2072e19b5dc892b6e9ebc8f9fae23386b6003ad 100644 (file)
@@ -2440,6 +2440,9 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
                IWL_DEBUG_MAC80211(mvm, "arp filter changed\n");
                iwl_mvm_configure_bcast_filter(mvm);
        }
+
+       if (changes & BSS_CHANGED_BANDWIDTH)
+               iwl_mvm_apply_fw_smps_request(vif);
 }
 
 static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw,
index 880cf2042531808c6089684387fd3d6878de955f..564ccfbd15bdd45c55b77ff52c2cbc4c7314b2e9 100644 (file)
@@ -214,11 +214,14 @@ void iwl_mvm_apply_fw_smps_request(struct ieee80211_vif *vif)
 {
        struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
        struct iwl_mvm *mvm = mvmvif->mvm;
+       enum ieee80211_smps_mode mode = IEEE80211_SMPS_AUTOMATIC;
 
-       iwl_mvm_update_smps(mvm, vif, IWL_MVM_SMPS_REQ_FW,
-                           mvm->fw_static_smps_request ?
-                               IEEE80211_SMPS_STATIC :
-                               IEEE80211_SMPS_AUTOMATIC);
+       if (mvm->fw_static_smps_request &&
+           vif->bss_conf.chandef.width == NL80211_CHAN_WIDTH_160 &&
+           vif->bss_conf.he_support)
+               mode = IEEE80211_SMPS_STATIC;
+
+       iwl_mvm_update_smps(mvm, vif, IWL_MVM_SMPS_REQ_FW, mode);
 }
 
 static void iwl_mvm_intf_dual_chain_req(void *data, u8 *mac,