Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5d8f50f authored by Ilan Peer's avatar Ilan Peer Committed by Luca Coelho
Browse files

iwlwifi: mvm: Fix channel switch in case of count <= 1



The code did not consider the case that the channel switch counter
is <= 1, which would result with an inaccurate calculation of the
time event apply time.

As the specification states that in case of counter == 0 the switch
occurs at any time after the reception the frame, and for counter == 1
the switch would happens before the next TBTT, schedule the time
event immediately.

Signed-off-by: default avatarIlan Peer <ilan.peer@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 5f5537ac
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -3875,8 +3875,13 @@ static int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw,

		/* Schedule the time event to a bit before beacon 1,
		 * to make sure we're in the new channel when the
		 * GO/AP arrives.
		 * GO/AP arrives. In case count <= 1 immediately schedule the
		 * TE (this might result with some packet loss or connection
		 * loss).
		 */
		if (chsw->count <= 1)
			apply_time = 0;
		else
			apply_time = chsw->device_timestamp +
				((vif->bss_conf.beacon_int * (chsw->count - 1) -
				  IWL_MVM_CHANNEL_SWITCH_TIME_CLIENT) * 1024);