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

wifi: mac80211: add support for mld in ieee80211_chswitch_done



This allows to finalize the CSA per link.
In case the switch didn't work, tear down the MLD connection.
Also pass the ieee80211_bss_conf to post_channel_switch to let the
driver know which link completed the switch.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230828130311.3d3eacc88436.Ic2d14e2285aa1646216a56806cfd4a8d0054437c@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 5ea82df1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6122,7 +6122,7 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
	if (il->ops->set_channel_switch(il, ch_switch)) {
		clear_bit(S_CHANNEL_SWITCH_PENDING, &il->status);
		il->switch_channel = 0;
		ieee80211_chswitch_done(il->vif, false);
		ieee80211_chswitch_done(il->vif, false, 0);
	}

out:
+1 −1
Original line number Diff line number Diff line
@@ -4090,7 +4090,7 @@ il_chswitch_done(struct il_priv *il, bool is_success)
		return;

	if (test_and_clear_bit(S_CHANNEL_SWITCH_PENDING, &il->status))
		ieee80211_chswitch_done(il->vif, is_success);
		ieee80211_chswitch_done(il->vif, is_success, 0);
}
EXPORT_SYMBOL(il_chswitch_done);

+3 −3
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
/******************************************************************************
 *
 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
 * Copyright (C) 2018 - 2019, 2022 Intel Corporation
 * Copyright(C) 2018 - 2019, 2022 - 2023 Intel Corporation
 *
 * Portions of this file are derived from the ipw3945 project, as well
 * as portions of the ieee80211 subsystem header files.
@@ -1001,7 +1001,7 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
	if (priv->lib->set_channel_switch(priv, ch_switch)) {
		clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status);
		priv->switch_channel = 0;
		ieee80211_chswitch_done(ctx->vif, false);
		ieee80211_chswitch_done(ctx->vif, false, 0);
	}

out:
@@ -1024,7 +1024,7 @@ void iwl_chswitch_done(struct iwl_priv *priv, bool is_success)
		return;

	if (ctx->vif)
		ieee80211_chswitch_done(ctx->vif, is_success);
		ieee80211_chswitch_done(ctx->vif, is_success, 0);
}

static void iwlagn_configure_filter(struct ieee80211_hw *hw,
+1 −1
Original line number Diff line number Diff line
@@ -1839,7 +1839,7 @@ void iwl_mvm_channel_switch_start_notif(struct iwl_mvm *mvm,

		iwl_mvm_csa_client_absent(mvm, vif);
		cancel_delayed_work(&mvmvif->csa_work);
		ieee80211_chswitch_done(vif, true);
		ieee80211_chswitch_done(vif, true, 0);
		break;
	default:
		/* should never happen */
+6 −4
Original line number Diff line number Diff line
@@ -1370,7 +1370,8 @@ int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
}

int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw,
				struct ieee80211_vif *vif)
				struct ieee80211_vif *vif,
				struct ieee80211_bss_conf *link_conf)
{
	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
@@ -1452,7 +1453,8 @@ void iwl_mvm_abort_channel_switch(struct ieee80211_hw *hw,
	mvmvif->csa_failed = true;
	mutex_unlock(&mvm->mutex);

	iwl_mvm_post_channel_switch(hw, vif);
	/* If we're here, we can't support MLD */
	iwl_mvm_post_channel_switch(hw, vif, &vif->bss_conf);
}

void iwl_mvm_channel_switch_disconnect_wk(struct work_struct *wk)
@@ -1464,7 +1466,7 @@ void iwl_mvm_channel_switch_disconnect_wk(struct work_struct *wk)
	vif = container_of((void *)mvmvif, struct ieee80211_vif, drv_priv);

	/* Trigger disconnect (should clear the CSA state) */
	ieee80211_chswitch_done(vif, false);
	ieee80211_chswitch_done(vif, false, 0);
}

static u8
@@ -5535,7 +5537,7 @@ void iwl_mvm_channel_switch_rx_beacon(struct ieee80211_hw *hw,
		if (mvmvif->csa_misbehave) {
			/* Second time, give up on this AP*/
			iwl_mvm_abort_channel_switch(hw, vif);
			ieee80211_chswitch_done(vif, false);
			ieee80211_chswitch_done(vif, false, 0);
			mvmvif->csa_misbehave = false;
			return;
		}
Loading