[PATCH 96/97] NAN: Add data_path parameter to NAN_PUBLISH command

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


Add a new data_path parameter to NAN_PUBLISH command that sets the
NAN_SDEA_CTRL_DATA_PATH_REQ bit in the SDEA control field. This allows
publishers to indicate that they request a NAN Data Path.

Usage: NAN_PUBLISH ... data_path=1

The data_path flag is also reported in NAN-DISCOVERY-RESULT events.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/common/nan_de.c         | 5 +++++
 src/common/nan_de.h         | 4 ++++
 wpa_supplicant/ctrl_iface.c | 5 +++++
 wpa_supplicant/notify.c     | 4 ++--
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/common/nan_de.c b/src/common/nan_de.c
index 6850a5aa66..fc01166a92 100644
--- a/src/common/nan_de.c
+++ b/src/common/nan_de.c
@@ -86,6 +86,7 @@ struct nan_de_service {
 	struct wpabuf *srf;
 	bool close_proximity;
 	bool gtk_required;
+	bool data_path;
 
 	/* Bootstrapping methods */
 	u16 pbm;
@@ -580,6 +581,8 @@ static void nan_de_tx_sdf(struct nan_de *de, struct nan_de_service *srv,
 				sdea_ctrl |= NAN_SDEA_CTRL_FSD_GAS;
 			if (srv->gtk_required)
 				sdea_ctrl |= NAN_SDEA_CTRL_GTK_REQ;
+			if (srv->data_path)
+				sdea_ctrl |= NAN_SDEA_CTRL_DATA_PATH_REQ;
 		}
 
 		if (sdea_ctrl || ssi) {
@@ -1703,6 +1706,7 @@ send_event:
 	res.peer_addr = peer_addr;
 	res.fsd = !!(sdea_control & NAN_SDEA_CTRL_FSD_REQ);
 	res.fsd_gas = !!(sdea_control & NAN_SDEA_CTRL_FSD_GAS);
+	res.data_path = !!(sdea_control & NAN_SDEA_CTRL_DATA_PATH_REQ);
 	res.cipher_suites = cipher_suite_count > 0 ? cipher_suites : NULL;
 	res.n_cipher_suites = cipher_suite_count;
 	res.pmkid_list = pmkid_count > 0 ? pmkid_list : NULL;
@@ -2294,6 +2298,7 @@ int nan_de_publish(struct nan_de *de, const char *service_name,
 	srv->close_proximity = params->close_proximity;
 	srv->pbm = params->pbm;
 	srv->gtk_required = params->gtk_required;
+	srv->data_path = params->data_path;
 
 	nan_de_add_srv(de, srv);
 	nan_de_run_timer(de);
diff --git a/src/common/nan_de.h b/src/common/nan_de.h
index fa0e4ce277..7f32f42bcd 100644
--- a/src/common/nan_de.h
+++ b/src/common/nan_de.h
@@ -33,6 +33,7 @@ struct nan_discovery_result {
 	const u8 *peer_addr;
 	bool fsd;
 	bool fsd_gas;
+	bool data_path;
 	const u8 *pmkid_list;
 	unsigned int pmkid_count;
 	const u8 *cipher_suites;
@@ -174,6 +175,9 @@ struct nan_publish_params {
 	 * and received for the service
 	 */
 	bool gtk_required;
+
+	/* Request NAN Data Path */
+	bool data_path;
 };
 
 /* Returns -1 on failure or >0 publish_id */
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index ba0d3124c9..ca87e88218 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -12941,6 +12941,11 @@ static int wpas_ctrl_nan_publish(struct wpa_supplicant *wpa_s, char *cmd,
 			continue;
 		}
 
+		if (os_strcmp(token, "data_path=1") == 0) {
+			params.data_path = true;
+			continue;
+		}
+
 		wpa_printf(MSG_INFO, "CTRL: Invalid NAN_PUBLISH parameter: %s",
 			   token);
 		goto fail;
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index e410df1b31..8a09c26c91 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -1158,7 +1158,7 @@ err:
 
 	wpa_msg_global(wpa_s, MSG_INFO, NAN_DISCOVERY_RESULT
 		       "subscribe_id=%d publish_id=%d address=" MACSTR
-		       " fsd=%d fsd_gas=%d srv_proto_type=%u ssi=%s%s%s%s%s pairing_setup_supp=%d npk_nik_caching_supp=%d pbm=0x%04x",
+		       " fsd=%d fsd_gas=%d srv_proto_type=%u ssi=%s%s%s%s%s pairing_setup_supp=%d npk_nik_caching_supp=%d pbm=0x%04x data_path=%d",
 		       res->subscribe_id, res->peer_publish_id,
 		       MAC2STR(res->peer_addr),
 		       res->fsd, res->fsd_gas, res->srv_proto_type, ssi_hex,
@@ -1167,7 +1167,7 @@ err:
 		       cipher_suites_str ? " cipher_suites=" : "",
 		       cipher_suites_str ? cipher_suites_str : "",
 		       res->pairing_setup_supp, res->npk_nik_caching_supp,
-		       res->pbm);
+		       res->pbm, res->data_path);
 	os_free(ssi_hex);
 	os_free(pmkid_hex);
 	os_free(cipher_suites_str);
-- 
2.53.0




More information about the Hostap mailing list