Commit 7efd4b61 authored by Dr. David Alan Gilbert's avatar Dr. David Alan Gilbert Committed by Johannes Berg
Browse files

wifi: iwlwifi: mvm: Remove unused iwl_mvm_ftm_*_add_pasn_sta functions



iwl_mvm_ftm_respoder_add_pasn_sta() and
iwl_mvm_ftm_resp_remove_pasn_sta() were added in 2020 by
commit be82ecd3 ("iwlwifi: mvm: add an option to add PASN station")
but have remained unused.

Remove them.

After that removal iwl_mvm_add_pasn_sta() is now unused.
Remove it.

Signed-off-by: default avatarDr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241223013202.340180-4-linux@treblig.org
parent 63e61664
Loading
Loading
Loading
Loading
+0 −86
Original line number Diff line number Diff line
@@ -324,92 +324,6 @@ static void iwl_mvm_resp_del_pasn_sta(struct iwl_mvm *mvm,
	kfree(sta);
}

int iwl_mvm_ftm_respoder_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)
{
	int ret;
	struct iwl_mvm_pasn_sta *sta = NULL;
	struct iwl_mvm_pasn_hltk_data hltk_data = {
		.addr = addr,
		.hltk = hltk,
	};
	struct iwl_mvm_pasn_hltk_data *hltk_data_ptr = NULL;

	u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw,
					   WIDE_ID(LOCATION_GROUP, TOF_RESPONDER_DYN_CONFIG_CMD),
					   2);

	lockdep_assert_held(&mvm->mutex);

	if (cmd_ver < 3) {
		IWL_ERR(mvm, "Adding PASN station not supported by FW\n");
		return -EOPNOTSUPP;
	}

	if ((!hltk || !hltk_len) && (!tk || !tk_len)) {
		IWL_ERR(mvm, "TK and HLTK not set\n");
		return -EINVAL;
	}

	if (hltk && hltk_len) {
		if (!fw_has_capa(&mvm->fw->ucode_capa,
				 IWL_UCODE_TLV_CAPA_SECURE_LTF_SUPPORT)) {
			IWL_ERR(mvm, "No support for secure LTF measurement\n");
			return -EINVAL;
		}

		hltk_data.cipher = iwl_mvm_cipher_to_location_cipher(cipher);
		if (hltk_data.cipher == IWL_LOCATION_CIPHER_INVALID) {
			IWL_ERR(mvm, "invalid cipher: %u\n", cipher);
			return -EINVAL;
		}

		hltk_data_ptr = &hltk_data;
	}

	if (tk && tk_len) {
		sta = kzalloc(sizeof(*sta) + tk_len, GFP_KERNEL);
		if (!sta)
			return -ENOBUFS;

		ret = iwl_mvm_add_pasn_sta(mvm, vif, &sta->int_sta, addr,
					   cipher, tk, tk_len, &sta->keyconf);
		if (ret) {
			kfree(sta);
			return ret;
		}

		memcpy(sta->addr, addr, ETH_ALEN);
		list_add_tail(&sta->list, &mvm->resp_pasn_list);
	}

	ret = iwl_mvm_ftm_responder_dyn_cfg_v3(mvm, vif, NULL, hltk_data_ptr);
	if (ret && sta)
		iwl_mvm_resp_del_pasn_sta(mvm, vif, sta);

	return ret;
}

int iwl_mvm_ftm_resp_remove_pasn_sta(struct iwl_mvm *mvm,
				     struct ieee80211_vif *vif, u8 *addr)
{
	struct iwl_mvm_pasn_sta *sta, *prev;

	lockdep_assert_held(&mvm->mutex);

	list_for_each_entry_safe(sta, prev, &mvm->resp_pasn_list, list) {
		if (!memcmp(sta->addr, addr, ETH_ALEN)) {
			iwl_mvm_resp_del_pasn_sta(mvm, vif, sta);
			return 0;
		}
	}

	IWL_ERR(mvm, "FTM: PASN station %pM not found\n", addr);
	return -EINVAL;
}

