[PATCH 46/97] driver: Extend the NAN capabilities to indicate beacon protection

Andrei Otcheretianski andrei.otcheretianski at intel.com
Tue Apr 28 13:05:47 PDT 2026


From: Ilan Peer <ilan.peer at intel.com>

Extend the NAN capabilities to allow indicating support for beacon
protection. Beacon protection is supported if one of the allowed
management group ciphers for NAN is supported (BIP-CMAC-128 or
BIP-GMAC-256) and the driver also supports beacon protection.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/drivers/driver.h              |  2 ++
 src/drivers/driver_nl80211_capa.c | 16 ++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 3807fc0f8b..69d354c17f 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -2222,6 +2222,8 @@ struct nan_capa {
 #define WPA_DRIVER_FLAGS_NAN_SUPPORT_USERSPACE_DE	0x00000004
 /** Driver supports NAN Data path */
 #define WPA_DRIVER_FLAGS_NAN_SUPPORT_NDP		0x00000008
+/** Driver supports NAN beacon protection */
+#define WPA_DRIVER_FLAGS_NAN_SUPPORT_BEACON_PROT	0x00000010
 	u32 drv_flags;
 	u8 num_radios;
 	u8 sched_chans;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 620cff5d8d..8fd8d388a6 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1510,6 +1510,22 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv,
 		 */
 		drv->capa.nan_capa.slot_duration = 16;
 		drv->capa.nan_capa.schedule_period = 512;
+
+		/*
+		 * Support NAN beacon protection only if at least one of the NAN
+		 * management group ciphers is supported and the HW supports
+		 * beacon protection
+		 */
+		if (info->capa->enc & (WPA_DRIVER_CAPA_ENC_BIP |
+				       WPA_DRIVER_CAPA_ENC_BIP_GMAC_256) &&
+		    (drv->capa.flags & WPA_DRIVER_FLAGS_BEACON_PROTECTION))
+			drv->capa.nan_capa.drv_flags |=
+				WPA_DRIVER_FLAGS_NAN_SUPPORT_BEACON_PROT;
+
+		wpa_printf(MSG_DEBUG,
+			   "nl80211: NAN: beacon protection supported=%u",
+			   !!(drv->capa.nan_capa.drv_flags &
+			      WPA_DRIVER_FLAGS_NAN_SUPPORT_BEACON_PROT));
 	}
 #endif /* CONFIG_NAN */
 
-- 
2.53.0




More information about the Hostap mailing list