diff options
author | Johannes Berg <johannes.berg@intel.com> | 2023-03-29 10:05:40 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-03-30 12:08:44 +0200 |
commit | a6ef8a88fc38cc1bf5c440be73fe520d04301424 (patch) | |
tree | cad235f429fae9a13b4c908a27c954af8c57c09e /drivers/net/wireless/intel/iwlwifi/mvm/sta.c | |
parent | de50140b701911a34c4652d3a4212cce8f4fccd7 (diff) | |
download | linux-a6ef8a88fc38cc1bf5c440be73fe520d04301424.tar.gz linux-a6ef8a88fc38cc1bf5c440be73fe520d04301424.tar.bz2 linux-a6ef8a88fc38cc1bf5c440be73fe520d04301424.zip |
wifi: iwlwifi: mvm: correctly use link in iwl_mvm_sta_del()
This function can be invoked for both MLO and non-MLO, so
it must deal with multi-link correctly. Notable, on auth
timeout, we'd otherwise get a warning due to the erroneous
deflink usage in MLO cases.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230329100040.b85f6052d51a.Iedfef4b4c4f3ca557aebc0093fdc3f5cfb49b507@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/sta.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index a57de37f6e02..8489554e58b1 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -1986,14 +1986,22 @@ int iwl_mvm_wait_sta_queues_empty(struct iwl_mvm *mvm, */ bool iwl_mvm_sta_del(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_sta *sta, - struct iwl_mvm_link_sta *mvm_link_sta, int *ret) + struct ieee80211_link_sta *link_sta, int *ret) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); + struct iwl_mvm_vif_link_info *mvm_link = + mvmvif->link[link_sta->link_id]; struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); - u8 sta_id = mvm_link_sta->sta_id; + struct iwl_mvm_link_sta *mvm_link_sta; + u8 sta_id; lockdep_assert_held(&mvm->mutex); + mvm_link_sta = + rcu_dereference_protected(mvm_sta->link[link_sta->link_id], + lockdep_is_held(&mvm->mutex)); + sta_id = mvm_link_sta->sta_id; + /* If there is a TXQ still marked as reserved - free it */ if (mvm_sta->reserved_queue != IEEE80211_INVAL_HW_QUEUE) { u8 reserved_txq = mvm_sta->reserved_queue; @@ -2022,10 +2030,10 @@ bool iwl_mvm_sta_del(struct iwl_mvm *mvm, struct ieee80211_vif *vif, return true; /* first remove remaining keys */ - iwl_mvm_sec_key_remove_ap(mvm, vif, &mvmvif->deflink, 0); + iwl_mvm_sec_key_remove_ap(mvm, vif, mvm_link, 0); /* unassoc - go ahead - remove the AP STA now */ - mvmvif->deflink.ap_sta_id = IWL_MVM_INVALID_STA; + mvm_link->ap_sta_id = IWL_MVM_INVALID_STA; } /* @@ -2082,7 +2090,7 @@ int iwl_mvm_rm_sta(struct iwl_mvm *mvm, iwl_mvm_disable_sta_queues(mvm, vif, sta); - if (iwl_mvm_sta_del(mvm, vif, sta, &mvm_sta->deflink, &ret)) + if (iwl_mvm_sta_del(mvm, vif, sta, &sta->deflink, &ret)) return ret; ret = iwl_mvm_rm_sta_common(mvm, mvm_sta->deflink.sta_id); |