[RFC v2 64/99] driver_nl80211: Register for NAFs

Andrei Otcheretianski andrei.otcheretianski at intel.com
Tue Dec 23 03:52:08 PST 2025


Receive NAN action frames on NAN device interface.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/drivers/driver_nl80211.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index ef8c96cd72..30a7bfd836 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2727,7 +2727,9 @@ static int nl80211_register_action_frame(struct i802_bss *bss,
 }
 
 
-#define NAN_PUB_ACTION ((u8 *) "\x04\x09\x50\x6f\x9a\x13")
+#define NAN_SDF_ACTION ((u8 *) "\x04\x09\x50\x6f\x9a\x13")
+#define NAN_NAF_ACTION ((u8 *) "\x04\x09\x50\x6f\x9a\x18")
+
 
 static int nl80211_mgmt_subscribe_nan(struct i802_bss *bss)
 {
@@ -2749,9 +2751,17 @@ static int nl80211_mgmt_subscribe_nan(struct i802_bss *bss)
 		   bss->nl_mgmt);
 
 	/* NAN SDF Public Action */
-	if (nl80211_register_action_frame2(bss, NAN_PUB_ACTION, 6, true)) {
+	if (nl80211_register_action_frame2(bss, NAN_SDF_ACTION, 6, true)) {
+		wpa_printf(MSG_DEBUG,
+			   "nl80211: Failed to subscribe to NAN SDFs");
+		nl_destroy_handles(&bss->nl_mgmt);
+		return -1;
+	}
+
+	/* NAF Public Action */
+	if (nl80211_register_action_frame2(bss, NAN_NAF_ACTION, 6, true)) {
 		wpa_printf(MSG_DEBUG,
-			   "nl80211: Failed to subscribe to NAN public action frames");
+			   "nl80211: Failed to subscribe to NAFs");
 		nl_destroy_handles(&bss->nl_mgmt);
 		return -1;
 	}
@@ -2836,9 +2846,9 @@ static int nl80211_mgmt_subscribe_non_ap(struct i802_bss *bss)
 #endif /* CONFIG_P2P */
 #ifdef CONFIG_NAN_USD
 	/* NAN SDF Public Action */
-	if (nl80211_register_action_frame2(bss, NAN_PUB_ACTION, 6, true) < 0) {
+	if (nl80211_register_action_frame2(bss, NAN_SDF_ACTION, 6, true) < 0) {
 		/* fallback to non-multicast */
-		if (nl80211_register_action_frame2(bss, NAN_PUB_ACTION, 6,
+		if (nl80211_register_action_frame2(bss, NAN_SDF_ACTION, 6,
 						   false) < 0)
 			ret = -1;
 	}
-- 
2.49.0




More information about the Hostap mailing list