[RFC PATCH 05/23] PR: Use a dedicated flag for EDCA-based ranging responder support

Peddolla Harshavardhan Reddy peddolla.reddy at oss.qualcomm.com
Tue Mar 31 22:26:55 PDT 2026


Currently, wpas_pr_init uses WPA_DRIVER_FLAGS_FTM_RESPONDER to
determine EDCA-based ranging responder support. This flag is a
generic FTM responder capability that predates the Proximity
Detection feature and may be set for reasons unrelated to PR,
making it an unreliable indicator for PR EDCA RSTA support.

Add a new driver flag WPA_DRIVER_FLAGS2_PR_EDCA_RSTA_SUPPORT
in flags2, placed after WPA_DRIVER_FLAGS2_PR_CONCURRENT_ISTA_RSTA
to keep all PR-specific flags grouped together. Parse the flag
from NL80211_PMSR_FTM_CAPA_ATTR_EDCA_BASED_RESPONDER in
pmsr_type_ftm_handler and use it in wpas_pr_init to set
pr.edca_rsta_support instead of the generic FTM responder flag.

Fixes: f45cc220e4bb ("PR: Update PR device configs and capabilities from driver")
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy at oss.qualcomm.com>
---
 src/drivers/driver.h              | 2 ++
 src/drivers/driver_nl80211_capa.c | 4 ++++
 wpa_supplicant/pr_supplicant.c    | 4 ++--
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 5f05550be..2aa61c893 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -2450,6 +2450,8 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS2_PR_SUPPORT		0x000000200000000ULL
 /** Driver supports concurrent ISTA and RSTA roles for PR */
 #define WPA_DRIVER_FLAGS2_PR_CONCURRENT_ISTA_RSTA	0x0000004000000000ULL
+/** Driver supports EDCA-based ranging as RSTA role for PR */
+#define WPA_DRIVER_FLAGS2_PR_EDCA_RSTA_SUPPORT		0x0000008000000000ULL
 
 	u64 flags2;
 
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index c9308812d..52dceb802 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1017,6 +1017,10 @@ static void pmsr_type_ftm_handler(struct wpa_driver_nl80211_data *drv,
 	    tb[NL80211_PMSR_FTM_CAPA_ATTR_RSTA_SUPPORT_NTB])
 		drv->capa.flags2 |= WPA_DRIVER_FLAGS2_NON_TRIGGER_BASED_RESPONDER;
 
+	if (tb[NL80211_PMSR_FTM_CAPA_ATTR_RSTA_SUPPORT] &&
+	    tb[NL80211_PMSR_FTM_CAPA_ATTR_RSTA_SUPPORT_EDCA])
+		drv->capa.flags2 |= WPA_DRIVER_FLAGS2_PR_EDCA_RSTA_SUPPORT;
+
 	if (tb[NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_TX_ANTENNAS])
 		drv->capa.max_tx_antenna =
 			nla_get_u8(tb[NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_TX_ANTENNAS]);
diff --git a/wpa_supplicant/pr_supplicant.c b/wpa_supplicant/pr_supplicant.c
index a218d78cf..98e67ef09 100644
--- a/wpa_supplicant/pr_supplicant.c
+++ b/wpa_supplicant/pr_supplicant.c
@@ -349,8 +349,8 @@ int wpas_pr_init(struct wpa_global *global, struct wpa_supplicant *wpa_s,
 
 	pr.edca_ista_support = wpa_s->drv_flags2 &
 		WPA_DRIVER_FLAGS2_FTM_INITIATOR;
-	pr.edca_rsta_support = wpa_s->drv_flags &
-		WPA_DRIVER_FLAGS_FTM_RESPONDER;
+	pr.edca_rsta_support = !!(wpa_s->drv_flags2 &
+		WPA_DRIVER_FLAGS2_PR_EDCA_RSTA_SUPPORT);
 	pr.edca_format_and_bw = capa->edca_format_and_bw;
 	pr.max_rx_antenna = capa->max_rx_antenna;
 	pr.max_tx_antenna = capa->max_tx_antenna;
-- 
2.34.1




More information about the Hostap mailing list