blob: de6b62e8f6d584783ab2ec882f00a3b3299eb797 [file] [log] [blame]
developer617abbd2024-04-23 14:50:01 +08001From 33c9e4624040e1e0f331260c239fccdccbe52528 Mon Sep 17 00:00:00 2001
2From: Sriram R <quic_srirrama@quicinc.com>
3Date: Thu, 28 Mar 2024 23:46:40 +0530
4Subject: [PATCH 010/104] hostapd: MLO: pass ctx in mlme_event_mgmt()
5
6Add support to pass ctx in mlme_event_mgmt(). This will help in to route
7the event properly to link BSS.
8
9Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
10Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
11---
12 src/ap/drv_callbacks.c | 2 +-
13 src/drivers/driver.h | 8 ++++++++
14 src/drivers/driver_nl80211_event.c | 1 +
15 3 files changed, 10 insertions(+), 1 deletion(-)
16
17diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
18index adac2d478..3b24aa4f4 100644
19--- a/src/ap/drv_callbacks.c
20+++ b/src/ap/drv_callbacks.c
21@@ -1810,8 +1810,8 @@ static int hostapd_mgmt_rx(struct hostapd_data *hapd, struct rx_mgmt *rx_mgmt)
22 const u8 *bssid;
23 struct hostapd_frame_info fi;
24 int ret;
25- bool is_mld = false;
26
27+ hapd = rx_mgmt->ctx ? rx_mgmt->ctx : hapd;
28 hapd = switch_link_hapd(hapd, rx_mgmt->link_id);
29 iface = hapd->iface;
30
31diff --git a/src/drivers/driver.h b/src/drivers/driver.h
32index d67c949b6..a7455ef6e 100644
33--- a/src/drivers/driver.h
34+++ b/src/drivers/driver.h
35@@ -6345,6 +6345,14 @@ union wpa_event_data {
36 */
37 void *drv_priv;
38
39+ /**
40+ * ctx - Pointer to store ctx of private BSS information
41+ *
42+ * If not set to NULL, this is used for forwarding the packet
43+ * to right link BSS of ML BSS.
44+ */
45+ void *ctx;
46+
47 /**
48 * freq - Frequency (in MHz) on which the frame was received
49 */
50diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
51index 51b27bd5e..1ca8b5bce 100644
52--- a/src/drivers/driver_nl80211_event.c
53+++ b/src/drivers/driver_nl80211_event.c
54@@ -1367,6 +1367,7 @@ static void mlme_event_mgmt(struct i802_bss *bss,
55 event.rx_mgmt.frame_len = len;
56 event.rx_mgmt.ssi_signal = ssi_signal;
57 event.rx_mgmt.drv_priv = bss;
58+ event.rx_mgmt.ctx = bss->ctx;
59 event.rx_mgmt.link_id = link_id;
60
61 wpa_supplicant_event(drv->ctx, EVENT_RX_MGMT, &event);
62--
632.39.2
64