int iwl_mvm_ftm_start_responder(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
				struct ieee80211_bss_conf *bss_conf)
{
+0 −6
Original line number Diff line number Diff line
@@ -2518,12 +2518,6 @@ void iwl_mvm_ftm_restart_responder(struct iwl_mvm *mvm,
				   struct ieee80211_bss_conf *bss_conf);
void iwl_mvm_ftm_responder_stats(struct iwl_mvm *mvm,
				 struct iwl_rx_cmd_buffer *rxb);
int iwl_mvm_ftm_resp_remove_pasn_sta(struct iwl_mvm *mvm,
				     struct ieee80211_vif *vif, u8 *addr);
int iwl_mvm_ftm_respoder_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_responder_clear(struct iwl_mvm *mvm,
				 struct ieee80211_vif *vif);

+0 −61
Original line number Diff line number Diff line
@@ -4311,67 +4311,6 @@ u16 iwl_mvm_tid_queued(struct iwl_mvm *mvm, struct iwl_mvm_tid_data *tid_data)
	return ieee80211_sn_sub(sn, tid_data->next_reclaimed);
}

int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
			 struct iwl_mvm_int_sta *sta, u8 *addr, u32 cipher,
			 u8 *key, u32 key_len,
			 struct ieee80211_key_conf *keyconf)
{
	int ret;
	u16 queue;
	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
	unsigned int wdg_timeout =
		iwl_mvm_get_wd_timeout(mvm, vif);
	bool mld = iwl_mvm_has_mld_api(mvm->fw);
	u32 type = IWL_STA_LINK;

	if (mld)
		type = STATION_TYPE_PEER;

	ret = iwl_mvm_allocate_int_sta(mvm, sta, 0,
				       NL80211_IFTYPE_UNSPECIFIED, type);
	if (ret)
		return ret;

	if (mld)
		ret = iwl_mvm_mld_add_int_sta_with_queue(mvm, sta, addr,
							 mvmvif->deflink.fw_link_id,
							 &queue,
							 IWL_MAX_TID_COUNT,
							 &wdg_timeout);
	else
		ret = iwl_mvm_add_int_sta_with_queue(mvm, mvmvif->id,
						     mvmvif->color, addr, sta,
						     &queue,
						     IWL_MVM_TX_FIFO_BE);
	if (ret)
		goto out;

	keyconf->cipher = cipher;
	memcpy(keyconf->key, key, key_len);
	keyconf->keylen = key_len;
	keyconf->flags = IEEE80211_KEY_FLAG_PAIRWISE;

	if (mld) {
		/* The MFP flag is set according to the station mfp field. Since
		 * we don't have a station, set it manually.
		 */
		u32 key_flags =
			iwl_mvm_get_sec_flags(mvm, vif, NULL, keyconf) |
			IWL_SEC_KEY_FLAG_MFP;
		u32 sta_mask = BIT(sta->sta_id);

		ret = iwl_mvm_mld_send_key(mvm, sta_mask, key_flags, keyconf);
	} else {
		ret = iwl_mvm_send_sta_key(mvm, sta->sta_id, keyconf, false,
					   0, NULL, 0, 0, true);
	}

out:
	if (ret)
		iwl_mvm_dealloc_int_sta(mvm, sta);
	return ret;
}

void iwl_mvm_cancel_channel_switch(struct iwl_mvm *mvm,
				   struct ieee80211_vif *vif,
				   u32 id)
+0 −4
Original line number Diff line number Diff line
@@ -597,10 +597,6 @@ void iwl_mvm_modify_all_sta_disable_tx(struct iwl_mvm *mvm,
void iwl_mvm_csa_client_absent(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
int iwl_mvm_sta_ensure_queue(struct iwl_mvm *mvm, struct ieee80211_txq *txq);
void iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk);
int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
			 struct iwl_mvm_int_sta *sta, u8 *addr, u32 cipher,
			 u8 *key, u32 key_len,
			 struct ieee80211_key_conf *key_conf_out);
void iwl_mvm_cancel_channel_switch(struct iwl_mvm *mvm,
				   struct ieee80211_vif *vif,
				   u32 id);