[RFC PATCH v2 06/23] nl80211: Add dedicated flag for PR 6GHz capability

Peddolla Harshavardhan Reddy peddolla.reddy at oss.qualcomm.com
Thu Apr 2 05:24:11 PDT 2026


Currently, wpas_pr_init uses a generic function call wpas_is_6ghz_supported
to determine Proximity Ranging (PR) 6 GHz support. This can be inaccurate
as the generic check may be true for reasons unrelated to PR.

This patch introduces a new dedicated driver flag for PR 6GHz support:
 - WPA_DRIVER_FLAGS2_PR_6GHZ_SUPPORT

This flag is set by parsing the NL80211_PMSR_FTM_CAPA_ATTR_6GHZ_SUPPORT
peer measurement capability attribute in driver_nl80211_capa.c.

In pr_supplicant.c, the wpas_is_6ghz_supported() call is replaced
with the new WPA_DRIVER_FLAGS2_PR_6GHZ_SUPPORT flag. This ensures
that PR 6GHz capability is determined by its specific PMSR attribute
rather than a generic system setting.

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 | 3 +++
 wpa_supplicant/pr_supplicant.c    | 3 ++-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 2aa61c893..4463f6d3d 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -2452,6 +2452,8 @@ struct wpa_driver_capa {
 #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
+/** Driver supports PR ranging on 6 GHz band */
+#define WPA_DRIVER_FLAGS2_PR_6GHZ_SUPPORT		0x0000010000000000ULL
 
 	u64 flags2;
 
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index d9188f85f..9670c4a84 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1039,6 +1039,9 @@ static void pmsr_type_ftm_handler(struct wpa_driver_nl80211_data *drv,
 		}
 	}
 
+	if (tb[NL80211_PMSR_FTM_CAPA_ATTR_6GHZ_SUPPORT])
+		drv->capa.flags2 |= WPA_DRIVER_FLAGS2_PR_6GHZ_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 98e67ef09..1d4dc9fe1 100644
--- a/wpa_supplicant/pr_supplicant.c
+++ b/wpa_supplicant/pr_supplicant.c
@@ -380,7 +380,8 @@ int wpas_pr_init(struct wpa_global *global, struct wpa_supplicant *wpa_s,
 	pr.pr_max_peer_ista_role = capa->pr_max_peer_ista_role;
 	pr.pr_max_peer_rsta_role = capa->pr_max_peer_rsta_role;
 
-	pr.support_6ghz = wpas_is_6ghz_supported(wpa_s, true);
+	pr.support_6ghz = !!(wpa_s->drv_flags2 &
+			     WPA_DRIVER_FLAGS2_PR_6GHZ_SUPPORT);
 
 	pr.pasn_send_mgmt = wpas_pr_pasn_send_mgmt;
 	pr.pasn_result = wpas_pr_pasn_result;
-- 
2.34.1




More information about the Hostap mailing list