[PATCH 15/35] nl80211: Handle NAN cluster join and DW notifications
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Mon Oct 20 05:27:50 PDT 2025
Handle NL80211_CMD_NAN_CLUSTER_JOINED and
NL80211_CMD_NAN_NEXT_DW_NOTIFICATION events and generate the
corresponding wpa_supplicant events.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
src/drivers/driver_nl80211_event.c | 50 ++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index 6c8ff867e3..bc01f8aa31 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -189,6 +189,8 @@ static const char * nl80211_command_to_string(enum nl80211_commands cmd)
C2S(NL80211_CMD_SET_TID_TO_LINK_MAPPING)
C2S(NL80211_CMD_ASSOC_MLO_RECONF)
C2S(NL80211_CMD_EPCS_CFG)
+ C2S(NL80211_CMD_NAN_CLUSTER_JOINED)
+ C2S(NL80211_CMD_NAN_NEXT_DW_NOTIFICATION)
C2S(__NL80211_CMD_AFTER_LAST)
}
#undef C2S
@@ -4135,6 +4137,46 @@ static void nl80211_obss_color_event(struct i802_bss *bss,
#endif /* CONFIG_IEEE80211AX */
+#ifdef CONFIG_NAN
+
+static void nl80211_nan_cluster_joined_event(struct wpa_driver_nl80211_data *drv,
+ struct nlattr **tb)
+{
+ union wpa_event_data data;
+
+ wpa_printf(MSG_DEBUG, "nl80211: NAN cluster joined event");
+
+ if (!tb[NL80211_ATTR_MAC])
+ return;
+
+ os_memset(&data, 0, sizeof(data));
+
+ data.nan_cluster_join_info.bssid = nla_data(tb[NL80211_ATTR_MAC]);
+ data.nan_cluster_join_info.new_cluster =
+ !!nla_get_flag(tb[NL80211_ATTR_NAN_NEW_CLUSTER]);
+
+ wpa_supplicant_event(drv->ctx, EVENT_NAN_CLUSTER_JOIN, &data);
+}
+
+
+static void nl80211_nan_next_dw_event(struct wpa_driver_nl80211_data *drv,
+ struct nlattr **tb)
+{
+ union wpa_event_data data;
+
+ wpa_printf(MSG_DEBUG, "nl80211: NAN Next DW event");
+
+ if (!tb[NL80211_ATTR_WIPHY_FREQ])
+ return;
+
+ os_memset(&data, 0, sizeof(data));
+
+ data.nan_next_dw_info.freq =
+ nla_get_u32(tb[NL80211_ATTR_WIPHY_FREQ]);
+ wpa_supplicant_event(drv->ctx, EVENT_NAN_NEXT_DW, &data);
+}
+
+#endif /* CONFIG_NAN */
static void do_process_drv_event(struct i802_bss *bss, int cmd,
struct nlattr **tb)
@@ -4408,6 +4450,14 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
case NL80211_CMD_ASSOC_MLO_RECONF:
mlme_event_link_addition(bss, nla_data(frame), nla_len(frame));
break;
+#ifdef CONFIG_NAN
+ case NL80211_CMD_NAN_CLUSTER_JOINED:
+ nl80211_nan_cluster_joined_event(drv, tb);
+ break;
+ case NL80211_CMD_NAN_NEXT_DW_NOTIFICATION:
+ nl80211_nan_next_dw_event(drv, tb);
+ break;
+#endif /* CONFIG_NAN */
default:
wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: Ignored unknown event "
"(cmd=%d)", cmd);
--
2.49.0
More information about the Hostap
mailing list