|
|
deb259 |
From 98d3e208e4ec5731aa4a310adfc6d59685e6d6b2 Mon Sep 17 00:00:00 2001
|
|
|
deb259 |
From: Eugene Syromiatnikov <esyr@redhat.com>
|
|
|
deb259 |
Date: Thu, 25 Jul 2019 13:54:10 +0200
|
|
|
deb259 |
Subject: [PATCH 7/7] Revert "iwlwifi: mvm: support FTM responder"
|
|
|
deb259 |
|
|
|
deb259 |
This reverts commit b73f9a4ae77d448eb501f746d3bbe1b737f38681.
|
|
|
deb259 |
---
|
|
|
deb259 |
drivers/net/wireless/intel/iwlwifi/fw/file.h | 6 -
|
|
|
deb259 |
drivers/net/wireless/intel/iwlwifi/mvm/Makefile | 2 +-
|
|
|
deb259 |
.../net/wireless/intel/iwlwifi/mvm/ftm-responder.c | 244 ---------------------
|
|
|
deb259 |
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 92 +-------
|
|
|
deb259 |
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 9 -
|
|
|
deb259 |
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 -
|
|
|
deb259 |
6 files changed, 5 insertions(+), 350 deletions(-)
|
|
|
deb259 |
delete mode 100644 drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
|
|
|
deb259 |
|
|
|
deb259 |
Index: src/drivers/net/wireless/intel/iwlwifi/fw/file.h
|
|
|
deb259 |
===================================================================
|
|
|
deb259 |
--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/file.h 2019-07-25 13:55:50.467603040 +0200
|
|
|
deb259 |
+++ src/drivers/net/wireless/intel/iwlwifi/fw/file.h 2019-07-25 13:56:30.727060711 +0200
|
|
|
deb259 |
@@ -394,15 +394,12 @@
|
|
|
deb259 |
* capability.
|
|
|
deb259 |
* @IWL_UCODE_TLV_CAPA_CSI_REPORTING: firmware is capable of being configured
|
|
|
deb259 |
* to report the CSI information with (certain) RX frames
|
|
|
deb259 |
- * @IWL_UCODE_TLV_CAPA_FTM_CALIBRATED: has FTM calibrated and thus supports both
|
|
|
deb259 |
- * initiator and responder
|
|
|
deb259 |
*
|
|
|
deb259 |
* @IWL_UCODE_TLV_CAPA_MLME_OFFLOAD: supports MLME offload
|
|
|
deb259 |
*
|
|
|
deb259 |
* @NUM_IWL_UCODE_TLV_CAPA: number of bits used
|
|
|
deb259 |
*/
|
|
|
deb259 |
enum iwl_ucode_tlv_capa {
|
|
|
deb259 |
- /* set 0 */
|
|
|
deb259 |
IWL_UCODE_TLV_CAPA_D0I3_SUPPORT = (__force iwl_ucode_tlv_capa_t)0,
|
|
|
deb259 |
IWL_UCODE_TLV_CAPA_LAR_SUPPORT = (__force iwl_ucode_tlv_capa_t)1,
|
|
|
deb259 |
IWL_UCODE_TLV_CAPA_UMAC_SCAN = (__force iwl_ucode_tlv_capa_t)2,
|
|
|
deb259 |
@@ -424,8 +421,6 @@
|
|
|
deb259 |
IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC = (__force iwl_ucode_tlv_capa_t)29,
|
|
|
deb259 |
IWL_UCODE_TLV_CAPA_BT_COEX_RRC = (__force iwl_ucode_tlv_capa_t)30,
|
|
|
deb259 |
IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT = (__force iwl_ucode_tlv_capa_t)31,
|
|
|
deb259 |
-
|
|
|
deb259 |
- /* set 1 */
|
|
|
deb259 |
IWL_UCODE_TLV_CAPA_STA_PM_NOTIF = (__force iwl_ucode_tlv_capa_t)38,
|
|
|
deb259 |
IWL_UCODE_TLV_CAPA_BINDING_CDB_SUPPORT = (__force iwl_ucode_tlv_capa_t)39,
|
|
|
deb259 |
IWL_UCODE_TLV_CAPA_CDB_SUPPORT = (__force iwl_ucode_tlv_capa_t)40,
|
|
|
deb259 |
@@ -459,7 +454,6 @@
|
|
|
deb259 |
IWL_UCODE_TLV_CAPA_MCC_UPDATE_11AX_SUPPORT = (__force iwl_ucode_tlv_capa_t)89,
|
|
|
deb259 |
IWL_UCODE_TLV_CAPA_CSI_REPORTING = (__force iwl_ucode_tlv_capa_t)90,
|
|
|
deb259 |
|
|
|
deb259 |
- /* set 3 */
|
|
|
deb259 |
IWL_UCODE_TLV_CAPA_MLME_OFFLOAD = (__force iwl_ucode_tlv_capa_t)96,
|
|
|
deb259 |
|
|
|
deb259 |
NUM_IWL_UCODE_TLV_CAPA
|
|
|
deb259 |
Index: src/drivers/net/wireless/intel/iwlwifi/mvm/Makefile
|
|
|
deb259 |
===================================================================
|
|
|
deb259 |
--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/Makefile 2019-07-25 13:56:03.737424284 +0200
|
|
|
deb259 |
+++ src/drivers/net/wireless/intel/iwlwifi/mvm/Makefile 2019-07-25 13:56:30.728060698 +0200
|
|
|
deb259 |
@@ -4,7 +4,7 @@
|
|
|
deb259 |
iwlmvm-y += utils.o rx.o rxmq.o tx.o binding.o quota.o sta.o sf.o
|
|
|
deb259 |
iwlmvm-y += scan.o time-event.o rs.o rs-fw.o
|
|
|
deb259 |
iwlmvm-y += power.o coex.o
|
|
|
deb259 |
-iwlmvm-y += tt.o offloading.o tdls.o ftm-responder.o
|
|
|
deb259 |
+iwlmvm-y += tt.o offloading.o tdls.o
|
|
|
deb259 |
iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o
|
|
|
deb259 |
iwlmvm-$(CONFIG_IWLWIFI_LEDS) += led.o
|
|
|
deb259 |
iwlmvm-$(CONFIG_PM) += d3.o
|
|
|
deb259 |
Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
|
|
|
deb259 |
===================================================================
|
|
|
deb259 |
--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c 2019-06-27 14:54:04.133678337 +0200
|
|
|
deb259 |
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
|
|
|
deb259 |
@@ -1,244 +0,0 @@
|
|
|
deb259 |
-/******************************************************************************
|
|
|
deb259 |
- *
|
|
|
deb259 |
- * This file is provided under a dual BSD/GPLv2 license. When using or
|
|
|
deb259 |
- * redistributing this file, you may do so under either license.
|
|
|
deb259 |
- *
|
|
|
deb259 |
- * GPL LICENSE SUMMARY
|
|
|
deb259 |
- *
|
|
|
deb259 |
- * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
|
|
|
deb259 |
- * Copyright (C) 2018 Intel Corporation
|
|
|
deb259 |
- *
|
|
|
deb259 |
- * This program is free software; you can redistribute it and/or modify
|
|
|
deb259 |
- * it under the terms of version 2 of the GNU General Public License as
|
|
|
deb259 |
- * published by the Free Software Foundation.
|
|
|
deb259 |
- *
|
|
|
deb259 |
- * This program is distributed in the hope that it will be useful, but
|
|
|
deb259 |
- * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
deb259 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
deb259 |
- * General Public License for more details.
|
|
|
deb259 |
- *
|
|
|
deb259 |
- * The full GNU General Public License is included in this distribution
|
|
|
deb259 |
- * in the file called COPYING.
|
|
|
deb259 |
- *
|
|
|
deb259 |
- * Contact Information:
|
|
|
deb259 |
- * Intel Linux Wireless <linuxwifi@intel.com>
|
|
|
deb259 |
- * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
|
|
deb259 |
- *
|
|
|
deb259 |
- * BSD LICENSE
|
|
|
deb259 |
- *
|
|
|
deb259 |
- * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
|
|
|
deb259 |
- * Copyright (C) 2018 Intel Corporation
|
|
|
deb259 |
- * All rights reserved.
|
|
|
deb259 |
- *
|
|
|
deb259 |
- * Redistribution and use in source and binary forms, with or without
|
|
|
deb259 |
- * modification, are permitted provided that the following conditions
|
|
|
deb259 |
- * are met:
|
|
|
deb259 |
- *
|
|
|
deb259 |
- * * Redistributions of source code must retain the above copyright
|
|
|
deb259 |
- * notice, this list of conditions and the following disclaimer.
|
|
|
deb259 |
- * * Redistributions in binary form must reproduce the above copyright
|
|
|
deb259 |
- * notice, this list of conditions and the following disclaimer in
|
|
|
deb259 |
- * the documentation and/or other materials provided with the
|
|
|
deb259 |
- * distribution.
|
|
|
deb259 |
- * * Neither the name Intel Corporation nor the names of its
|
|
|
deb259 |
- * contributors may be used to endorse or promote products derived
|
|
|
deb259 |
- * from this software without specific prior written permission.
|
|
|
deb259 |
- *
|
|
|
deb259 |
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
deb259 |
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
deb259 |
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
deb259 |
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
deb259 |
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
deb259 |
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
deb259 |
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
deb259 |
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
deb259 |
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
deb259 |
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
deb259 |
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
deb259 |
- *
|
|
|
deb259 |
- *****************************************************************************/
|
|
|
deb259 |
-#include <net/cfg80211.h>
|
|
|
deb259 |
-#include <linux/etherdevice.h>
|
|
|
deb259 |
-#include "mvm.h"
|
|
|
deb259 |
-#include "constants.h"
|
|
|
deb259 |
-
|
|
|
deb259 |
-static int
|
|
|
deb259 |
-iwl_mvm_ftm_responder_cmd(struct iwl_mvm *mvm,
|
|
|
deb259 |
- struct ieee80211_vif *vif,
|
|
|
deb259 |
- struct cfg80211_chan_def *chandef)
|
|
|
deb259 |
-{
|
|
|
deb259 |
- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
deb259 |
- struct iwl_tof_responder_config_cmd cmd = {
|
|
|
deb259 |
- .channel_num = chandef->chan->hw_value,
|
|
|
deb259 |
- .cmd_valid_fields =
|
|
|
deb259 |
- cpu_to_le32(IWL_TOF_RESPONDER_CMD_VALID_CHAN_INFO |
|
|
|
deb259 |
- IWL_TOF_RESPONDER_CMD_VALID_BSSID |
|
|
|
deb259 |
- IWL_TOF_RESPONDER_CMD_VALID_STA_ID),
|
|
|
deb259 |
- .sta_id = mvmvif->bcast_sta.sta_id,
|
|
|
deb259 |
- };
|
|
|
deb259 |
-
|
|
|
deb259 |
- lockdep_assert_held(&mvm->mutex);
|
|
|
deb259 |
-
|
|
|
deb259 |
- switch (chandef->width) {
|
|
|
deb259 |
- case NL80211_CHAN_WIDTH_20_NOHT:
|
|
|
deb259 |
- cmd.bandwidth = IWL_TOF_BW_20_LEGACY;
|
|
|
deb259 |
- break;
|
|
|
deb259 |
- case NL80211_CHAN_WIDTH_20:
|
|
|
deb259 |
- cmd.bandwidth = IWL_TOF_BW_20_HT;
|
|
|
deb259 |
- break;
|
|
|
deb259 |
- case NL80211_CHAN_WIDTH_40:
|
|
|
deb259 |
- cmd.bandwidth = IWL_TOF_BW_40;
|
|
|
deb259 |
- cmd.ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
|
|
|
deb259 |
- break;
|
|
|
deb259 |
- case NL80211_CHAN_WIDTH_80:
|
|
|
deb259 |
- cmd.bandwidth = IWL_TOF_BW_80;
|
|
|
deb259 |
- cmd.ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
|
|
|
deb259 |
- break;
|
|
|
deb259 |
- default:
|
|
|
deb259 |
- WARN_ON(1);
|
|
|
deb259 |
- return -EINVAL;
|
|
|
deb259 |
- }
|
|
|
deb259 |
-
|
|
|
deb259 |
- memcpy(cmd.bssid, vif->addr, ETH_ALEN);
|
|
|
deb259 |
-
|
|
|
deb259 |
- return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_RESPONDER_CONFIG_CMD,
|
|
|
deb259 |
- LOCATION_GROUP, 0),
|
|
|
deb259 |
- 0, sizeof(cmd), &cmd);
|
|
|
deb259 |
-}
|
|
|
deb259 |
-
|
|
|
deb259 |
-static int
|
|
|
deb259 |
-iwl_mvm_ftm_responder_dyn_cfg_cmd(struct iwl_mvm *mvm,
|
|
|
deb259 |
- struct ieee80211_vif *vif,
|
|
|
deb259 |
- struct ieee80211_ftm_responder_params *params)
|
|
|
deb259 |
-{
|
|
|
deb259 |
- struct iwl_tof_responder_dyn_config_cmd cmd = {
|
|
|
deb259 |
- .lci_len = cpu_to_le32(params->lci_len + 2),
|
|
|
deb259 |
- .civic_len = cpu_to_le32(params->civicloc_len + 2),
|
|
|
deb259 |
- };
|
|
|
deb259 |
- u8 data[IWL_LCI_CIVIC_IE_MAX_SIZE] = {0};
|
|
|
deb259 |
- struct iwl_host_cmd hcmd = {
|
|
|
deb259 |
- .id = iwl_cmd_id(TOF_RESPONDER_DYN_CONFIG_CMD,
|
|
|
deb259 |
- LOCATION_GROUP, 0),
|
|
|
deb259 |
- .data[0] = &cmd,
|
|
|
deb259 |
- .len[0] = sizeof(cmd),
|
|
|
deb259 |
- .data[1] = &data,
|
|
|
deb259 |
- /* .len[1] set later */
|
|
|
deb259 |
- /* may not be able to DMA from stack */
|
|
|
deb259 |
- .dataflags[1] = IWL_HCMD_DFL_DUP,
|
|
|
deb259 |
- };
|
|
|
deb259 |
- u32 aligned_lci_len = ALIGN(params->lci_len + 2, 4);
|
|
|
deb259 |
- u32 aligned_civicloc_len = ALIGN(params->civicloc_len + 2, 4);
|
|
|
deb259 |
- u8 *pos = data;
|
|
|
deb259 |
-
|
|
|
deb259 |
- lockdep_assert_held(&mvm->mutex);
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (aligned_lci_len + aligned_civicloc_len > sizeof(data)) {
|
|
|
deb259 |
- IWL_ERR(mvm, "LCI/civicloc data too big (%zd + %zd)\n",
|
|
|
deb259 |
- params->lci_len, params->civicloc_len);
|
|
|
deb259 |
- return -ENOBUFS;
|
|
|
deb259 |
- }
|
|
|
deb259 |
-
|
|
|
deb259 |
- pos[0] = WLAN_EID_MEASURE_REPORT;
|
|
|
deb259 |
- pos[1] = params->lci_len;
|
|
|
deb259 |
- memcpy(pos + 2, params->lci, params->lci_len);
|
|
|
deb259 |
-
|
|
|
deb259 |
- pos += aligned_lci_len;
|
|
|
deb259 |
- pos[0] = WLAN_EID_MEASURE_REPORT;
|
|
|
deb259 |
- pos[1] = params->civicloc_len;
|
|
|
deb259 |
- memcpy(pos + 2, params->civicloc, params->civicloc_len);
|
|
|
deb259 |
-
|
|
|
deb259 |
- hcmd.len[1] = aligned_lci_len + aligned_civicloc_len;
|
|
|
deb259 |
-
|
|
|
deb259 |
- return iwl_mvm_send_cmd(mvm, &hcmd);
|
|
|
deb259 |
-}
|
|
|
deb259 |
-
|
|
|
deb259 |
-int iwl_mvm_ftm_start_responder(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
|
|
|
deb259 |
-{
|
|
|
deb259 |
- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
deb259 |
- struct ieee80211_ftm_responder_params *params;
|
|
|
deb259 |
- struct ieee80211_chanctx_conf ctx, *pctx;
|
|
|
deb259 |
- u16 *phy_ctxt_id;
|
|
|
deb259 |
- struct iwl_mvm_phy_ctxt *phy_ctxt;
|
|
|
deb259 |
- int ret;
|
|
|
deb259 |
-
|
|
|
deb259 |
- params = vif->bss_conf.ftmr_params;
|
|
|
deb259 |
-
|
|
|
deb259 |
- lockdep_assert_held(&mvm->mutex);
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (WARN_ON_ONCE(!vif->bss_conf.ftm_responder))
|
|
|
deb259 |
- return -EINVAL;
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (vif->p2p || vif->type != NL80211_IFTYPE_AP ||
|
|
|
deb259 |
- !mvmvif->ap_ibss_active) {
|
|
|
deb259 |
- IWL_ERR(mvm, "Cannot start responder, not in AP mode\n");
|
|
|
deb259 |
- return -EIO;
|
|
|
deb259 |
- }
|
|
|
deb259 |
-
|
|
|
deb259 |
- rcu_read_lock();
|
|
|
deb259 |
- pctx = rcu_dereference(vif->chanctx_conf);
|
|
|
deb259 |
- /* Copy the ctx to unlock the rcu and send the phy ctxt. We don't care
|
|
|
deb259 |
- * about changes in the ctx after releasing the lock because the driver
|
|
|
deb259 |
- * is still protected by the mutex. */
|
|
|
deb259 |
- ctx = *pctx;
|
|
|
deb259 |
- phy_ctxt_id = (u16 *)pctx->drv_priv;
|
|
|
deb259 |
- rcu_read_unlock();
|
|
|
deb259 |
-
|
|
|
deb259 |
- phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id];
|
|
|
deb259 |
- ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx.def,
|
|
|
deb259 |
- ctx.rx_chains_static,
|
|
|
deb259 |
- ctx.rx_chains_dynamic);
|
|
|
deb259 |
- if (ret)
|
|
|
deb259 |
- return ret;
|
|
|
deb259 |
-
|
|
|
deb259 |
- ret = iwl_mvm_ftm_responder_cmd(mvm, vif, &ctx.def);
|
|
|
deb259 |
- if (ret)
|
|
|
deb259 |
- return ret;
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (params)
|
|
|
deb259 |
- ret = iwl_mvm_ftm_responder_dyn_cfg_cmd(mvm, vif, params);
|
|
|
deb259 |
-
|
|
|
deb259 |
- return ret;
|
|
|
deb259 |
-}
|
|
|
deb259 |
-
|
|
|
deb259 |
-void iwl_mvm_ftm_restart_responder(struct iwl_mvm *mvm,
|
|
|
deb259 |
- struct ieee80211_vif *vif)
|
|
|
deb259 |
-{
|
|
|
deb259 |
- if (!vif->bss_conf.ftm_responder)
|
|
|
deb259 |
- return;
|
|
|
deb259 |
-
|
|
|
deb259 |
- iwl_mvm_ftm_start_responder(mvm, vif);
|
|
|
deb259 |
-}
|
|
|
deb259 |
-
|
|
|
deb259 |
-void iwl_mvm_ftm_responder_stats(struct iwl_mvm *mvm,
|
|
|
deb259 |
- struct iwl_rx_cmd_buffer *rxb)
|
|
|
deb259 |
-{
|
|
|
deb259 |
- struct iwl_rx_packet *pkt = rxb_addr(rxb);
|
|
|
deb259 |
- struct iwl_ftm_responder_stats *resp = (void *)pkt->data;
|
|
|
deb259 |
- struct cfg80211_ftm_responder_stats *stats = &mvm->ftm_resp_stats;
|
|
|
deb259 |
- u32 flags = le32_to_cpu(resp->flags);
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (resp->success_ftm == resp->ftm_per_burst)
|
|
|
deb259 |
- stats->success_num++;
|
|
|
deb259 |
- else if (resp->success_ftm >= 2)
|
|
|
deb259 |
- stats->partial_num++;
|
|
|
deb259 |
- else
|
|
|
deb259 |
- stats->failed_num++;
|
|
|
deb259 |
-
|
|
|
deb259 |
- if ((flags & FTM_RESP_STAT_ASAP_REQ) &&
|
|
|
deb259 |
- (flags & FTM_RESP_STAT_ASAP_RESP))
|
|
|
deb259 |
- stats->asap_num++;
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (flags & FTM_RESP_STAT_NON_ASAP_RESP)
|
|
|
deb259 |
- stats->non_asap_num++;
|
|
|
deb259 |
-
|
|
|
deb259 |
- stats->total_duration_ms += le32_to_cpu(resp->duration) / USEC_PER_MSEC;
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (flags & FTM_RESP_STAT_TRIGGER_UNKNOWN)
|
|
|
deb259 |
- stats->unknown_triggers_num++;
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (flags & FTM_RESP_STAT_DUP)
|
|
|
deb259 |
- stats->reschedule_requests_num++;
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (flags & FTM_RESP_STAT_NON_ASAP_OUT_WIN)
|
|
|
deb259 |
- stats->out_of_window_triggers_num++;
|
|
|
deb259 |
-}
|
|
|
deb259 |
Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
|
|
|
deb259 |
===================================================================
|
|
|
deb259 |
--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-25 13:56:03.738424271 +0200
|
|
|
deb259 |
+++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-25 13:56:30.729060684 +0200
|
|
|
deb259 |
@@ -549,11 +549,6 @@
|
|
|
deb259 |
hw->wiphy->n_cipher_suites++;
|
|
|
deb259 |
}
|
|
|
deb259 |
|
|
|
deb259 |
- if (fw_has_capa(&mvm->fw->ucode_capa,
|
|
|
deb259 |
- IWL_UCODE_TLV_CAPA_FTM_CALIBRATED))
|
|
|
deb259 |
- wiphy_ext_feature_set(hw->wiphy,
|
|
|
deb259 |
- NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER);
|
|
|
deb259 |
-
|
|
|
deb259 |
ieee80211_hw_set(hw, SINGLE_SCAN_ON_ALL_BANDS);
|
|
|
deb259 |
hw->wiphy->features |=
|
|
|
deb259 |
NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR |
|
|
|
deb259 |
@@ -1760,9 +1755,6 @@
|
|
|
deb259 |
IEEE80211_VIF_SUPPORTS_CQM_RSSI);
|
|
|
deb259 |
}
|
|
|
deb259 |
|
|
|
deb259 |
- if (vif->bss_conf.ftm_responder)
|
|
|
deb259 |
- memset(&mvm->ftm_resp_stats, 0, sizeof(mvm->ftm_resp_stats));
|
|
|
deb259 |
-
|
|
|
deb259 |
iwl_mvm_vif_dbgfs_clean(mvm, vif);
|
|
|
deb259 |
|
|
|
deb259 |
/*
|
|
|
deb259 |
@@ -2711,8 +2703,6 @@
|
|
|
deb259 |
if (iwl_mvm_phy_ctx_count(mvm) > 1)
|
|
|
deb259 |
iwl_mvm_teardown_tdls_peers(mvm);
|
|
|
deb259 |
|
|
|
deb259 |
- iwl_mvm_ftm_restart_responder(mvm, vif);
|
|
|
deb259 |
-
|
|
|
deb259 |
goto out_unlock;
|
|
|
deb259 |
|
|
|
deb259 |
out_quota_failed:
|
|
|
deb259 |
@@ -2821,15 +2811,6 @@
|
|
|
deb259 |
bss_conf->txpower);
|
|
|
deb259 |
iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower);
|
|
|
deb259 |
}
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (changes & BSS_CHANGED_FTM_RESPONDER) {
|
|
|
deb259 |
- int ret = iwl_mvm_ftm_start_responder(mvm, vif);
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (ret)
|
|
|
deb259 |
- IWL_WARN(mvm, "Failed to enable FTM responder (%d)\n",
|
|
|
deb259 |
- ret);
|
|
|
deb259 |
- }
|
|
|
deb259 |
-
|
|
|
deb259 |
}
|
|
|
deb259 |
|
|
|
deb259 |
static void iwl_mvm_bss_info_changed(struct ieee80211_hw *hw,
|
|
|
deb259 |
@@ -3950,43 +3931,11 @@
|
|
|
deb259 |
return 0;
|
|
|
deb259 |
}
|
|
|
deb259 |
|
|
|
deb259 |
-struct iwl_mvm_ftm_responder_iter_data {
|
|
|
deb259 |
- bool responder;
|
|
|
deb259 |
- struct ieee80211_chanctx_conf *ctx;
|
|
|
deb259 |
-};
|
|
|
deb259 |
-
|
|
|
deb259 |
-static void iwl_mvm_ftm_responder_chanctx_iter(void *_data, u8 *mac,
|
|
|
deb259 |
- struct ieee80211_vif *vif)
|
|
|
deb259 |
-{
|
|
|
deb259 |
- struct iwl_mvm_ftm_responder_iter_data *data = _data;
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (rcu_access_pointer(vif->chanctx_conf) == data->ctx &&
|
|
|
deb259 |
- vif->type == NL80211_IFTYPE_AP && vif->bss_conf.ftmr_params)
|
|
|
deb259 |
- data->responder = true;
|
|
|
deb259 |
-}
|
|
|
deb259 |
-
|
|
|
deb259 |
-static bool iwl_mvm_is_ftm_responder_chanctx(struct iwl_mvm *mvm,
|
|
|
deb259 |
- struct ieee80211_chanctx_conf *ctx)
|
|
|
deb259 |
-{
|
|
|
deb259 |
- struct iwl_mvm_ftm_responder_iter_data data = {
|
|
|
deb259 |
- .responder = false,
|
|
|
deb259 |
- .ctx = ctx,
|
|
|
deb259 |
- };
|
|
|
deb259 |
-
|
|
|
deb259 |
- ieee80211_iterate_active_interfaces_atomic(mvm->hw,
|
|
|
deb259 |
- IEEE80211_IFACE_ITER_NORMAL,
|
|
|
deb259 |
- iwl_mvm_ftm_responder_chanctx_iter,
|
|
|
deb259 |
- &data);
|
|
|
deb259 |
- return data.responder;
|
|
|
deb259 |
-}
|
|
|
deb259 |
-
|
|
|
deb259 |
static int __iwl_mvm_add_chanctx(struct iwl_mvm *mvm,
|
|
|
deb259 |
struct ieee80211_chanctx_conf *ctx)
|
|
|
deb259 |
{
|
|
|
deb259 |
u16 *phy_ctxt_id = (u16 *)ctx->drv_priv;
|
|
|
deb259 |
struct iwl_mvm_phy_ctxt *phy_ctxt;
|
|
|
deb259 |
- bool responder = iwl_mvm_is_ftm_responder_chanctx(mvm, ctx);
|
|
|
deb259 |
- struct cfg80211_chan_def *def = responder ? &ctx->def : &ctx->min_def;
|
|
|
deb259 |
int ret;
|
|
|
deb259 |
|
|
|
deb259 |
lockdep_assert_held(&mvm->mutex);
|
|
|
deb259 |
@@ -3999,7 +3948,7 @@
|
|
|
deb259 |
goto out;
|
|
|
deb259 |
}
|
|
|
deb259 |
|
|
|
deb259 |
- ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, def,
|
|
|
deb259 |
+ ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx->min_def,
|
|
|
deb259 |
ctx->rx_chains_static,
|
|
|
deb259 |
ctx->rx_chains_dynamic);
|
|
|
deb259 |
if (ret) {
|
|
|
deb259 |
@@ -4054,8 +4003,6 @@
|
|
|
deb259 |
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
deb259 |
u16 *phy_ctxt_id = (u16 *)ctx->drv_priv;
|
|
|
deb259 |
struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id];
|
|
|
deb259 |
- bool responder = iwl_mvm_is_ftm_responder_chanctx(mvm, ctx);
|
|
|
deb259 |
- struct cfg80211_chan_def *def = responder ? &ctx->def : &ctx->min_def;
|
|
|
deb259 |
|
|
|
deb259 |
if (WARN_ONCE((phy_ctxt->ref > 1) &&
|
|
|
deb259 |
(changed & ~(IEEE80211_CHANCTX_CHANGE_WIDTH |
|
|
|
deb259 |
@@ -4070,17 +4017,17 @@
|
|
|
deb259 |
|
|
|
deb259 |
/* we are only changing the min_width, may be a noop */
|
|
|
deb259 |
if (changed == IEEE80211_CHANCTX_CHANGE_MIN_WIDTH) {
|
|
|
deb259 |
- if (phy_ctxt->width == def->width)
|
|
|
deb259 |
+ if (phy_ctxt->width == ctx->min_def.width)
|
|
|
deb259 |
goto out_unlock;
|
|
|
deb259 |
|
|
|
deb259 |
/* we are just toggling between 20_NOHT and 20 */
|
|
|
deb259 |
if (phy_ctxt->width <= NL80211_CHAN_WIDTH_20 &&
|
|
|
deb259 |
- def->width <= NL80211_CHAN_WIDTH_20)
|
|
|
deb259 |
+ ctx->min_def.width <= NL80211_CHAN_WIDTH_20)
|
|
|
deb259 |
goto out_unlock;
|
|
|
deb259 |
}
|
|
|
deb259 |
|
|
|
deb259 |
iwl_mvm_bt_coex_vif_change(mvm);
|
|
|
deb259 |
- iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, def,
|
|
|
deb259 |
+ iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx->min_def,
|
|
|
deb259 |
ctx->rx_chains_static,
|
|
|
deb259 |
ctx->rx_chains_dynamic);
|
|
|
deb259 |
|
|
|
deb259 |
@@ -5010,35 +4957,6 @@
|
|
|
deb259 |
mutex_unlock(&mvm->mutex);
|
|
|
deb259 |
}
|
|
|
deb259 |
|
|
|
deb259 |
-static int
|
|
|
deb259 |
-iwl_mvm_mac_get_ftm_responder_stats(struct ieee80211_hw *hw,
|
|
|
deb259 |
- struct ieee80211_vif *vif,
|
|
|
deb259 |
- struct cfg80211_ftm_responder_stats *stats)
|
|
|
deb259 |
-{
|
|
|
deb259 |
- struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
|
|
deb259 |
- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
deb259 |
-
|
|
|
deb259 |
- if (vif->p2p || vif->type != NL80211_IFTYPE_AP ||
|
|
|
deb259 |
- !mvmvif->ap_ibss_active || !vif->bss_conf.ftm_responder)
|
|
|
deb259 |
- return -EINVAL;
|
|
|
deb259 |
-
|
|
|
deb259 |
- mutex_lock(&mvm->mutex);
|
|
|
deb259 |
- *stats = mvm->ftm_resp_stats;
|
|
|
deb259 |
- mutex_unlock(&mvm->mutex);
|
|
|
deb259 |
-
|
|
|
deb259 |
- stats->filled = BIT(NL80211_FTM_STATS_SUCCESS_NUM) |
|
|
|
deb259 |
- BIT(NL80211_FTM_STATS_PARTIAL_NUM) |
|
|
|
deb259 |
- BIT(NL80211_FTM_STATS_FAILED_NUM) |
|
|
|
deb259 |
- BIT(NL80211_FTM_STATS_ASAP_NUM) |
|
|
|
deb259 |
- BIT(NL80211_FTM_STATS_NON_ASAP_NUM) |
|
|
|
deb259 |
- BIT(NL80211_FTM_STATS_TOTAL_DURATION_MSEC) |
|
|
|
deb259 |
- BIT(NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM) |
|
|
|
deb259 |
- BIT(NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM) |
|
|
|
deb259 |
- BIT(NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM);
|
|
|
deb259 |
-
|
|
|
deb259 |
- return 0;
|
|
|
deb259 |
-}
|
|
|
deb259 |
-
|
|
|
deb259 |
static bool iwl_mvm_can_hw_csum(struct sk_buff *skb)
|
|
|
deb259 |
{
|
|
|
deb259 |
u8 protocol = ip_hdr(skb)->protocol;
|
|
|
deb259 |
@@ -5143,8 +5061,6 @@
|
|
|
deb259 |
#endif
|
|
|
deb259 |
.get_survey = iwl_mvm_mac_get_survey,
|
|
|
deb259 |
.sta_statistics = iwl_mvm_mac_sta_statistics,
|
|
|
deb259 |
- .get_ftm_responder_stats = iwl_mvm_mac_get_ftm_responder_stats,
|
|
|
deb259 |
-
|
|
|
deb259 |
.can_aggregate_in_amsdu = iwl_mvm_mac_can_aggregate,
|
|
|
deb259 |
#ifdef CONFIG_IWLWIFI_DEBUGFS
|
|
|
deb259 |
.sta_add_debugfs = iwl_mvm_sta_add_debugfs,
|
|
|
deb259 |
Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
|
|
|
deb259 |
===================================================================
|
|
|
deb259 |
--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-07-25 13:56:03.739424257 +0200
|
|
|
deb259 |
+++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-07-25 13:56:30.730060671 +0200
|
|
|
deb259 |
@@ -1153,8 +1153,6 @@
|
|
|
deb259 |
u32 ciphers[IWL_MVM_NUM_CIPHERS];
|
|
|
deb259 |
struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS];
|
|
|
deb259 |
|
|
|
deb259 |
- struct cfg80211_ftm_responder_stats ftm_resp_stats;
|
|
|
deb259 |
-
|
|
|
deb259 |
struct ieee80211_vif *nan_vif;
|
|
|
deb259 |
#define IWL_MAX_BAID 32
|
|
|
deb259 |
struct iwl_mvm_baid_data __rcu *baid_map[IWL_MAX_BAID];
|
|
|
deb259 |
@@ -2064,13 +2062,6 @@
|
|
|
deb259 |
int iwl_mvm_sf_update(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
|
|
deb259 |
bool added_vif);
|
|
|
deb259 |
|
|
|
deb259 |
-/* FTM responder */
|
|
|
deb259 |
-int iwl_mvm_ftm_start_responder(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
|
|
|
deb259 |
-void iwl_mvm_ftm_restart_responder(struct iwl_mvm *mvm,
|
|
|
deb259 |
- struct ieee80211_vif *vif);
|
|
|
deb259 |
-void iwl_mvm_ftm_responder_stats(struct iwl_mvm *mvm,
|
|
|
deb259 |
- struct iwl_rx_cmd_buffer *rxb);
|
|
|
deb259 |
-
|
|
|
deb259 |
/* TDLS */
|
|
|
deb259 |
|
|
|
deb259 |
/*
|
|
|
deb259 |
Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
|
|
|
deb259 |
===================================================================
|
|
|
deb259 |
--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-07-25 13:56:03.739424257 +0200
|
|
|
deb259 |
+++ src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-07-25 13:56:30.731060658 +0200
|
|
|
deb259 |
@@ -300,8 +300,6 @@
|
|
|
deb259 |
RX_HANDLER_ASYNC_LOCKED),
|
|
|
deb259 |
RX_HANDLER(MFUART_LOAD_NOTIFICATION, iwl_mvm_rx_mfuart_notif,
|
|
|
deb259 |
RX_HANDLER_SYNC),
|
|
|
deb259 |
- RX_HANDLER_GRP(LOCATION_GROUP, TOF_RESPONDER_STATS,
|
|
|
deb259 |
- iwl_mvm_ftm_responder_stats, RX_HANDLER_ASYNC_LOCKED),
|
|
|
deb259 |
RX_HANDLER_GRP(DEBUG_GROUP, MFU_ASSERT_DUMP_NTF,
|
|
|
deb259 |
iwl_mvm_mfu_assert_dump_notif, RX_HANDLER_SYNC),
|
|
|
deb259 |
RX_HANDLER_GRP(PROT_OFFLOAD_GROUP, STORED_BEACON_NTF,
|