blob: ed43435ee65f7d365b7360a97d7aa60819865f86 [file] [log] [blame]
developer05f3b2b2024-08-19 19:17:34 +08001From 5fc587076c71f7a410dd59b467f156a0ed804b13 Mon Sep 17 00:00:00 2001
developer66e89bc2024-04-23 14:50:01 +08002From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
3Date: Fri, 3 Mar 2023 12:45:42 +0800
developer05f3b2b2024-08-19 19:17:34 +08004Subject: [PATCH 028/126] mtk: hostapd: Mark DFS channel as available for CSA.
developer66e89bc2024-04-23 14:50:01 +08005
6---
7 hostapd/ctrl_iface.c | 10 ++++++++++
8 hostapd/hostapd_cli.c | 2 +-
9 src/ap/ctrl_iface_ap.c | 1 +
10 3 files changed, 12 insertions(+), 1 deletion(-)
11
12diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
developer05f3b2b2024-08-19 19:17:34 +080013index 7e5733278..815633c67 100644
developer66e89bc2024-04-23 14:50:01 +080014--- a/hostapd/ctrl_iface.c
15+++ b/hostapd/ctrl_iface.c
developer05f3b2b2024-08-19 19:17:34 +080016@@ -2792,6 +2792,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
developer66e89bc2024-04-23 14:50:01 +080017 break;
18 }
19
20+ if (settings.freq_params.radar_background) {
21+ hostapd_dfs_sta_update_state(iface,
22+ settings.freq_params.freq,
23+ settings.freq_params.ht_enabled,
24+ settings.freq_params.sec_channel_offset,
25+ bandwidth, settings.freq_params.center_freq1,
26+ settings.freq_params.center_freq2,
27+ HOSTAPD_CHAN_DFS_AVAILABLE);
28+ }
29+
30 if (settings.freq_params.center_freq1)
31 dfs_range += hostapd_is_dfs_overlap(
32 iface, bandwidth, settings.freq_params.center_freq1);
33diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
developer05f3b2b2024-08-19 19:17:34 +080034index d934bb0d4..7ab980990 100644
developer66e89bc2024-04-23 14:50:01 +080035--- a/hostapd/hostapd_cli.c
36+++ b/hostapd/hostapd_cli.c
developer05f3b2b2024-08-19 19:17:34 +080037@@ -1800,7 +1800,7 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
developer66e89bc2024-04-23 14:50:01 +080038 "<addr> = send QoS Map Configure frame" },
39 { "chan_switch", hostapd_cli_cmd_chan_switch, NULL,
40 "<cs_count> <freq> [sec_channel_offset=] [center_freq1=]\n"
41- " [center_freq2=] [bandwidth=] [blocktx] [ht|vht]\n"
42+ " [center_freq2=] [bandwidth=] [blocktx] [ht|vht] [skip_cac]\n"
43 " = initiate channel switch announcement" },
developer05f3b2b2024-08-19 19:17:34 +080044 #ifdef CONFIG_IEEE80211AX
45 { "color_change", hostapd_cli_cmd_color_change, NULL,
developer66e89bc2024-04-23 14:50:01 +080046diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
developer05f3b2b2024-08-19 19:17:34 +080047index 4d3c7e529..20d426560 100644
developer66e89bc2024-04-23 14:50:01 +080048--- a/src/ap/ctrl_iface_ap.c
49+++ b/src/ap/ctrl_iface_ap.c
developer05f3b2b2024-08-19 19:17:34 +080050@@ -1140,6 +1140,7 @@ int hostapd_parse_csa_settings(const char *pos,
developer66e89bc2024-04-23 14:50:01 +080051 settings->freq_params.vht_enabled = !!os_strstr(pos, " vht");
52 settings->freq_params.he_enabled = !!os_strstr(pos, " he");
53 settings->freq_params.eht_enabled = !!os_strstr(pos, " eht");
54+ settings->freq_params.radar_background = !!os_strstr(pos, " skip_cac");
55 settings->block_tx = !!os_strstr(pos, " blocktx");
56 #undef SET_CSA_SETTING
57 #undef SET_CSA_SETTING_EXT
58--
developer05f3b2b2024-08-19 19:17:34 +0800592.18.0
developer66e89bc2024-04-23 14:50:01 +080060