summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2023-03-29 10:05:24 +0300
committerJohannes Berg <johannes.berg@intel.com>2023-03-30 13:08:40 +0300
commit072573f6971dcedeb0e221259a41718e42154c8f (patch)
tree038bc3bc81d0d254d8275ebb65b79713e1d56db6 /drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
parentf14ad95a5d9086efba664eeb9f1f02fd8bc08c65 (diff)
downloadlinux-072573f6971dcedeb0e221259a41718e42154c8f.tar.xz
wifi: iwlwifi: mvm: remove only link-specific AP keys
When we remove the AP station, we iterate over the links and remove all the keys, however, the key iteration will return all keys for all links, so skip the ones that we don't need based on the link ID. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230329100039.e724878f502e.I66870d4629244b4b309be79e11cbbd384bdf93be@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
index 44206e3e1a87..f4785c0a0b84 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
@@ -195,6 +195,7 @@ static void iwl_mvm_sec_key_remove_ap_iter(struct ieee80211_hw *hw,
void *data)
{
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
+ unsigned int link_id = (uintptr_t)data;
if (key->hw_key_idx == STA_KEY_IDX_INVALID)
return;
@@ -202,13 +203,17 @@ static void iwl_mvm_sec_key_remove_ap_iter(struct ieee80211_hw *hw,
if (sta)
return;
+ if (key->link_id >= 0 && key->link_id != link_id)
+ return;
+
_iwl_mvm_sec_key_del(mvm, vif, NULL, key, CMD_ASYNC);
key->hw_key_idx = STA_KEY_IDX_INVALID;
}
void iwl_mvm_sec_key_remove_ap(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
- struct iwl_mvm_vif_link_info *link)
+ struct iwl_mvm_vif_link_info *link,
+ unsigned int link_id)
{
u32 sec_key_id = WIDE_ID(DATA_PATH_GROUP, SEC_KEY_CMD);
u8 sec_key_ver = iwl_fw_lookup_cmd_ver(mvm->fw, sec_key_id, 0);
@@ -222,5 +227,5 @@ void iwl_mvm_sec_key_remove_ap(struct iwl_mvm *mvm,
ieee80211_iter_keys_rcu(mvm->hw, vif,
iwl_mvm_sec_key_remove_ap_iter,
- NULL);
+ (void *)(uintptr_t)link_id);
}