linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 11/20 v2] iwlwifi: mvm: add debug prints for FTM
Date: Tue, 12 Feb 2019 09:56:20 +0200	[thread overview]
Message-ID: <20190212075620.12055-1-luca@coelho.fi> (raw)
In-Reply-To: <20190208104712.16210-12-luca@coelho.fi>

From: Avraham Stern <avraham.stern@intel.com>

Add debug prints for FTM results info. These prints are used by
tests automation.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---

In v2:

   * Use do_div() to avoid problem in 32-bit compilations with gcc
     (reported by kbuildbot).


.../intel/iwlwifi/mvm/ftm-initiator.c         | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
index c1d9703ab40c..4b905913b942 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
@@ -457,6 +457,31 @@ static int iwl_mvm_ftm_range_resp_valid(struct iwl_mvm *mvm, u8 request_id,
 	return 0;
 }
 
+static void iwl_mvm_debug_range_resp(struct iwl_mvm *mvm, u8 index,
+				     struct cfg80211_pmsr_result *res)
+{
+	/*
+	 * Use do_div() for this calculation to avoid problems with
+	 * gcc on 32-bit platforms.
+	 */
+	s64 rtt_avg = res->ftm.rtt_avg * 100;
+
+	do_div(rtt_avg, 6666);
+
+	IWL_DEBUG_INFO(mvm, "entry %d\n", index);
+	IWL_DEBUG_INFO(mvm, "\tstatus: %d\n", res->status);
+	IWL_DEBUG_INFO(mvm, "\tBSSID: %pM\n", res->addr);
+	IWL_DEBUG_INFO(mvm, "\thost time: %llu\n", res->host_time);
+	IWL_DEBUG_INFO(mvm, "\tburst index: %hhu\n", res->ftm.burst_index);
+	IWL_DEBUG_INFO(mvm, "\tsuccess num: %u\n", res->ftm.num_ftmr_successes);
+	IWL_DEBUG_INFO(mvm, "\trssi: %d\n", res->ftm.rssi_avg);
+	IWL_DEBUG_INFO(mvm, "\trssi spread: %hhu\n", res->ftm.rssi_spread);
+	IWL_DEBUG_INFO(mvm, "\trtt: %lld\n", res->ftm.rtt_avg);
+	IWL_DEBUG_INFO(mvm, "\trtt var: %llu\n", res->ftm.rtt_variance);
+	IWL_DEBUG_INFO(mvm, "\trtt spread: %llu\n", res->ftm.rtt_spread);
+	IWL_DEBUG_INFO(mvm, "\tdistance: %lld\n", rtt_avg);
+}
+
 void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
 {
 	struct iwl_rx_packet *pkt = rxb_addr(rxb);
@@ -490,6 +515,10 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
 		last_in_batch = fw_resp_v5->last_in_batch;
 	}
 
+	IWL_DEBUG_INFO(mvm, "Range response received\n");
+	IWL_DEBUG_INFO(mvm, "request id: %lld, num of entries: %hhu\n",
+		       mvm->ftm_initiator.req->cookie, num_of_aps);
+
 	for (i = 0; i < num_of_aps && i < IWL_MVM_TOF_MAX_APS; i++) {
 		struct cfg80211_pmsr_result result = {};
 		struct iwl_tof_range_rsp_ap_entry_ntfy *fw_ap;
@@ -564,6 +593,8 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
 		cfg80211_pmsr_report(mvm->ftm_initiator.req_wdev,
 				     mvm->ftm_initiator.req,
 				     &result, GFP_KERNEL);
+
+		iwl_mvm_debug_range_resp(mvm, i, &result);
 	}
 
 	if (last_in_batch) {
-- 
2.20.1


  reply	other threads:[~2019-02-12  7:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08 10:46 [PATCH 00/20] iwlwifi: updates intended for v5.1 2019-02-08 Luca Coelho
2019-02-08 10:46 ` [PATCH 01/20] iwlwifi: bump FW API to 46 for 9000 and 22000 series Luca Coelho
2019-02-08 10:46 ` [PATCH 02/20] iwlwifi: pcie: fix TX while flushing Luca Coelho
2019-02-08 10:46 ` [PATCH 03/20] iwlwifi: mvm: add support for 32kHz external clock indication Luca Coelho
2019-02-08 10:46 ` [PATCH 04/20] iwlwifi: dbg: temporarily skip periphery dump for AX210 devices Luca Coelho
2019-02-08 10:46 ` [PATCH 05/20] iwlwifi: align to new periphery address space for AX210 family Luca Coelho
2019-02-08 10:46 ` [PATCH 06/20] iwlwifi: add force NMI for AX210 devices Luca Coelho
2019-02-08 10:46 ` [PATCH 07/20] iwlwifi: mvm: add a debug_enable op Luca Coelho
2019-02-08 10:47 ` [PATCH 08/20] iwiwifi: mvm: Fix FW scan concurrency support assumptions Luca Coelho
2019-02-08 10:47 ` [PATCH 09/20] iwlwifi: mvm: add support for new FTM fw API Luca Coelho
2019-02-08 10:47 ` [PATCH 10/20] iwlwifi: mvm: fix HE radiotap data4 for HE-TB PPDUs Luca Coelho
2019-02-08 10:47 ` [PATCH 11/20] iwlwifi: mvm: add debug prints for FTM Luca Coelho
2019-02-12  7:56   ` Luca Coelho [this message]
2019-02-13  6:55     ` [PATCH 11/20 v3] " Luca Coelho
2019-02-08 10:47 ` [PATCH 12/20] iwlwifi: start using B-step for some 9000 devices Luca Coelho
2019-02-08 10:47 ` [PATCH 13/20] iwlwifi: properly use delay option in dump trigger flow Luca Coelho
2019-02-08 10:47 ` [PATCH 14/20] iwlwifi: dbg_ini: enable ignore consecutive trigger feature Luca Coelho
2019-02-08 10:47 ` [PATCH 15/20] iwlwifi: mvm: fix the spatial reuse parsing for HE_TRIG PPDUs Luca Coelho
2019-02-08 10:47 ` [PATCH 16/20] iwlwifi: dbg: buffer overflow in non_collect_ts_start array Luca Coelho
2019-02-08 10:47 ` [PATCH 17/20] iwlwifi: mvm: Don't warn on command failure during restart Luca Coelho
2019-02-08 10:47 ` [PATCH 18/20] iwlwifi: mvm: Do not return an error value on HW restart Luca Coelho
2019-02-08 10:47 ` [PATCH 19/20] iwlwifi: dbg_ini: add early and after alive apply points to unified images Luca Coelho
2019-02-08 10:47 ` [PATCH 20/20] iwlwifi: mvm: stop static queues correctly 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=20190212075620.12055-1-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;
as well as URLs for NNTP newsgroup(s).