[PATCH v2 6/6] nl80211: use ext ack handler for tx ctrl port

Markus Theil <[email protected]> Wed, 10 Jun 2020 10:33:01 +0200
Newsgroups gmane.linux.drivers.hostap
Message-ID <[email protected]>
This patch uses the ext ack handler for tx control port.
If these cookies are not supported by the current kernel,
a value of 0 is returned.

Signed-off-by: Markus Theil <[email protected]>
---
 src/drivers/driver_nl80211.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 123027482..f0477f1e3 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -5342,6 +5342,7 @@ static int nl80211_tx_control_port(void *priv, const u8 *dest,
 				   u16 proto, const u8 *buf, size_t len,
 				   int no_encrypt)
 {
+	struct nl80211_ack_ext_arg ext_arg;
 	struct i802_bss *bss = priv;
 	struct nl_msg *msg;
 	u64 cookie = 0;
@@ -5363,7 +5364,11 @@ static int nl80211_tx_control_port(void *priv, const u8 *dest,
 		return -ENOBUFS;
 	}
 
-	ret = send_and_recv_msgs(bss->drv, msg, NULL, NULL, NULL, NULL);
+	memset(&ext_arg, 0, sizeof(struct nl80211_ack_ext_arg));
+	ext_arg.ext_data = &cookie;
+	ret = send_and_recv_msgs(bss->drv, msg,
+				 NULL, NULL,
+				 ack_handler_cookie, &ext_arg);
 	if (ret)
 		wpa_printf(MSG_DEBUG,
 			   "nl80211: tx_control_port failed: ret=%d (%s)",
-- 
2.27.0