blob: e4667e41f6d97b83cd00cb6ff0d38c5e78d283aa [file] [log] [blame]
developerb48458e2023-05-30 11:31:57 +08001From c92a1e50abdad2bf3e961c9d5aa34baea81f025b Mon Sep 17 00:00:00 2001
developere29a5f82023-05-29 10:59:26 +08002From: Michael Lee <michael-cy.lee@mediatek.com>
3Date: Wed, 3 May 2023 14:55:18 +0800
4Subject: [PATCH] hostapd: mtk: Fix CCA issue
developer683be522023-05-11 14:24:50 +08005
developere29a5f82023-05-29 10:59:26 +08006When receiving CCA-related nl80211 commands, hostapd used to work on
developer683be522023-05-11 14:24:50 +08007struct wpa_driver_nl80211_data, whose ctx always points to
developere29a5f82023-05-29 10:59:26 +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.
developer683be522023-05-11 14:24:50 +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
developerb48458e2023-05-30 11:31:57 +080017index 67d9ce2..bcce9f5 100644
developer683be522023-05-11 14:24:50 +080018--- a/src/drivers/driver_nl80211_event.c
19+++ b/src/drivers/driver_nl80211_event.c
developerb48458e2023-05-30 11:31:57 +080020@@ -3418,7 +3418,7 @@ static void nl80211_assoc_comeback(struct wpa_driver_nl80211_data *drv,
developer683be522023-05-11 14:24:50 +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;
developerb48458e2023-05-30 11:31:57 +080029@@ -3432,37 +3432,37 @@ static void nl80211_obss_color_collision(struct wpa_driver_nl80211_data *drv,
developer683be522023-05-11 14:24:50 +080030
developerb48458e2023-05-30 11:31:57 +080031 wpa_printf(MSG_DEBUG, "nl80211: BSS color collision - bitmap %08llx",
32 (long long unsigned int) data.bss_color_collision.bitmap);
developer683be522023-05-11 14:24:50 +080033- 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 */
developerb48458e2023-05-30 11:31:57 +080074@@ -3724,16 +3724,16 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
developer683be522023-05-11 14:24:50 +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--
developere29a5f82023-05-29 10:59:26 +0800962.25.1
developer683be522023-05-11 14:24:50 +080097