From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
Avraham Stern <avraham.stern@intel.com>,
Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 05/16] iwlwifi: mvm: report FTM start time TSF when applicable
Date: Tue, 23 Apr 2019 12:10:32 +0300 [thread overview]
Message-ID: <20190423091043.7156-6-luca@coelho.fi> (raw)
In-Reply-To: <20190423091043.7156-1-luca@coelho.fi>
From: Avraham Stern <avraham.stern@intel.com>
When the interface that is requesting an FTM measurement is connected
to a BSS, it is possible that the FTM request was originated by an
RRM request from the AP. In this case the station needs to report
the measurement start time in terms of the TSF of the AP.
Since there is no indication in the FTM request itself if the TSF
is needed, always report the TSF if the station is associated.
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
.../intel/iwlwifi/mvm/ftm-initiator.c | 20 ++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
index b15a4db7198e..fec38a47696e 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
@@ -187,12 +187,24 @@ static void iwl_mvm_ftm_cmd(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
for (i = 0; i < ETH_ALEN; i++)
cmd->macaddr_mask[i] = ~req->mac_addr_mask[i];
- if (vif->bss_conf.assoc)
+ if (vif->bss_conf.assoc) {
memcpy(cmd->range_req_bssid, vif->bss_conf.bssid, ETH_ALEN);
- else
+
+ /* AP's TSF is only relevant if associated */
+ for (i = 0; i < req->n_peers; i++) {
+ if (req->peers[i].report_ap_tsf) {
+ struct iwl_mvm_vif *mvmvif =
+ iwl_mvm_vif_from_mac80211(vif);
+
+ cmd->tsf_mac_id = cpu_to_le32(mvmvif->id);
+ return;
+ }
+ }
+ } else {
eth_broadcast_addr(cmd->range_req_bssid);
+ }
- /* TODO: fill in tsf_mac_id if needed */
+ /* Don't report AP's TSF */
cmd->tsf_mac_id = cpu_to_le32(0xff);
}
@@ -527,6 +539,8 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
fw_ap = (void *)&fw_resp_v6->ap[i];
result.final = fw_resp->ap[i].last_burst;
+ result.ap_tsf = le32_to_cpu(fw_ap->start_tsf);
+ result.ap_tsf_valid = 1;
} else {
/* the first part is the same for old and new APIs */
fw_ap = (void *)&fw_resp_v5->ap[i];
--
2.20.1
next prev parent reply other threads:[~2019-04-23 9:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-23 9:10 [PATCH 00/16] iwlwifi: updates intended for v5.2 2019-04-23 (new try) Luca Coelho
2019-04-23 9:10 ` [PATCH 01/16] iwlwifi: Use correct channel_profile iniwl_get_nvm Luca Coelho
2019-04-23 9:10 ` [PATCH 02/16] iwlwifi: pcie: initialize debug_rfkill to -1 Luca Coelho
2019-04-23 9:10 ` [PATCH 03/16] iwlwifi: pcie: don't crash on invalid RX interrupt Luca Coelho
2019-04-23 9:10 ` [PATCH 04/16] iwlwifi: mvm: support v2 of the WoWLAN patterns command Luca Coelho
2019-04-23 9:10 ` Luca Coelho [this message]
2019-04-23 9:10 ` [PATCH 06/16] iwlwifi: support fseq tlv and print fseq version Luca Coelho
2019-04-23 9:10 ` [PATCH 07/16] iwlwifi: mvm: limit TLC according to our HE capabilities Luca Coelho
2019-04-23 9:10 ` [PATCH 08/16] iwlwifi: bump FW API to 48 for 22000 series Luca Coelho
2019-04-23 9:10 ` [PATCH 09/16] iwlwifi: mvm: Don't sleep in RX path Luca Coelho
2019-04-23 9:10 ` [PATCH 10/16] iwlwifi: pcie: remove stray character in iwl_pcie_rx_alloc_page() Luca Coelho
2019-04-23 9:10 ` [PATCH 11/16] iwlwifi: parse command version TLV Luca Coelho
2019-04-23 9:10 ` [PATCH 12/16] iwlwifi: dbg_ini: add lmac and umac error tables dumping support Luca Coelho
2019-04-23 9:10 ` [PATCH 13/16] iwlwifi: dbg_ini: add periodic trigger support Luca Coelho
2019-04-23 9:10 ` [PATCH 14/16] iwlwifi: dbg: replace dump info device family with HW type Luca Coelho
2019-04-23 9:10 ` [PATCH 15/16] iwlwifi: avoid allocating memory for region with disabled domain Luca Coelho
2019-04-23 9:10 ` [PATCH 16/16] iwlwifi: dbg_ini: check for valid region type during regions parsing Luca Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190423091043.7156-6-luca@coelho.fi \
--to=luca@coelho.fi \
--cc=avraham.stern@intel.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luciano.coelho@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox