From patchwork Wed May 13 06:59:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 2237507 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=T8xFwQC9; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Tt4vs4f0; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4gFks53hpvz1yLT for ; Wed, 13 May 2026 17:01:29 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Q+BRbqT3P74nx7C+kUFfTDo2dR3SrsJ9HX0R+Bx818w=; b=T8xFwQC9QGvSIs muSubWziOQDENfocuDjAGcZgcKpBe/5UQhCaSY5YHrH3XXQVTsRJMaAYOwINqis5ir5VNHBIvKoB9 GBY41hvq4EHbPEswOSo5jVlCgYFz/AScU6dC/5azAAYu3+40Pq9Jp5LJNvBZSNFX4Kkqv7nxE9PRf m8D5KJRUBvREIFYIcBoOOAzRrhrOz1CnEEV34hVKqr9zhg5Ttz8MjYnCVrAQDA7EuIif4kTHP9uNn 1tlbyegaRXMPdvuDx2Wm0iyI5WtkeA1GBsHqKnBwnF1ki80UjQNU2Y4hZiqBS5eJscXqQfTGHOEVb I6kGYoYU9FkjRuAsLjMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wN3Z9-00000001UbA-0a0L; Wed, 13 May 2026 06:59:35 +0000 Received: from mgamail.intel.com ([198.175.65.10]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wN3Z7-00000001UZY-0aZr for hostap@lists.infradead.org; Wed, 13 May 2026 06:59:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778655574; x=1810191574; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=JzveeoUfk9o4QNRO9prZYoAiQPMukA/846shtIJIMxI=; b=Tt4vs4f0bJOcj6Ei+AGUs6Ikl6zOHmcqmHnSMG6N17pgPCK5Uz+65FD2 6P0IWBVwNB7ib1N7GD/Dgq3N7umg/2G0VgY5yPnjM/HpV5rPEFryZbqmK gDvzWxRiLrHwwLlOHr6N37rS72s7Pz2XykjL+PIhlYnaoEcup77mzSnxs KJhYVjbyBb6+m9ogqXgzsOHOwBG0yjB1lFHAWf7DVMfuq+W1EZ5Ud92GU dfWQdo4OJRbXEINZ99lMt4ECPZmPrbcGhiyKybH9S/nfUv0bpVNxUwvfX v//I2+87rApO8DLIDwdnPEMObR7OeoumZLoYVK8rxy6eaCR0gxGtqezMb A==; X-CSE-ConnectionGUID: yqdgOib2SoiGI/mVovIX5w== X-CSE-MsgGUID: /LflZKhKRGq0prRkXFxvXQ== X-IronPort-AV: E=McAfee;i="6800,10657,11784"; a="97001312" X-IronPort-AV: E=Sophos;i="6.23,232,1770624000"; d="scan'208";a="97001312" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2026 23:59:33 -0700 X-CSE-ConnectionGUID: otncQmr1T+qhMw1Vju43Pg== X-CSE-MsgGUID: DbzB9mgtRZ2DwtYOlZJHnw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,232,1770624000"; d="scan'208";a="233721918" Received: from iapp347.iil.intel.com (HELO 87c02287900a.iil.intel.com) ([10.167.28.6]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2026 23:59:31 -0700 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: maheshkkv@google.com, vamsin@qti.qualcomm.com, Ilan Peer Subject: [PATCH 2/3] wpa_supplicant: Support tracking NAN transmit requests Date: Wed, 13 May 2026 09:59:04 +0300 Message-ID: <20260513065909.12048-6-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260512_235933_244709_F44EC6AC X-CRM114-Status: GOOD ( 16.00 ) X-Spam-Score: -4.8 (----) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Ilan Peer Extended the NAN transmit API to also include a cookie, so that when the NAN DE finishes transmitting the frame it would notify the higher layers whether the frame was acknowledged or not. Content analysis details: (-4.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [198.175.65.10 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.4 DKIMWL_WL_HIGH DKIMwl.org - High trust sender -0.0 DMARC_PASS DMARC pass policy X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Ilan Peer Extended the NAN transmit API to also include a cookie, so that when the NAN DE finishes transmitting the frame it would notify the higher layers whether the frame was acknowledged or not. Signed-off-by: Ilan Peer --- src/common/wpa_ctrl.h | 1 + wpa_supplicant/ctrl_iface.c | 17 ++++++++++++++++- wpa_supplicant/dbus/dbus_new_handlers.c | 2 +- wpa_supplicant/nan_supplicant.c | 19 +++++++++++++++++-- wpa_supplicant/nan_supplicant.h | 3 ++- wpa_supplicant/notify.c | 8 ++++++++ wpa_supplicant/notify.h | 2 ++ 7 files changed, 47 insertions(+), 5 deletions(-) diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index b16790fe67..1472553d9c 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -246,6 +246,7 @@ extern "C" { #define NAN_PUBLISH_TERMINATED "NAN-PUBLISH-TERMINATED " #define NAN_SUBSCRIBE_TERMINATED "NAN-SUBSCRIBE-TERMINATED " #define NAN_RECEIVE "NAN-RECEIVE " +#define NAN_TRANSMIT_STATUS "NAN-TRANSMIT-STATUS " #define NAN_CLUSTER_JOIN "NAN-CLUSTER-JOIN " #define NAN_NDP_REQUEST "NAN-NDP-REQUEST " #define NAN_NDP_COUNTER_REQUEST "NAN-NDP-COUNTER-REQUEST " diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 14b4cd9d2e..fbdf72aa03 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -13266,6 +13266,8 @@ static int wpas_ctrl_nan_transmit(struct wpa_supplicant *wpa_s, char *cmd) struct wpabuf *ssi = NULL; u8 peer_addr[ETH_ALEN]; int ret = -1; + u32 cookie = 0; + u32 *cookie_ptr = NULL; os_memset(peer_addr, 0, ETH_ALEN); @@ -13291,6 +13293,19 @@ static int wpas_ctrl_nan_transmit(struct wpa_supplicant *wpa_s, char *cmd) continue; } + if (os_strncmp(token, "cookie=", 7) == 0) { + cookie = strtoul(token + 7, NULL, 0); + if (!cookie) { + wpa_printf(MSG_INFO, + "CTRL: Invalid cookie value: %s", + token + 7); + goto fail; + } + + cookie_ptr = &cookie; + continue; + } + wpa_printf(MSG_INFO, "CTRL: Invalid NAN_TRANSMIT parameter: %s", token); @@ -13310,7 +13325,7 @@ static int wpas_ctrl_nan_transmit(struct wpa_supplicant *wpa_s, char *cmd) } ret = wpas_nan_transmit(wpa_s, handle, ssi, NULL, peer_addr, - req_instance_id); + req_instance_id, cookie_ptr); fail: wpabuf_free(ssi); return ret; diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c index cb4a8a6d38..a9f5679443 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.c +++ b/wpa_supplicant/dbus/dbus_new_handlers.c @@ -7035,7 +7035,7 @@ DBusMessage * wpas_dbus_handler_nan_transmit(DBusMessage *message, goto fail; if (wpas_nan_transmit(wpa_s, handle, ssi, NULL, peer_addr, - req_instance_id) < 0) + req_instance_id, NULL) < 0) reply = wpas_dbus_error_unknown_error( message, "failed to transmit follow-up"); out: diff --git a/wpa_supplicant/nan_supplicant.c b/wpa_supplicant/nan_supplicant.c index fe20919ad4..5d80489411 100644 --- a/wpa_supplicant/nan_supplicant.c +++ b/wpa_supplicant/nan_supplicant.c @@ -4337,6 +4337,14 @@ static void wpas_nan_de_receive(void *ctx, int id, int peer_instance_id, } +static void wpas_nan_de_transmit_req_status(void *ctx, u32 cookie, bool ack) +{ + struct wpa_supplicant *wpa_s = ctx; + + wpas_notify_nan_transmit_req_status(wpa_s, cookie, ack); +} + + #ifdef CONFIG_P2P static void wpas_nan_process_p2p_usd_elems(void *ctx, const u8 *buf, u16 buf_len, const u8 *peer_addr, @@ -4388,6 +4396,7 @@ int wpas_nan_de_init(struct wpa_supplicant *wpa_s) cb.offload_cancel_publish = wpas_nan_usd_offload_cancel_publish; cb.offload_cancel_subscribe = wpas_nan_usd_offload_cancel_subscribe; cb.receive = wpas_nan_de_receive; + cb.transmit_req_status = wpas_nan_de_transmit_req_status; #ifdef CONFIG_P2P cb.process_p2p_usd_elems = wpas_nan_process_p2p_usd_elems; #endif /* CONFIG_P2P */ @@ -4724,12 +4733,13 @@ int wpas_nan_usd_subscribe_stop_listen(struct wpa_supplicant *wpa_s, int wpas_nan_transmit(struct wpa_supplicant *wpa_s, int handle, const struct wpabuf *ssi, const struct wpabuf *elems, - const u8 *peer_addr, u8 req_instance_id) + const u8 *peer_addr, u8 req_instance_id, + u32 *cookie) { if (!wpa_s->nan_de) return -1; return nan_de_transmit(wpa_s->nan_de, handle, ssi, elems, peer_addr, - req_instance_id, NULL, NULL); + req_instance_id, NULL, cookie); } @@ -4864,6 +4874,11 @@ int wpas_nan_tx_status(struct wpa_supplicant *wpa_s, (const struct ieee80211_mgmt *) data; wpa_s = wpas_nan_get_mgmt_iface(wpa_s); + + if (wpa_s->nan_de) + nan_de_tx_status(wpa_s->nan_de, 0, mgmt->da, data, data_len, + acked); + if (!wpas_nan_ndp_allowed(wpa_s)) return -1; diff --git a/wpa_supplicant/nan_supplicant.h b/wpa_supplicant/nan_supplicant.h index 9d7347f365..b8676a86c1 100644 --- a/wpa_supplicant/nan_supplicant.h +++ b/wpa_supplicant/nan_supplicant.h @@ -150,7 +150,8 @@ void wpas_nan_cancel_subscribe(struct wpa_supplicant *wpa_s, int subscribe_id); int wpas_nan_transmit(struct wpa_supplicant *wpa_s, int handle, const struct wpabuf *ssi, const struct wpabuf *elems, - const u8 *peer_addr, u8 req_instance_id); + const u8 *peer_addr, u8 req_instance_id, + u32 *cookie); int wpas_nan_tx_status(struct wpa_supplicant *wpa_s, const u8 *data, size_t data_len, int acked); diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c index d0b317ee1f..171508d12f 100644 --- a/wpa_supplicant/notify.c +++ b/wpa_supplicant/notify.c @@ -1268,6 +1268,14 @@ void wpas_notify_nan_subscribe_terminated(struct wpa_supplicant *wpa_s, } +void wpas_notify_nan_transmit_req_status(struct wpa_supplicant *wpa_s, + u32 cookie, bool acked) +{ + wpa_msg_global(wpa_s, MSG_INFO, NAN_TRANSMIT_STATUS + "cookie=%u acked=%u", cookie, acked); +} + + void wpas_notify_nan_bootstrap_request(struct wpa_supplicant *wpa_s, const u8 *peer_nmi, u16 pbm, int handle, u8 requestor_instance_id) diff --git a/wpa_supplicant/notify.h b/wpa_supplicant/notify.h index f779a613a4..f8ce563cd7 100644 --- a/wpa_supplicant/notify.h +++ b/wpa_supplicant/notify.h @@ -201,6 +201,8 @@ void wpas_notify_nan_publish_terminated(struct wpa_supplicant *wpa_s, void wpas_notify_nan_subscribe_terminated(struct wpa_supplicant *wpa_s, int subscribe_id, enum nan_de_reason reason); +void wpas_notify_nan_transmit_req_status(struct wpa_supplicant *wpa_s, + u32 cookie, bool acked); void wpas_notify_nan_nik_received(struct wpa_supplicant *wpa_s, const u8 *nik, size_t nik_len, int cipher_ver, int akmp,