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

Peddolla Harshavardhan Reddy peddolla.reddy at oss.qualcomm.com
Thu Apr 2 05:24:10 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 | 12 ++++++++----
 wpa_supplicant/pr_supplicant.c    |  4 ++--
 3 files changed, 12 insertions(+), 6 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 a56301d14..d9188f85f 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1029,10 +1029,14 @@ static void pmsr_type_ftm_handler(struct wpa_driver_nl80211_data *drv,
 
 		if (!nla_parse_nested(rsta_caps, NL80211_PMSR_FTM_CAPA_ATTR_MAX,
 				      tb[NL80211_PMSR_FTM_CAPA_ATTR_RSTA_CAPS],
-				      NULL) &&
-		    rsta_caps[NL80211_PMSR_FTM_CAPA_ATTR_SUPPORT_NTB])
-			drv->capa.flags2 |=
-				WPA_DRIVER_FLAGS2_NON_TRIGGER_BASED_RESPONDER;
+				      NULL)) {
+			if (rsta_caps[NL80211_PMSR_FTM_CAPA_ATTR_SUPPORT_NTB])
+				drv->capa.flags2 |=
+					WPA_DRIVER_FLAGS2_NON_TRIGGER_BASED_RESPONDER;
+			if (rsta_caps[NL80211_PMSR_FTM_CAPA_ATTR_SUPPORT_EDCA])
+				drv->capa.flags2 |=
+					WPA_DRIVER_FLAGS2_PR_EDCA_RSTA_SUPPORT;
+		}
 	}
 
 	if (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