| From 618f55fdab5d0045b063622585d96cbb9d00758f Mon Sep 17 00:00:00 2001 |
| From: Bo Jiao <Bo.Jiao@mediatek.com> |
| Date: Thu, 19 Oct 2023 14:08:50 +0800 |
| Subject: [PATCH 60/69] mtk: hostapd: fix issue that tx status handle with |
| unmatch hostapd_data. |
| |
| Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com> |
| --- |
| src/ap/ieee802_11.c | 11 ++++++++++- |
| src/drivers/driver_nl80211_event.c | 7 ++++--- |
| 2 files changed, 14 insertions(+), 4 deletions(-) |
| |
| diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c |
| index dc362a589..f1c5c5a82 100644 |
| --- a/src/ap/ieee802_11.c |
| +++ b/src/ap/ieee802_11.c |
| @@ -6561,11 +6561,20 @@ static void handle_assoc_cb(struct hostapd_data *hapd, |
| #ifdef CONFIG_IEEE80211BE |
| if (ap_sta_is_mld(hapd, sta) && |
| hapd->mld_link_id != sta->mld_assoc_link_id) { |
| + struct hostapd_data *temp_hapd = hapd; |
| + |
| /* See ieee80211_ml_link_sta_assoc_cb() for the MLD case */ |
| wpa_printf(MSG_DEBUG, |
| "%s: MLD: ignore on link station (%d != %d)", |
| __func__, hapd->mld_link_id, sta->mld_assoc_link_id); |
| - return; |
| + |
| + if (temp_hapd->conf->mld_ap && sta->mld_assoc_link_id >= 0) { |
| + struct hostapd_data *link_bss; |
| + |
| + link_bss = hostapd_mld_get_link_bss(temp_hapd, sta->mld_assoc_link_id); |
| + if (link_bss) |
| + hapd = link_bss; |
| + } |
| } |
| #endif /* CONFIG_IEEE80211BE */ |
| |
| diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c |
| index 78c9e58f9..0ead113f9 100644 |
| --- a/src/drivers/driver_nl80211_event.c |
| +++ b/src/drivers/driver_nl80211_event.c |
| @@ -1363,11 +1363,12 @@ static void mlme_event_mgmt(struct i802_bss *bss, |
| event.rx_mgmt.drv_priv = bss; |
| event.rx_mgmt.link_id = link_id; |
| |
| - wpa_supplicant_event(drv->ctx, EVENT_RX_MGMT, &event); |
| + wpa_supplicant_event(bss->ctx, EVENT_RX_MGMT, &event); |
| } |
| |
| |
| static void mlme_event_mgmt_tx_status(struct wpa_driver_nl80211_data *drv, |
| + struct i802_bss *bss, |
| struct nlattr *cookie, const u8 *frame, |
| size_t len, struct nlattr *ack) |
| { |
| @@ -1427,7 +1428,7 @@ static void mlme_event_mgmt_tx_status(struct wpa_driver_nl80211_data *drv, |
| event.tx_status.ack = ack != NULL; |
| event.tx_status.link_id = cookie_val == drv->send_frame_cookie ? |
| drv->send_frame_link_id : NL80211_DRV_LINK_ID_NA; |
| - wpa_supplicant_event(drv->ctx, EVENT_TX_STATUS, &event); |
| + wpa_supplicant_event(bss->ctx, EVENT_TX_STATUS, &event); |
| } |
| |
| |
| @@ -1735,7 +1736,7 @@ static void mlme_event(struct i802_bss *bss, |
| nla_len(frame), link_id); |
| break; |
| case NL80211_CMD_FRAME_TX_STATUS: |
| - mlme_event_mgmt_tx_status(drv, cookie, nla_data(frame), |
| + mlme_event_mgmt_tx_status(drv, bss, cookie, nla_data(frame), |
| nla_len(frame), ack); |
| break; |
| case NL80211_CMD_UNPROT_DEAUTHENTICATE: |
| -- |
| 2.39.2 |
| |