]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Cache hostapd_data context in per link BSS struct for AP MLD
authorAditya Kumar Singh <quic_adisi@quicinc.com>
Wed, 6 Mar 2024 06:38:22 +0000 (12:08 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 27 Mar 2024 16:12:39 +0000 (18:12 +0200)
Cache the corresponding hostapd_data struct context into the link entry
within the driver wrapper. This will be useful for driver events
callback processing.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
src/ap/ap_drv_ops.h
src/drivers/driver.h
src/drivers/driver_nl80211.c
src/drivers/driver_nl80211.h

index f38b1850aca3562fef3e8bc5dd301cf34b751770..b3a96447947a1fae44a5f788d45cbeba0036b909 100644 (file)
@@ -455,7 +455,7 @@ static inline int hostapd_drv_link_add(struct hostapd_data *hapd,
        if (!hapd->driver || !hapd->drv_priv || !hapd->driver->link_add)
                return -1;
 
-       return hapd->driver->link_add(hapd->drv_priv, link_id, addr);
+       return hapd->driver->link_add(hapd->drv_priv, link_id, addr, hapd);
 
 }
 #endif /* CONFIG_IEEE80211BE */
index 72446fac1433d762597471fcc9eb7eca23ac1579..f61bbeea199f9abe326f45e79eb7d074567a978e 100644 (file)
@@ -5148,9 +5148,10 @@ struct wpa_driver_ops {
         * @priv: Private driver interface data
         * @link_id: The link ID
         * @addr: The MAC address to use for the link
+        * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
         * Returns: 0 on success, negative value on failure
         */
-       int (*link_add)(void *priv, u8 link_id, const u8 *addr);
+       int (*link_add)(void *priv, u8 link_id, const u8 *addr, void *bss_ctx);
 
 #ifdef CONFIG_TESTING_OPTIONS
        int (*register_frame)(void *priv, u16 type,
index be077db9130b2bb2dde13737a895fc225f863331..46f155e45dae23d21e38abf99105ba2863f7ae3d 100644 (file)
@@ -13761,7 +13761,8 @@ static int nl80211_dpp_listen(void *priv, bool enable)
 #endif /* CONFIG_DPP */
 
 
-static int nl80211_link_add(void *priv, u8 link_id, const u8 *addr)
+static int nl80211_link_add(void *priv, u8 link_id, const u8 *addr,
+                           void *bss_ctx)
 {
        struct i802_bss *bss = priv;
        struct wpa_driver_nl80211_data *drv = bss->drv;
@@ -13820,6 +13821,7 @@ static int nl80211_link_add(void *priv, u8 link_id, const u8 *addr)
                bss->flink = &bss->links[link_id];
 
        bss->valid_links |= BIT(link_id);
+       bss->links[link_id].ctx = bss_ctx;
 
        wpa_printf(MSG_DEBUG, "nl80211: MLD: valid_links=0x%04x",
                   bss->valid_links);
index 32a1c8b1f92b2a28650e71934f56cdf9959605fa..618746e6772251effd6b02bcec7b0faa7c0d7dec 100644 (file)
@@ -58,6 +58,7 @@ struct i802_link {
        int freq;
        int bandwidth;
        u8 addr[ETH_ALEN];
+       void *ctx;
 };
 
 struct i802_bss {