[PATCH] PR: Don't add EDCA/NTB capabilities if no channels are configured

Andrei Otcheretianski andrei.otcheretianski at intel.com
Thu Nov 26 04:58:59 PST 2026


From: Avraham Stern <avraham.stern at intel.com>

If no channels are supported for EDCA/NTB ranging, don't add the
EDCA/NTB capabilities attribute.

Fixes: 619cc871ba0f ("PR: Add EDCA capabilities in USD PR element")
Fixes: fa6cd439890d ("PR: Add NTB capabilities in USD PR element")
Signed-off-by: Avraham Stern <avraham.stern at intel.com>
---
 src/common/proximity_ranging.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/common/proximity_ranging.c b/src/common/proximity_ranging.c
index b614693fa7..890ea993b1 100644
--- a/src/common/proximity_ranging.c
+++ b/src/common/proximity_ranging.c
@@ -678,6 +678,12 @@ static void pr_buf_add_edca_capa_info(struct wpabuf *buf,
 	u8 ranging_role = 0;
 	size_t _len;
 
+	if (edca_data->channels.op_classes == 0) {
+		wpa_printf(MSG_DEBUG,
+			   "PR: No channels supported for EDCA - skip attribute");
+		return;
+	}
+
 	/* Proximity Ranging EDCA Capability Attribute */
 	wpabuf_put_u8(buf, PR_ATTR_EDCA_CAPABILITY);
 	len = wpabuf_put(buf, 2); /* Attribute length to be filled */
@@ -708,6 +714,12 @@ static void pr_buf_add_ntb_capa_info(struct wpabuf *buf,
 	u8 ranging_role = 0;
 	size_t _len;
 
+	if (ntb_data->channels.op_classes == 0) {
+		wpa_printf(MSG_DEBUG,
+			   "PR: No channels supported for NTB - skip attribute");
+		return;
+	}
+
 	/* Proximity Ranging 11az NTB Capability Attribute */
 	wpabuf_put_u8(buf, PR_ATTR_NTB_CAPABILITY);
 	len = wpabuf_put(buf, 2);
-- 
2.56.1




More information about the Hostap mailing list