wifi: iwlwifi: mvm: adjust iwl_mvm_sec_key_remove_ap to MLO
authorGregory Greenman <gregory.greenman@intel.com>
Wed, 29 Mar 2023 07:05:14 +0000 (10:05 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 30 Mar 2023 10:08:38 +0000 (12:08 +0200)
It has to be done per link. We still don't support keys
configuration for several links, but the single vif link can
still point to a link different from deflink. For now handle
the removal of keys for the default link.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230329100039.19d729cc4654.I4ebe8e3eb5fc00a994761f7c0ad40107382705ca@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/sta.c

index 2b2221d..44542b0 100644 (file)
@@ -2699,7 +2699,8 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
                        if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART,
                                      &mvm->status)) {
                                /* first remove remaining keys */
-                               iwl_mvm_sec_key_remove_ap(mvm, vif);
+                               iwl_mvm_sec_key_remove_ap(mvm, vif,
+                                                         &mvmvif->deflink);
 
                                /*
                                 * Remove AP station now that
index aa8b4fb..44206e3 100644 (file)
@@ -207,14 +207,14 @@ static void iwl_mvm_sec_key_remove_ap_iter(struct ieee80211_hw *hw,
 }
 
 void iwl_mvm_sec_key_remove_ap(struct iwl_mvm *mvm,
-                              struct ieee80211_vif *vif)
+                              struct ieee80211_vif *vif,
+                              struct iwl_mvm_vif_link_info *link)
 {
-       struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
        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);
 
        if (WARN_ON_ONCE(vif->type != NL80211_IFTYPE_STATION ||
-                        mvmvif->deflink.ap_sta_id == IWL_MVM_INVALID_STA))
+                        link->ap_sta_id == IWL_MVM_INVALID_STA))
                return;
 
        if (!sec_key_ver)
index 7463cb8..be9b2ef 100644 (file)
@@ -538,14 +538,13 @@ static void iwl_mvm_mld_vif_delete_all_stas(struct iwl_mvm *mvm,
        if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
                return;
 
-       iwl_mvm_sec_key_remove_ap(mvm, vif);
-
        for_each_mvm_vif_valid_link(mvmvif, i) {
                struct iwl_mvm_vif_link_info *link = mvmvif->link[i];
 
                if (!link)
                        continue;
 
+               iwl_mvm_sec_key_remove_ap(mvm, vif, link);
                ret = iwl_mvm_mld_rm_sta_id(mvm, vif, link->ap_sta_id);
                if (ret)
                        IWL_ERR(mvm, "failed to remove AP station\n");
index dfe1aff..6421edd 100644 (file)
@@ -2326,7 +2326,8 @@ int iwl_mvm_sec_key_del(struct iwl_mvm *mvm,
                        struct ieee80211_sta *sta,
                        struct ieee80211_key_conf *keyconf);
 void iwl_mvm_sec_key_remove_ap(struct iwl_mvm *mvm,
-                              struct ieee80211_vif *vif);
+                              struct ieee80211_vif *vif,
+                              struct iwl_mvm_vif_link_info *link);
 
 int iwl_rfi_send_config_cmd(struct iwl_mvm *mvm,
                            struct iwl_rfi_lut_entry *rfi_table);
index eb57aca..f9f512a 100644 (file)
@@ -2022,7 +2022,7 @@ 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);
+               iwl_mvm_sec_key_remove_ap(mvm, vif, &mvmvif->deflink);
 
                /* unassoc - go ahead - remove the AP STA now */
                mvmvif->deflink.ap_sta_id = IWL_MVM_INVALID_STA;