[PATCH -next v2 12/12] wifi: nl80211: send frame tx status event only for non-zero cookie

Arend van Spriel <[email protected]> Tue, 28 Jul 2026 16:45:49 +0200
Newsgroups dev.linux.lists.brcm80211,org.kernel.vger.linux-wireless
Message-ID <[email protected]>
The cookie value assigned by cfg80211_assign_cookie() is guaranteed to be
non-zero. So the zero cookie value has special use in tx_control_port where
userspace can indicate dont_wait_for_ack, ie. not interested in status. The
wil6210 driver also uses the zero cookie when wil_cfg80211_mgmt_tx() is invoked
from debugfs api the driver provides so the event is also redundant in that
scenario.

Signed-off-by: Arend van Spriel <[email protected]>
---
 net/wireless/nl80211.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 39398d89c5ad..708e8bb8dafd 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -22034,6 +22034,10 @@ static void nl80211_frame_tx_status(struct wireless_dev *wdev,
 	struct sk_buff *msg;
 	void *hdr;
 
+	/* userspace not interested in zero-cookie status */
+	if (!status->cookie)
+		return;
+
 	if (command == NL80211_CMD_FRAME_TX_STATUS)
 		trace_cfg80211_mgmt_tx_status(wdev, status->cookie,
 					      status->ack);
-- 
2.54.0