[PATCH 89/97] driver: Add support for NAN channel evacuation event

Andrei Otcheretianski andrei.otcheretianski at intel.com
Tue Apr 28 13:06:30 PDT 2026


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

Extended the driver event to also include information
about NAN channel evacuation and add the nl80211
driver specific implementation.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/drivers/driver.h               | 18 ++++++++++++++++++
 src/drivers/driver_common.c        |  1 +
 src/drivers/driver_nl80211_event.c | 30 ++++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+)

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 36ae970ba9..441a7698d5 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -6515,6 +6515,16 @@ enum wpa_event_type {
 	 * has changed and can be attached to outgoing NAN frames.
 	 */
 	EVENT_NAN_ULW_UPDATE,
+
+	/**
+	 * EVENT_NAN_CHAN_EVACUATION - Notification of NAN channel evacuation
+	 *
+	 * This event is used to notify wpa_supplicant that the device/driver
+	 * evacuated one of the channels used for NAN operation, e.g., due to
+	 * resource constraints (not enough resources to support NAN and other
+	 * activities).
+	 */
+	EVENT_NAN_CHAN_EVACUATION
 };
 
 
@@ -7558,6 +7568,14 @@ union wpa_event_data {
 		const u8 *ulw;
 		size_t ulw_len;
 	} nan_ulw_update_info;
+
+	/**
+	 * struct nan_chan_evacuation_info - Data for EVENT_NAN_CHAN_EVACUATION
+	 * @freq: Control frequency of the evacuated channel in MHz
+	 */
+	struct nan_chan_evacuation_info {
+		int freq;
+	} nan_chan_evacuation_info;
 };
 
 /**
diff --git a/src/drivers/driver_common.c b/src/drivers/driver_common.c
index 5835095d22..f04f737c0d 100644
--- a/src/drivers/driver_common.c
+++ b/src/drivers/driver_common.c
@@ -107,6 +107,7 @@ const char * event_to_string(enum wpa_event_type event)
 	E2S(INCUMBT_SIG_INTF_DETECTED);
 	E2S(NAN_SCHED_UPDATE_DONE);
 	E2S(NAN_ULW_UPDATE);
+	E2S(NAN_CHAN_EVACUATION);
 	}
 
 	return "UNKNOWN";
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index 352cb2cab8..a281f59536 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -4379,6 +4379,33 @@ static void nl80211_nan_ulw_update_event(struct wpa_driver_nl80211_data *drv,
 	wpa_supplicant_event(drv->ctx, EVENT_NAN_ULW_UPDATE, &data);
 }
 
+
+static void
+nl80211_nan_channel_evacuate_event(struct wpa_driver_nl80211_data *drv,
+				   struct nlattr **tb)
+{
+	union wpa_event_data data;
+	struct nlattr *attrs[NL80211_ATTR_MAX + 1];
+
+	wpa_printf(MSG_DEBUG, "nl80211: NAN channel evacuation event");
+
+	os_memset(&data, 0, sizeof(data));
+
+	if (!tb[NL80211_ATTR_NAN_CHANNEL] ||
+	    nla_parse_nested(attrs, NL80211_ATTR_MAX,
+			     tb[NL80211_ATTR_NAN_CHANNEL], NULL) ||
+	    !attrs[NL80211_ATTR_WIPHY_FREQ])
+		return;
+
+	data.nan_chan_evacuation_info.freq =
+		nla_get_u32(attrs[NL80211_ATTR_WIPHY_FREQ]);
+
+	wpa_printf(MSG_DEBUG, "nl80211: NAN channel evacuate: freq=%d",
+		   data.nan_chan_evacuation_info.freq);
+
+	wpa_supplicant_event(drv->ctx, EVENT_NAN_CHAN_EVACUATION, &data);
+}
+
 #endif /* CONFIG_NAN */
 
 
@@ -4756,6 +4783,9 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
 	case NL80211_CMD_NAN_ULW_UPDATE:
 		nl80211_nan_ulw_update_event(drv, tb);
 		break;
+	case NL80211_CMD_NAN_CHANNEL_EVAC:
+		nl80211_nan_channel_evacuate_event(drv, tb);
+		break;
 #endif /* CONFIG_NAN */
 	case NL80211_CMD_INCUMBENT_SIGNAL_DETECT:
 		nl80211_incumbt_sig_intf_event(bss, tb);
-- 
2.53.0




More information about the Hostap mailing list