Commit 7953a1f5 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Johannes Berg
Browse files

wifi: iwlwifi: mvm: exit EMLSR earlier if bss_param_ch_cnt is updated



If we lose beacons and bss_param_ch_cnt gets updated on the other link,
we need to exit EMLSR earlier.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.9c5ad120b937.Ibdde0b3770d0821e802009d4684b617220dd6e1a@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 447c55e2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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)
+10 −3
Original line number Diff line number Diff line
@@ -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));