All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH v5 2/4] rrm: include actual scan start time in report
Date: Thu, 21 Nov 2019 12:08:59 -0800	[thread overview]
Message-ID: <20191121200901.25826-2-prestwoj@gmail.com> (raw)
In-Reply-To: <20191121200901.25826-1-prestwoj@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]

---
 src/rrm.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/rrm.c b/src/rrm.c
index 2b0a22fb..ca30a7f7 100644
--- a/src/rrm.c
+++ b/src/rrm.c
@@ -109,6 +109,7 @@ struct rrm_beacon_req_info {
 	char ssid[33];		/* Request filtered by SSID */
 	bool has_ssid;
 	uint32_t scan_id;
+	uint64_t scan_start_time;
 };
 
 /* Per-netdev state */
@@ -249,8 +250,7 @@ static size_t build_report_for_bss(struct rrm_beacon_req_info *beacon,
 
 	*to++ = beacon->oper_class;
 	*to++ = scan_freq_to_channel(bss->frequency, NULL);
-	/* skip start time */
-	memset(to, 0, 8);
+	l_put_le64(beacon->scan_start_time, to);
 	to += 8;
 	l_put_le16(beacon->duration, to);
 	to += 2;
@@ -390,11 +390,18 @@ static bool rrm_scan_results(int err, struct l_queue *bss_list, void *userdata)
 static void rrm_scan_triggered(int err, void *userdata)
 {
 	struct rrm_state *rrm = userdata;
+	struct rrm_beacon_req_info *beacon = l_container_of(rrm->pending,
+						struct rrm_beacon_req_info,
+						info);
 
 	if (err < 0) {
 		l_error("Could not start RRM scan");
 		rrm_reject_measurement_request(rrm, REPORT_REJECT_INCAPABLE);
+		return;
 	}
+
+	beacon->scan_start_time = scan_get_triggered_time(rrm->wdev_id,
+							beacon->scan_id);
 }
 
 static void rrm_handle_beacon_scan(struct rrm_state *rrm,
-- 
2.17.1

  parent reply	other threads:[~2019-11-21 20:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 20:08 [PATCH v5 1/4] scan: parse the scan start time James Prestwood
2019-11-21 19:59 ` Denis Kenzior
2019-11-21 20:08 ` James Prestwood [this message]
2019-11-21 20:09 ` [PATCH v5 3/4] rrm: fix non-ascii character in comment James Prestwood
2019-11-21 20:09 ` [PATCH v5 4/4] rrm: add packed struct for beacon reports James Prestwood

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=20191121200901.25826-2-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.