developer | 8bff647 | 2023-07-17 11:11:44 +0800 | [diff] [blame] | 1 | From ce585467d784d1015b5a40ec09895d0949690b04 Mon Sep 17 00:00:00 2001 |
developer | ff00d54 | 2023-06-08 11:36:33 +0800 | [diff] [blame] | 2 | From: Michael Lee <michael-cy.lee@mediatek.com> |
| 3 | Date: Wed, 3 May 2023 14:55:18 +0800 |
developer | 8bff647 | 2023-07-17 11:11:44 +0800 | [diff] [blame] | 4 | Subject: [PATCH 29/32] hostapd: mtk: Fix CCA issue |
developer | 505c943 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 5 | |
developer | ff00d54 | 2023-06-08 11:36:33 +0800 | [diff] [blame] | 6 | When receiving CCA-related nl80211 commands, hostapd used to work on |
developer | 505c943 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 7 | struct wpa_driver_nl80211_data, whose ctx always points to |
developer | ff00d54 | 2023-06-08 11:36:33 +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 | 505c943 | 2023-05-12 18:58:17 +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 | 8bff647 | 2023-07-17 11:11:44 +0800 | [diff] [blame] | 17 | index 3d0d9b7bb..ab988fad7 100644 |
developer | 505c943 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 18 | --- a/src/drivers/driver_nl80211_event.c |
| 19 | +++ b/src/drivers/driver_nl80211_event.c |
developer | 8bff647 | 2023-07-17 11:11:44 +0800 | [diff] [blame] | 20 | @@ -3662,7 +3662,7 @@ static void nl80211_assoc_comeback(struct wpa_driver_nl80211_data *drv, |
developer | 505c943 | 2023-05-12 18:58:17 +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 | 8bff647 | 2023-07-17 11:11:44 +0800 | [diff] [blame] | 29 | @@ -3676,37 +3676,37 @@ static void nl80211_obss_color_collision(struct wpa_driver_nl80211_data *drv, |
developer | 505c943 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 30 | |
| 31 | wpa_printf(MSG_DEBUG, "nl80211: BSS color collision - bitmap %08llx", |
| 32 | (long long unsigned int) data.bss_color_collision.bitmap); |
| 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 | 8bff647 | 2023-07-17 11:11:44 +0800 | [diff] [blame] | 74 | @@ -3968,16 +3968,16 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, |
developer | 505c943 | 2023-05-12 18:58:17 +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 | 8bff647 | 2023-07-17 11:11:44 +0800 | [diff] [blame] | 96 | 2.39.2 |
developer | 505c943 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 97 | |