blob: de6b62e8f6d584783ab2ec882f00a3b3299eb797 [file] [log] [blame]
From 33c9e4624040e1e0f331260c239fccdccbe52528 Mon Sep 17 00:00:00 2001
From: Sriram R <quic_srirrama@quicinc.com>
Date: Thu, 28 Mar 2024 23:46:40 +0530
Subject: [PATCH 010/104] hostapd: MLO: pass ctx in mlme_event_mgmt()
Add support to pass ctx in mlme_event_mgmt(). This will help in to route
the event properly to link BSS.
Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
src/ap/drv_callbacks.c | 2 +-
src/drivers/driver.h | 8 ++++++++
src/drivers/driver_nl80211_event.c | 1 +
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index adac2d478..3b24aa4f4 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -1810,8 +1810,8 @@ static int hostapd_mgmt_rx(struct hostapd_data *hapd, struct rx_mgmt *rx_mgmt)
const u8 *bssid;
struct hostapd_frame_info fi;
int ret;
- bool is_mld = false;
+ hapd = rx_mgmt->ctx ? rx_mgmt->ctx : hapd;
hapd = switch_link_hapd(hapd, rx_mgmt->link_id);
iface = hapd->iface;
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index d67c949b6..a7455ef6e 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -6345,6 +6345,14 @@ union wpa_event_data {
*/
void *drv_priv;
+ /**
+ * ctx - Pointer to store ctx of private BSS information
+ *
+ * If not set to NULL, this is used for forwarding the packet
+ * to right link BSS of ML BSS.
+ */
+ void *ctx;
+
/**
* freq - Frequency (in MHz) on which the frame was received
*/
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index 51b27bd5e..1ca8b5bce 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -1367,6 +1367,7 @@ static void mlme_event_mgmt(struct i802_bss *bss,
event.rx_mgmt.frame_len = len;
event.rx_mgmt.ssi_signal = ssi_signal;
event.rx_mgmt.drv_priv = bss;
+ event.rx_mgmt.ctx = bss->ctx;
event.rx_mgmt.link_id = link_id;
wpa_supplicant_event(drv->ctx, EVENT_RX_MGMT, &event);
--
2.39.2