developer | e29a5f8 | 2023-05-29 10:59:26 +0800 | [diff] [blame] | 1 | From 7bd78e612a73df62599a3826eafd49fbc4138d10 Mon Sep 17 00:00:00 2001 |
| 2 | From: Michael Lee <michael-cy.lee@mediatek.com> |
| 3 | Date: Wed, 3 May 2023 14:55:18 +0800 |
| 4 | Subject: [PATCH] hostapd: mtk: Fix CCA issue |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 5 | |
developer | e29a5f8 | 2023-05-29 10:59:26 +0800 | [diff] [blame] | 6 | When receiving CCA-related nl80211 commands, hostapd used to work on |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 7 | struct wpa_driver_nl80211_data, whose ctx always points to |
developer | e29a5f8 | 2023-05-29 10:59:26 +0800 | [diff] [blame] | 8 | hostpad_iface->bss[0]. However, CCA commands are sent on a per-BSS based. |
| 9 | This patch makes hostapd handle CCA-related commands on a per-BSS based. |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 10 | |
| 11 | Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com> |
| 12 | --- |
| 13 | src/drivers/driver_nl80211_event.c | 24 ++++++++++++------------ |
| 14 | 1 file changed, 12 insertions(+), 12 deletions(-) |
| 15 | |
| 16 | diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c |
developer | e29a5f8 | 2023-05-29 10:59:26 +0800 | [diff] [blame] | 17 | index ee922ac..585d207 100644 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 18 | --- a/src/drivers/driver_nl80211_event.c |
| 19 | +++ b/src/drivers/driver_nl80211_event.c |
developer | e29a5f8 | 2023-05-29 10:59:26 +0800 | [diff] [blame] | 20 | @@ -2930,7 +2930,7 @@ static void nl80211_assoc_comeback(struct wpa_driver_nl80211_data *drv, |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 21 | |
| 22 | #ifdef CONFIG_IEEE80211AX |
| 23 | |
| 24 | -static void nl80211_obss_color_collision(struct wpa_driver_nl80211_data *drv, |
| 25 | +static void nl80211_obss_color_collision(struct i802_bss *bss, |
| 26 | struct nlattr *tb[]) |
| 27 | { |
| 28 | union wpa_event_data data; |
developer | e29a5f8 | 2023-05-29 10:59:26 +0800 | [diff] [blame] | 29 | @@ -2944,37 +2944,37 @@ static void nl80211_obss_color_collision(struct wpa_driver_nl80211_data *drv, |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 30 | |
developer | e29a5f8 | 2023-05-29 10:59:26 +0800 | [diff] [blame] | 31 | wpa_printf(MSG_DEBUG, "nl80211: BSS color collision - bitmap %08lx", |
| 32 | data.bss_color_collision.bitmap); |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 33 | - wpa_supplicant_event(drv->ctx, EVENT_BSS_COLOR_COLLISION, &data); |
| 34 | + wpa_supplicant_event(bss->ctx, EVENT_BSS_COLOR_COLLISION, &data); |
| 35 | } |
| 36 | |
| 37 | |
| 38 | static void |
| 39 | -nl80211_color_change_announcement_started(struct wpa_driver_nl80211_data *drv) |
| 40 | +nl80211_color_change_announcement_started(struct i802_bss *bss) |
| 41 | { |
| 42 | union wpa_event_data data = {}; |
| 43 | |
| 44 | wpa_printf(MSG_DEBUG, "nl80211: CCA started"); |
| 45 | - wpa_supplicant_event(drv->ctx, EVENT_CCA_STARTED_NOTIFY, &data); |
| 46 | + wpa_supplicant_event(bss->ctx, EVENT_CCA_STARTED_NOTIFY, &data); |
| 47 | } |
| 48 | |
| 49 | |
| 50 | static void |
| 51 | -nl80211_color_change_announcement_aborted(struct wpa_driver_nl80211_data *drv) |
| 52 | +nl80211_color_change_announcement_aborted(struct i802_bss *bss) |
| 53 | { |
| 54 | union wpa_event_data data = {}; |
| 55 | |
| 56 | wpa_printf(MSG_DEBUG, "nl80211: CCA aborted"); |
| 57 | - wpa_supplicant_event(drv->ctx, EVENT_CCA_ABORTED_NOTIFY, &data); |
| 58 | + wpa_supplicant_event(bss->ctx, EVENT_CCA_ABORTED_NOTIFY, &data); |
| 59 | } |
| 60 | |
| 61 | |
| 62 | static void |
| 63 | -nl80211_color_change_announcement_completed(struct wpa_driver_nl80211_data *drv) |
| 64 | +nl80211_color_change_announcement_completed(struct i802_bss *bss) |
| 65 | { |
| 66 | union wpa_event_data data = {}; |
| 67 | |
| 68 | wpa_printf(MSG_DEBUG, "nl80211: CCA completed"); |
| 69 | - wpa_supplicant_event(drv->ctx, EVENT_CCA_NOTIFY, &data); |
| 70 | + wpa_supplicant_event(bss->ctx, EVENT_CCA_NOTIFY, &data); |
| 71 | } |
| 72 | |
| 73 | #endif /* CONFIG_IEEE80211AX */ |
developer | e29a5f8 | 2023-05-29 10:59:26 +0800 | [diff] [blame] | 74 | @@ -3230,16 +3230,16 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 75 | break; |
| 76 | #ifdef CONFIG_IEEE80211AX |
| 77 | case NL80211_CMD_OBSS_COLOR_COLLISION: |
| 78 | - nl80211_obss_color_collision(drv, tb); |
| 79 | + nl80211_obss_color_collision(bss, tb); |
| 80 | break; |
| 81 | case NL80211_CMD_COLOR_CHANGE_STARTED: |
| 82 | - nl80211_color_change_announcement_started(drv); |
| 83 | + nl80211_color_change_announcement_started(bss); |
| 84 | break; |
| 85 | case NL80211_CMD_COLOR_CHANGE_ABORTED: |
| 86 | - nl80211_color_change_announcement_aborted(drv); |
| 87 | + nl80211_color_change_announcement_aborted(bss); |
| 88 | break; |
| 89 | case NL80211_CMD_COLOR_CHANGE_COMPLETED: |
| 90 | - nl80211_color_change_announcement_completed(drv); |
| 91 | + nl80211_color_change_announcement_completed(bss); |
| 92 | break; |
| 93 | #endif /* CONFIG_IEEE80211AX */ |
| 94 | default: |
| 95 | -- |
developer | e29a5f8 | 2023-05-29 10:59:26 +0800 | [diff] [blame] | 96 | 2.25.1 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 97 | |