blob: 35d4eeb01f659abb6154800c1fca6b28a7100ab5 [file] [log] [blame]
developer26d6cc52023-07-31 12:27:06 +08001From f649b398a58e34fa2d299c454bf253bcceb9f1e9 Mon Sep 17 00:00:00 2001
developer8e5fecd2023-05-30 11:58:00 +08002From: Michael Lee <michael-cy.lee@mediatek.com>
3Date: Wed, 3 May 2023 14:55:18 +0800
developer26d6cc52023-07-31 12:27:06 +08004Subject: [PATCH 32/35] hostapd: mtk: Fix CCA issue
developer8e5fecd2023-05-30 11:58:00 +08005
6When receiving CCA-related nl80211 commands, hostapd used to work on
7struct wpa_driver_nl80211_data, whose ctx always points to
8hostpad_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.
10
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
17index ee922ac..585d207 100644
18--- a/src/drivers/driver_nl80211_event.c
19+++ b/src/drivers/driver_nl80211_event.c
20@@ -2930,7 +2930,7 @@ static void nl80211_assoc_comeback(struct wpa_driver_nl80211_data *drv,
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;
29@@ -2944,37 +2944,37 @@ static void nl80211_obss_color_collision(struct wpa_driver_nl80211_data *drv,
30
31 wpa_printf(MSG_DEBUG, "nl80211: BSS color collision - bitmap %08lx",
32 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 */
74@@ -3230,16 +3230,16 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
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--
developer26d6cc52023-07-31 12:27:06 +0800962.18.0
developer8e5fecd2023-05-30 11:58:00 +080097