| From 39a0dd44653f12ce13af68de81bfae683669623a Mon Sep 17 00:00:00 2001 |
| From: Evelyn Tsai <evelyn.tsai@mediatek.com> |
| Date: Thu, 11 May 2023 14:08:59 +0800 |
| Subject: [PATCH 101/103] hostapd: mtk: Fix CCA issue |
| |
| When receiving CCA related nl80211 command, hostapd used to work on |
| struct wpa_driver_nl80211_data, whose ctx always points to |
| hostpad_iface->bss[0]. However, CCA command is sent on per-BSS based. |
| This patch makes hostapd handle CCA related commands on per-BSS based. |
| |
| Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com> |
| --- |
| src/drivers/driver_nl80211_event.c | 24 ++++++++++++------------ |
| 1 file changed, 12 insertions(+), 12 deletions(-) |
| |
| diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c |
| index 67d9ce2..bcce9f5 100644 |
| --- a/src/drivers/driver_nl80211_event.c |
| +++ b/src/drivers/driver_nl80211_event.c |
| @@ -3418,7 +3418,7 @@ static void nl80211_assoc_comeback(struct wpa_driver_nl80211_data *drv, |
| |
| #ifdef CONFIG_IEEE80211AX |
| |
| -static void nl80211_obss_color_collision(struct wpa_driver_nl80211_data *drv, |
| +static void nl80211_obss_color_collision(struct i802_bss *bss, |
| struct nlattr *tb[]) |
| { |
| union wpa_event_data data; |
| @@ -3432,37 +3432,37 @@ static void nl80211_obss_color_collision(struct wpa_driver_nl80211_data *drv, |
| |
| wpa_printf(MSG_DEBUG, "nl80211: BSS color collision - bitmap %08llx", |
| (long long unsigned int) data.bss_color_collision.bitmap); |
| - wpa_supplicant_event(drv->ctx, EVENT_BSS_COLOR_COLLISION, &data); |
| + wpa_supplicant_event(bss->ctx, EVENT_BSS_COLOR_COLLISION, &data); |
| } |
| |
| |
| static void |
| -nl80211_color_change_announcement_started(struct wpa_driver_nl80211_data *drv) |
| +nl80211_color_change_announcement_started(struct i802_bss *bss) |
| { |
| union wpa_event_data data = {}; |
| |
| wpa_printf(MSG_DEBUG, "nl80211: CCA started"); |
| - wpa_supplicant_event(drv->ctx, EVENT_CCA_STARTED_NOTIFY, &data); |
| + wpa_supplicant_event(bss->ctx, EVENT_CCA_STARTED_NOTIFY, &data); |
| } |
| |
| |
| static void |
| -nl80211_color_change_announcement_aborted(struct wpa_driver_nl80211_data *drv) |
| +nl80211_color_change_announcement_aborted(struct i802_bss *bss) |
| { |
| union wpa_event_data data = {}; |
| |
| wpa_printf(MSG_DEBUG, "nl80211: CCA aborted"); |
| - wpa_supplicant_event(drv->ctx, EVENT_CCA_ABORTED_NOTIFY, &data); |
| + wpa_supplicant_event(bss->ctx, EVENT_CCA_ABORTED_NOTIFY, &data); |
| } |
| |
| |
| static void |
| -nl80211_color_change_announcement_completed(struct wpa_driver_nl80211_data *drv) |
| +nl80211_color_change_announcement_completed(struct i802_bss *bss) |
| { |
| union wpa_event_data data = {}; |
| |
| wpa_printf(MSG_DEBUG, "nl80211: CCA completed"); |
| - wpa_supplicant_event(drv->ctx, EVENT_CCA_NOTIFY, &data); |
| + wpa_supplicant_event(bss->ctx, EVENT_CCA_NOTIFY, &data); |
| } |
| |
| #endif /* CONFIG_IEEE80211AX */ |
| @@ -3724,16 +3724,16 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, |
| break; |
| #ifdef CONFIG_IEEE80211AX |
| case NL80211_CMD_OBSS_COLOR_COLLISION: |
| - nl80211_obss_color_collision(drv, tb); |
| + nl80211_obss_color_collision(bss, tb); |
| break; |
| case NL80211_CMD_COLOR_CHANGE_STARTED: |
| - nl80211_color_change_announcement_started(drv); |
| + nl80211_color_change_announcement_started(bss); |
| break; |
| case NL80211_CMD_COLOR_CHANGE_ABORTED: |
| - nl80211_color_change_announcement_aborted(drv); |
| + nl80211_color_change_announcement_aborted(bss); |
| break; |
| case NL80211_CMD_COLOR_CHANGE_COMPLETED: |
| - nl80211_color_change_announcement_completed(drv); |
| + nl80211_color_change_announcement_completed(bss); |
| break; |
| #endif /* CONFIG_IEEE80211AX */ |
| default: |
| -- |
| 2.18.0 |
| |