Commit 5ecd5d82 authored by Johannes Berg's avatar Johannes Berg

wifi: mac80211: pass link conf to abort_channel_switch

Pass the link conf to the abort_channel_switch driver
method so the driver can handle things correctly.
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: default avatarMiriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240228095718.27f621106ddd.Iadd3d69b722ffe5934779a32a0e4e596a4e33ed4@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent e6ee3a37
...@@ -1470,7 +1470,8 @@ int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw, ...@@ -1470,7 +1470,8 @@ int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw,
} }
void iwl_mvm_abort_channel_switch(struct ieee80211_hw *hw, void iwl_mvm_abort_channel_switch(struct ieee80211_hw *hw,
struct ieee80211_vif *vif) struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf)
{ {
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
...@@ -5551,8 +5552,16 @@ void iwl_mvm_channel_switch_rx_beacon(struct ieee80211_hw *hw, ...@@ -5551,8 +5552,16 @@ void iwl_mvm_channel_switch_rx_beacon(struct ieee80211_hw *hw,
if (chsw->count >= mvmvif->csa_count && chsw->block_tx) { if (chsw->count >= mvmvif->csa_count && chsw->block_tx) {
if (mvmvif->csa_misbehave) { if (mvmvif->csa_misbehave) {
struct ieee80211_bss_conf *link_conf;
/* Second time, give up on this AP*/ /* Second time, give up on this AP*/
iwl_mvm_abort_channel_switch(hw, vif);
link_conf = wiphy_dereference(hw->wiphy,
vif->link_conf[chsw->link_id]);
if (WARN_ON(!link_conf))
return;
iwl_mvm_abort_channel_switch(hw, vif, link_conf);
ieee80211_chswitch_done(vif, false, 0); ieee80211_chswitch_done(vif, false, 0);
mvmvif->csa_misbehave = false; mvmvif->csa_misbehave = false;
return; return;
......
...@@ -2709,7 +2709,8 @@ int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw, ...@@ -2709,7 +2709,8 @@ int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_channel_switch *chsw); struct ieee80211_channel_switch *chsw);
void iwl_mvm_abort_channel_switch(struct ieee80211_hw *hw, void iwl_mvm_abort_channel_switch(struct ieee80211_hw *hw,
struct ieee80211_vif *vif); struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf);
void iwl_mvm_channel_switch_rx_beacon(struct ieee80211_hw *hw, void iwl_mvm_channel_switch_rx_beacon(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_channel_switch *chsw); struct ieee80211_channel_switch *chsw);
......
...@@ -4268,7 +4268,7 @@ struct ieee80211_prep_tx_info { ...@@ -4268,7 +4268,7 @@ struct ieee80211_prep_tx_info {
* after a channel switch procedure is completed, allowing the * after a channel switch procedure is completed, allowing the
* driver to go back to a normal configuration. * driver to go back to a normal configuration.
* @abort_channel_switch: This is an optional callback that is called * @abort_channel_switch: This is an optional callback that is called
* when channel switch procedure was completed, allowing the * when channel switch procedure was aborted, allowing the
* driver to go back to a normal configuration. * driver to go back to a normal configuration.
* @channel_switch_rx_beacon: This is an optional callback that is called * @channel_switch_rx_beacon: This is an optional callback that is called
* when channel switch procedure is in progress and additional beacon with * when channel switch procedure is in progress and additional beacon with
...@@ -4664,7 +4664,8 @@ struct ieee80211_ops { ...@@ -4664,7 +4664,8 @@ struct ieee80211_ops {
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf); struct ieee80211_bss_conf *link_conf);
void (*abort_channel_switch)(struct ieee80211_hw *hw, void (*abort_channel_switch)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif); struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf);
void (*channel_switch_rx_beacon)(struct ieee80211_hw *hw, void (*channel_switch_rx_beacon)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_channel_switch *ch_switch); struct ieee80211_channel_switch *ch_switch);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Portions of this file * Portions of this file
* Copyright(c) 2016 Intel Deutschland GmbH * Copyright(c) 2016 Intel Deutschland GmbH
* Copyright (C) 2018 - 2019, 2021 - 2023 Intel Corporation * Copyright (C) 2018-2019, 2021-2024 Intel Corporation
*/ */
#ifndef __MAC80211_DRIVER_OPS #ifndef __MAC80211_DRIVER_OPS
...@@ -1180,8 +1180,9 @@ drv_post_channel_switch(struct ieee80211_link_data *link) ...@@ -1180,8 +1180,9 @@ drv_post_channel_switch(struct ieee80211_link_data *link)
} }
static inline void static inline void
drv_abort_channel_switch(struct ieee80211_sub_if_data *sdata) drv_abort_channel_switch(struct ieee80211_link_data *link)
{ {
struct ieee80211_sub_if_data *sdata = link->sdata;
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
might_sleep(); might_sleep();
...@@ -1193,7 +1194,8 @@ drv_abort_channel_switch(struct ieee80211_sub_if_data *sdata) ...@@ -1193,7 +1194,8 @@ drv_abort_channel_switch(struct ieee80211_sub_if_data *sdata)
trace_drv_abort_channel_switch(local, sdata); trace_drv_abort_channel_switch(local, sdata);
if (local->ops->abort_channel_switch) if (local->ops->abort_channel_switch)
local->ops->abort_channel_switch(&local->hw, &sdata->vif); local->ops->abort_channel_switch(&local->hw, &sdata->vif,
link->conf);
} }
static inline void static inline void
......
...@@ -2004,7 +2004,7 @@ ieee80211_sta_abort_chanswitch(struct ieee80211_link_data *link) ...@@ -2004,7 +2004,7 @@ ieee80211_sta_abort_chanswitch(struct ieee80211_link_data *link)
link->csa_block_tx = false; link->csa_block_tx = false;
link->conf->csa_active = false; link->conf->csa_active = false;
drv_abort_channel_switch(sdata); drv_abort_channel_switch(link);
} }
static void static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment