]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: iwlwifi: mvm: exit EMLSR earlier if bss_param_ch_cnt is updated
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 8 Oct 2024 04:25:16 +0000 (07:25 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 23 Oct 2024 14:43:41 +0000 (16:43 +0200)
If we lose beacons and bss_param_ch_cnt gets updated on the other link,
we need to exit EMLSR earlier.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.9c5ad120b937.Ibdde0b3770d0821e802009d4684b617220dd6e1a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/constants.h
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c

index ddf484027d4fe6804bb90489ed60acbca60b1495..fdccdea918bf06136d4aeed4d70fe9ceb496876c 100644 (file)
@@ -17,7 +17,8 @@
 #define IWL_MVM_TRIGGER_LINK_SEL_TIME_SEC      30
 #define IWL_MVM_TPT_COUNT_WINDOW_SEC           5
 #define IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH_2_LINKS       5
-#define IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH       11
+#define IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH       15
+#define IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH_BSS_PARAM_CHANGED     11
 
 #define IWL_MVM_DEFAULT_PS_TX_DATA_TIMEOUT     (100 * USEC_PER_MSEC)
 #define IWL_MVM_DEFAULT_PS_RX_DATA_TIMEOUT     (100 * USEC_PER_MSEC)
index a7a10e716e651702848f4da053126d0efdf648e6..9a43df49493fb05b24c6ae438feddba18d604521 100644 (file)
@@ -1605,6 +1605,7 @@ iwl_mvm_handle_missed_beacons_notif(struct iwl_mvm *mvm,
                                               0);
        u8 new_notif_ver = iwl_fw_lookup_notif_ver(mvm->fw, MAC_CONF_GROUP,
                                                   MISSED_BEACONS_NOTIF, 0);
+       struct ieee80211_bss_conf *bss_conf;
 
        /* If the firmware uses the new notification (from MAC_CONF_GROUP),
         * refer to that notification's version.
@@ -1617,9 +1618,9 @@ iwl_mvm_handle_missed_beacons_notif(struct iwl_mvm *mvm,
        /* before version four the ID in the notification refers to mac ID */
        if (notif_ver < 4) {
                vif = iwl_mvm_rcu_dereference_vif_id(mvm, id, false);
+               bss_conf = &vif->bss_conf;
        } else {
-               struct ieee80211_bss_conf *bss_conf =
-                       iwl_mvm_rcu_fw_link_id_to_link_conf(mvm, id, false);
+               bss_conf = iwl_mvm_rcu_fw_link_id_to_link_conf(mvm, id, false);
 
                if (!bss_conf)
                        return;
@@ -1664,6 +1665,8 @@ iwl_mvm_handle_missed_beacons_notif(struct iwl_mvm *mvm,
                                 rx_missed_bcon, rx_missed_bcon_since_rx);
                }
        } else if (link_id >= 0 && hweight16(vif->active_links) > 1) {
+               u32 bss_param_ch_cnt_link_id =
+                       bss_conf->bss_param_ch_cnt_link_id;
                u32 scnd_lnk_bcn_lost = 0;
 
                if (notif_ver >= 5 &&
@@ -1677,10 +1680,14 @@ iwl_mvm_handle_missed_beacons_notif(struct iwl_mvm *mvm,
                /* Exit EMLSR if we lost more than
                 * IWL_MVM_MISSED_BEACONS_EXIT_ESR_THRESH beacons on boths links
                 * OR more than IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH on any link.
+                * OR more than IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH_BSS_PARAM_CHANGED
+                * and the link's bss_param_ch_count has changed.
                 */
                if ((rx_missed_bcon >= IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH_2_LINKS &&
                     scnd_lnk_bcn_lost >= IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH_2_LINKS) ||
-                   rx_missed_bcon >= IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH)
+                   rx_missed_bcon >= IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH ||
+                   (bss_param_ch_cnt_link_id != link_id &&
+                    rx_missed_bcon >= IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH_BSS_PARAM_CHANGED))
                        iwl_mvm_exit_esr(mvm, vif,
                                         IWL_MVM_ESR_EXIT_MISSED_BEACON,
                                         iwl_mvm_get_primary_link(vif));