wifi: iwlwifi: mvm: support CSA with MLD
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 30 Aug 2023 08:30:49 +0000 (11:30 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Sep 2023 10:36:25 +0000 (12:36 +0200)
Pass the right link_id to ieee80211_chswitch_done.
Use the link_conf parameter passed to post_channel_switch() to get the
right ap_sta_id.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230830112059.19470584fa51.Iad38b5369bededaa126b3eb3cff79f23d61bd783@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

index b28d998c65c5b3686dff33131398c9b8d8f82dea..b97b805d34865e9dad8d0ac56b1a8b0cc91704dc 100644 (file)
@@ -1761,6 +1761,7 @@ void iwl_mvm_channel_switch_start_notif(struct iwl_mvm *mvm,
        u32 id_n_color, csa_id;
        /* save mac_id or link_id to use later to cancel csa if needed */
        u32 id;
+       u32 mac_link_id = 0;
        u8 notif_ver = iwl_fw_lookup_notif_ver(mvm->fw, MAC_CONF_GROUP,
                                               CHANNEL_SWITCH_START_NOTIF, 0);
        bool csa_active;
@@ -1790,6 +1791,7 @@ void iwl_mvm_channel_switch_start_notif(struct iwl_mvm *mvm,
                        goto out_unlock;
 
                id = link_id;
+               mac_link_id = bss_conf->link_id;
                vif = bss_conf->vif;
                csa_active = bss_conf->csa_active;
        }
@@ -1839,7 +1841,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, 0);
+               ieee80211_chswitch_done(vif, true, mac_link_id);
                break;
        default:
                /* should never happen */
index 921f72dcddac9bafa84c991c459ee8cb80768504..4b3d84213466265fb1e63316c6426c80eb3494ab 100644 (file)
@@ -1381,10 +1381,11 @@ int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw,
 
        if (vif->type == NL80211_IFTYPE_STATION) {
                struct iwl_mvm_sta *mvmsta;
+               unsigned int link_id = link_conf->link_id;
+               u8 ap_sta_id = mvmvif->link[link_id]->ap_sta_id;
 
                mvmvif->csa_bcn_pending = false;
-               mvmsta = iwl_mvm_sta_from_staid_protected(mvm,
-                                                         mvmvif->deflink.ap_sta_id);
+               mvmsta = iwl_mvm_sta_from_staid_protected(mvm, ap_sta_id);
 
                if (WARN_ON(!mvmsta)) {
                        ret = -EIO;