diff options
Diffstat (limited to 'sys/contrib/dev/iwlwifi/mvm/ftm-responder.c')
| -rw-r--r-- | sys/contrib/dev/iwlwifi/mvm/ftm-responder.c | 90 | 
1 files changed, 1 insertions, 89 deletions
| diff --git a/sys/contrib/dev/iwlwifi/mvm/ftm-responder.c b/sys/contrib/dev/iwlwifi/mvm/ftm-responder.c index 3e989f3141b5..83f6e508a094 100644 --- a/sys/contrib/dev/iwlwifi/mvm/ftm-responder.c +++ b/sys/contrib/dev/iwlwifi/mvm/ftm-responder.c @@ -131,7 +131,7 @@ iwl_mvm_ftm_responder_cmd(struct iwl_mvm *mvm,  	lockdep_assert_held(&mvm->mutex); -	if (cmd_ver == 10) { +	if (cmd_ver >= 10) {  		cmd.band =  			iwl_mvm_phy_band_from_nl80211(chandef->chan->band);  	} @@ -324,94 +324,6 @@ static void iwl_mvm_resp_del_pasn_sta(struct iwl_mvm *mvm,  	kfree(sta);  } -#if defined(__linux__) -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; -} -#endif -  int iwl_mvm_ftm_start_responder(struct iwl_mvm *mvm, struct ieee80211_vif *vif,  				struct ieee80211_bss_conf *bss_conf)  { | 
