]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: iwlwifi: mvm: Remove unused iwl_mvm_ftm_add_pasn_sta
authorDr. David Alan Gilbert <linux@treblig.org>
Mon, 23 Dec 2024 01:32:00 +0000 (01:32 +0000)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 11 Feb 2025 10:48:27 +0000 (11:48 +0100)
iwl_mvm_ftm_add_pasn_sta() was added in 2020 by
commit 0739a7d70e00 ("iwlwifi: mvm: initiator: add option for adding a
PASN responder")
but hasn't been used.

Remove it.

That was the only caller of iwl_mvm_ftm_remove_pasn_sta().

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241223013202.340180-5-linux@treblig.org
drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

index b26141c30c61c5cdcf4647f49666a995c2647b09..f7034fa40c265a0acd28eddb6e322a779f876dc5 100644 (file)
@@ -46,107 +46,6 @@ struct iwl_mvm_ftm_iter_data {
        u8 *tk;
 };
 
-int iwl_mvm_ftm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
-                            u8 *addr, u32 cipher, u8 *tk, u32 tk_len,
-                            u8 *hltk, u32 hltk_len)
-{
-       struct iwl_mvm_ftm_pasn_entry *pasn = kzalloc(sizeof(*pasn),
-                                                     GFP_KERNEL);
-       u32 expected_tk_len;
-
-       lockdep_assert_held(&mvm->mutex);
-
-       if (!pasn)
-               return -ENOBUFS;
-
-       iwl_mvm_ftm_remove_pasn_sta(mvm, addr);
-
-       pasn->cipher = iwl_mvm_cipher_to_location_cipher(cipher);
-
-       switch (pasn->cipher) {
-       case IWL_LOCATION_CIPHER_CCMP_128:
-       case IWL_LOCATION_CIPHER_GCMP_128:
-               expected_tk_len = WLAN_KEY_LEN_CCMP;
-               break;
-       case IWL_LOCATION_CIPHER_GCMP_256:
-               expected_tk_len = WLAN_KEY_LEN_GCMP_256;
-               break;
-       default:
-               goto out;
-       }
-
-       /*
-        * If associated to this AP and already have security context,
-        * the TK is already configured for this station, so it
-        * shouldn't be set again here.
-        */
-       if (vif->cfg.assoc) {
-               struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
-               struct ieee80211_bss_conf *link_conf;
-               unsigned int link_id;
-               struct ieee80211_sta *sta;
-               u8 sta_id;
-
-               rcu_read_lock();
-               for_each_vif_active_link(vif, link_conf, link_id) {
-                       if (memcmp(addr, link_conf->bssid, ETH_ALEN))
-                               continue;
-
-                       sta_id = mvmvif->link[link_id]->ap_sta_id;
-                       sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]);
-                       if (!IS_ERR_OR_NULL(sta) && sta->mfp)
-                               expected_tk_len = 0;
-                       break;
-               }
-               rcu_read_unlock();
-       }
-
-       if (tk_len != expected_tk_len ||
-           (hltk_len && hltk_len != sizeof(pasn->hltk))) {
-               IWL_ERR(mvm, "Invalid key length: tk_len=%u hltk_len=%u\n",
-                       tk_len, hltk_len);
-               goto out;
-       }
-
-       if (!expected_tk_len && !hltk_len) {
-               IWL_ERR(mvm, "TK and HLTK not set\n");
-               goto out;
-       }
-
-       memcpy(pasn->addr, addr, sizeof(pasn->addr));
-
-       if (hltk_len) {
-               memcpy(pasn->hltk, hltk, sizeof(pasn->hltk));
-               pasn->flags |= IWL_MVM_PASN_FLAG_HAS_HLTK;
-       }
-
-       if (tk && tk_len)
-               memcpy(pasn->tk, tk, sizeof(pasn->tk));
-
-       list_add_tail(&pasn->list, &mvm->ftm_initiator.pasn_list);
-       return 0;
-out:
-       kfree(pasn);
-       return -EINVAL;
-}
-
-void iwl_mvm_ftm_remove_pasn_sta(struct iwl_mvm *mvm, u8 *addr)
-{
-       struct iwl_mvm_ftm_pasn_entry *entry, *prev;
-
-       lockdep_assert_held(&mvm->mutex);
-
-       list_for_each_entry_safe(entry, prev, &mvm->ftm_initiator.pasn_list,
-                                list) {
-               if (memcmp(entry->addr, addr, sizeof(entry->addr)))
-                       continue;
-
-               list_del(&entry->list);
-               kfree(entry);
-               return;
-       }
-}
-
 static void iwl_mvm_ftm_reset(struct iwl_mvm *mvm)
 {
        struct iwl_mvm_loc_entry *e, *t;
index 69ad8d48983243a5d47db1954de927e23ac90fa9..d17592d3f6c8e3f7592680193a9ddbef1d2d2ae3 100644 (file)
@@ -2532,10 +2532,6 @@ int iwl_mvm_ftm_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 void iwl_mvm_ftm_abort(struct iwl_mvm *mvm, struct cfg80211_pmsr_request *req);
 void iwl_mvm_ftm_initiator_smooth_config(struct iwl_mvm *mvm);
 void iwl_mvm_ftm_initiator_smooth_stop(struct iwl_mvm *mvm);
-int iwl_mvm_ftm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
-                            u8 *addr, u32 cipher, u8 *tk, u32 tk_len,
-                            u8 *hltk, u32 hltk_len);
-void iwl_mvm_ftm_remove_pasn_sta(struct iwl_mvm *mvm, u8 *addr);
 
 /* TDLS */