[PATCH] PR: Report ranging frequency in peer measurement results
Emily Xia
xiayucheng at google.com
Wed Nov 25 03:04:01 PST 2026
The nl80211 PMSR FTM response does not carry the channel frequency, so
the upper layers have no way of knowing on which channel a reported
measurement was performed.
Add ranging_freq to struct peer_measurement_ftm_result and fill it in
wpas_pr_measurement_result() from the ranging request parameters before
the result is notified. To make this possible, store the negotiated
ranging frequency in pr_pasn_params->freq when ranging is triggered
after PASN.
Signed-off-by: Emily Xia <xiayucheng at google.com>
---
src/drivers/driver.h | 1 +
wpa_supplicant/pr_supplicant.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index f359452c7..214b8ccc8 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -7898,6 +7898,7 @@ union wpa_event_data {
u8 availability_window;
u32 band_width;
u32 preamble;
+ u32 ranging_freq;
bool is_delayed_lmr;
/* Flag indicating if FTM data is present */
bool has_data;
diff --git a/wpa_supplicant/pr_supplicant.c b/wpa_supplicant/pr_supplicant.c
index eb946a414..391e4ef33 100644
--- a/wpa_supplicant/pr_supplicant.c
+++ b/wpa_supplicant/pr_supplicant.c
@@ -513,6 +513,7 @@ static int wpas_pr_trigger_ranging(struct wpa_supplicant *wpa_s,
/* Populate ranging params */
params->ranging_op_class = op_class;
+ params->freq = freq;
params->channel_width = channel_width;
params->format_bw = format_bw;
params->center_freq1 = center_freq1;
@@ -1028,6 +1029,11 @@ void wpas_pr_measurement_result(struct wpa_supplicant *wpa_s,
return;
}
+ /* The driver does not report the ranging frequency; use the negotiated
+ * one from the ranging request. */
+ if (pr && pr->pr_pasn_params && pr->pr_pasn_params->freq > 0)
+ result->ftm.ranging_freq = pr->pr_pasn_params->freq;
+
/* Forward result to upper layer - includes failures and final */
if (result->ftm.has_data || result->ftm.fail)
wpas_notify_pr_measurement_result(wpa_s, result);
--
2.56.1.831.g720f3f5937-goog
More information about the Hostap
mailing list