blob: 7196118256bbfd823c27540382d792428dac711f [file] [log] [blame]
developer8bff6472023-07-17 11:11:44 +08001From ce585467d784d1015b5a40ec09895d0949690b04 Mon Sep 17 00:00:00 2001
developerff00d542023-06-08 11:36:33 +08002From: Michael Lee <michael-cy.lee@mediatek.com>
3Date: Wed, 3 May 2023 14:55:18 +0800
developer8bff6472023-07-17 11:11:44 +08004Subject: [PATCH 29/32] hostapd: mtk: Fix CCA issue
developer505c9432023-05-12 18:58:17 +08005
developerff00d542023-06-08 11:36:33 +08006When receiving CCA-related nl80211 commands, hostapd used to work on
developer505c9432023-05-12 18:58:17 +08007struct wpa_driver_nl80211_data, whose ctx always points to
developerff00d542023-06-08 11:36:33 +08008hostpad_iface->bss[0]. However, CCA commands are sent on a per-BSS based.
9This patch makes hostapd handle CCA-related commands on a per-BSS based.
developer505c9432023-05-12 18:58:17 +080010
11Signed-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
16diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
developer8bff6472023-07-17 11:11:44 +080017index 3d0d9b7bb..ab988fad7 100644
developer505c9432023-05-12 18:58:17 +080018--- a/src/drivers/driver_nl80211_event.c
19+++ b/src/drivers/driver_nl80211_event.c
developer8bff6472023-07-17 11:11:44 +080020@@ -3662,7 +3662,7 @@ static void nl80211_assoc_comeback(struct wpa_driver_nl80211_data *drv,
developer505c9432023-05-12 18:58:17 +080021
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;
developer8bff6472023-07-17 11:11:44 +080029@@ -3676,37 +3676,37 @@ static void nl80211_obss_color_collision(struct wpa_driver_nl80211_data *drv,
developer505c9432023-05-12 18:58:17 +080030
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 */
developer8bff6472023-07-17 11:11:44 +080074@@ -3968,16 +3968,16 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
developer505c9432023-05-12 18:58:17 +080075 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--
developer8bff6472023-07-17 11:11:44 +0800962.39.2
developer505c9432023-05-12 18:58:17 +080097