mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 23:29:10 -04:00
wifi: iwlwifi: mvm: Remove unused iwl_mvm_ftm_add_pasn_sta
iwl_mvm_ftm_add_pasn_sta() was added in 2020 by
commit 0739a7d70e ("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
This commit is contained in:
committed by
Johannes Berg
parent
7efd4b6130
commit
8c7df6490b
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user