[PATCH 90/97] wpa_supplicant: Notify control interface about NAN channel evacuation

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


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

Add support for control interface notification about NAN channel
evacuation.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/common/wpa_ctrl.h           |  5 +++++
 wpa_supplicant/events.c         |  3 +++
 wpa_supplicant/nan_supplicant.c | 28 ++++++++++++++++++++++++++++
 wpa_supplicant/nan_supplicant.h |  8 ++++++++
 wpa_supplicant/notify.c         |  9 +++++++++
 wpa_supplicant/notify.h         |  2 ++
 6 files changed, 55 insertions(+)

diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
index 411d22ace9..1472553d9c 100644
--- a/src/common/wpa_ctrl.h
+++ b/src/common/wpa_ctrl.h
@@ -266,6 +266,11 @@ extern "C" {
  */
 #define NAN_PAIRING_STATUS "NAN-PAIRING-STATUS "
 
+/* NAN local schedule channel evacuation.
+ * parameters: map_id=<map_id> freq=<freq>
+ */
+#define NAN_CHAN_EVACUATION "NAN-CHAN-EVACUATION "
+
 /* MESH events */
 #define MESH_GROUP_STARTED "MESH-GROUP-STARTED "
 #define MESH_GROUP_REMOVED "MESH-GROUP-REMOVED "
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 0157820aee..12609826a5 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -7659,6 +7659,9 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 		wpas_nan_ulw_update(wpa_s, data->nan_ulw_update_info.ulw,
 				    data->nan_ulw_update_info.ulw_len);
 		break;
+	case EVENT_NAN_CHAN_EVACUATION:
+		wpas_nan_chan_evacuation(wpa_s, data);
+		break;
 #endif /* CONFIG_NAN */
 	default:
 		wpa_msg(wpa_s, MSG_INFO, "Unknown event %d", event);
diff --git a/wpa_supplicant/nan_supplicant.c b/wpa_supplicant/nan_supplicant.c
index 9928afa91c..14064249bb 100644
--- a/wpa_supplicant/nan_supplicant.c
+++ b/wpa_supplicant/nan_supplicant.c
@@ -3495,6 +3495,34 @@ void wpas_nan_ulw_update(struct wpa_supplicant *wpa_s,
 }
 
 
+void wpas_nan_chan_evacuation(struct wpa_supplicant *wpa_s,
+			      union wpa_event_data *data)
+{
+	size_t map_id, i;
+	int freq = data->nan_chan_evacuation_info.freq;
+
+	if (!wpas_nan_ready(wpa_s))
+		return;
+
+	wpa_printf(MSG_DEBUG,
+		   "NAN: Channel evacuation notification freq=%d",
+		   freq);
+
+	for (map_id = 0; map_id < MAX_NAN_RADIOS; map_id++) {
+		struct nan_schedule_config *sched =
+					&wpa_s->nan_sched[map_id];
+
+		for (i = 0; i < sched->num_channels; i++) {
+			if (sched->channels[i].freq != freq)
+				continue;
+
+			wpas_notify_nan_chan_evacuation(wpa_s, map_id, freq);
+			break;
+		}
+	}
+}
+
+
 #ifdef CONFIG_PASN
 
 static int wpas_nan_pasn_update_station(struct wpa_supplicant *wpa_s,
diff --git a/wpa_supplicant/nan_supplicant.h b/wpa_supplicant/nan_supplicant.h
index 463016c9a5..62e5da1c0b 100644
--- a/wpa_supplicant/nan_supplicant.h
+++ b/wpa_supplicant/nan_supplicant.h
@@ -28,6 +28,8 @@ void wpas_nan_sched_update_done(struct wpa_supplicant *wpa_s,
 				const union wpa_event_data *data);
 void wpas_nan_ulw_update(struct wpa_supplicant *wpa_s,
 			 const u8 *ulw, size_t ulw_len);
+void wpas_nan_chan_evacuation(struct wpa_supplicant *wpa_s,
+			      union wpa_event_data *data);
 int wpas_nan_sched_config_map(struct wpa_supplicant *wpa_s, const char *cmd);
 int wpas_nan_ndp_request(struct wpa_supplicant *wpa_s, char *cmd);
 void wpas_nan_rx_naf(struct wpa_supplicant *wpa_s,
@@ -111,6 +113,12 @@ static inline bool wpas_nan_is_peer_paired(struct wpa_supplicant *wpa_s,
 {
 	return false;
 }
+
+static inline void
+wpas_nan_chan_evacuation(struct wpa_supplicant *wpa_s,
+			 union wpa_event_data *data)
+{}
+
 #endif /* CONFIG_NAN */
 
 struct nan_subscribe_params;
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index d73bb2aced..e410df1b31 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -1522,6 +1522,15 @@ void wpas_notify_nan_pairing_status(struct wpa_supplicant *wpa_s,
 	forced_memzero(nd_pmk_hex, sizeof(nd_pmk_hex));
 }
 
+
+void wpas_notify_nan_chan_evacuation(struct wpa_supplicant *wpa_s,
+				     u8 map_id, int freq)
+{
+	wpa_msg_global(wpa_s, MSG_INFO,
+		       NAN_CHAN_EVACUATION "map_id=%u freq=%d",
+		       map_id, freq);
+}
+
 #endif /* CONFIG_NAN || CONFIG_NAN_USD */
 
 
diff --git a/wpa_supplicant/notify.h b/wpa_supplicant/notify.h
index 9c7609ee3d..842865c8a9 100644
--- a/wpa_supplicant/notify.h
+++ b/wpa_supplicant/notify.h
@@ -257,5 +257,7 @@ void wpas_notify_nan_sched_update_done(struct wpa_supplicant *wpa_s,
 void wpas_notify_nan_pairing_status(struct wpa_supplicant *wpa_s,
 				    const u8 *peer_addr, int akmp, int cipher,
 				    u16 status, const u8 *nd_pmk);
+void wpas_notify_nan_chan_evacuation(struct wpa_supplicant *wpa_s,
+				     u8 map_id, int freq);
 
 #endif /* NOTIFY_H */
-- 
2.53.0




More information about the Hostap mailing list