]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: w/a FW SMPS mode selection
authorDaniel Gabay <daniel.gabay@intel.com>
Sat, 8 Mar 2025 21:19:19 +0000 (23:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2025 09:12:47 +0000 (11:12 +0200)
[ Upstream commit b2e709805ce955f80803b7cab3421813c79e1df4 ]

The FW is now responsible of determining the SMPS mode.
If the user disabled power save in a certain vif, we send the vif-level
power command to clear out the POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK bit
for that vif.
But erroneously, the FW checks DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK in
the device-level command to determine the SMPS mode.

To W/A this, send also the device-level command when the power save of a
vif changes, and disable power save if there is any vif that has power
save disabled.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231427.7bf205efa027.I2c793ff1fc2a6779a95faaee1ded348100fd97f1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

index af6644b7e95fbe24210180b8806e34c59c4731b5..e17ad647da48cef0d393a167be3c7fe0f2c3add4 100644 (file)
@@ -4099,6 +4099,20 @@ iwl_mvm_sta_state_authorized_to_assoc(struct iwl_mvm *mvm,
        return 0;
 }
 
+void iwl_mvm_smps_workaround(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
+                            bool update)
+{
+       struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+
+       if (!iwl_mvm_has_rlc_offload(mvm))
+               return;
+
+       mvmvif->ps_disabled = !vif->cfg.ps;
+
+       if (update)
+               iwl_mvm_power_update_mac(mvm);
+}
+
 /* Common part for MLD and non-MLD modes */
 int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw,
                                 struct ieee80211_vif *vif,
@@ -4191,6 +4205,7 @@ int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw,
                   new_state == IEEE80211_STA_AUTHORIZED) {
                ret = iwl_mvm_sta_state_assoc_to_authorized(mvm, vif, sta,
                                                            callbacks);
+               iwl_mvm_smps_workaround(mvm, vif, true);
        } else if (old_state == IEEE80211_STA_AUTHORIZED &&
                   new_state == IEEE80211_STA_ASSOC) {
                ret = iwl_mvm_sta_state_authorized_to_assoc(mvm, vif, sta,
index 341a2a7a49ec9be7f58801e7d75fd18db050ad72..78d7153a0cfca00969a747e251b16c38d74756bd 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2022-2024 Intel Corporation
+ * Copyright (C) 2022-2025 Intel Corporation
  */
 #include "mvm.h"
 
@@ -887,6 +887,7 @@ static void iwl_mvm_mld_vif_cfg_changed_station(struct iwl_mvm *mvm,
        }
 
        if (changes & BSS_CHANGED_PS) {
+               iwl_mvm_smps_workaround(mvm, vif, false);
                ret = iwl_mvm_power_update_mac(mvm);
                if (ret)
                        IWL_ERR(mvm, "failed to update power mode\n");
index ee769da72e68ce83f9536bc3d550c47dcf7a28d7..211f542ec8557219222fc245da3c8b97c96ac5bb 100644 (file)
@@ -3043,4 +3043,7 @@ iwl_mvm_send_ap_tx_power_constraint_cmd(struct iwl_mvm *mvm,
                                        struct ieee80211_vif *vif,
                                        struct ieee80211_bss_conf *bss_conf,
                                        bool is_ap);
+
+void iwl_mvm_smps_workaround(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
+                            bool update);
 #endif /* __IWL_MVM_H__ */