blob: 28161203d3e49a76c916daed2e3c68f202935a9a [file] [log] [blame]
developer1a173672023-12-21 14:49:33 +08001From a56c6b0ea29d278bd7ec67e45c298eac8526a055 Mon Sep 17 00:00:00 2001
2From: "fancy.liu" <fancy.liu@mediatek.com>
3Date: Wed, 1 Nov 2023 19:58:05 +0800
4Subject: [PATCH 44/54] mtk: hostapd: Fix chan_switch to usable DFS channel
5 fail due to ACS
6
7Step and issue:
81. Enable ACS in hostapd config;
92. Bootup and then use hostapd_cli cmd switch channel to a DFS channel;
103. Will do ACS again, and no work on channel specified in step 2.
11
12Root cause:
13When need do DFS-CAC, hostapd will do intf disable, then set the new
14channel into running config settings, and finally enable intf;
15In the test case, new DFS channel is set to runnint config settings, but
16another param "acs" is still 1 (enable), caused the ACS running when
17intf enabled.
18
19Solution:
20In the hostapd_switch_channel_fallback, need to disable acs if channel
21is valid.
22
23Signed-off-by: fancy.liu <fancy.liu@mediatek.com>
24---
25 src/ap/hostapd.c | 3 +++
26 1 file changed, 3 insertions(+)
27
28diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
29index 2b563a572..f01f607f3 100644
30--- a/src/ap/hostapd.c
31+++ b/src/ap/hostapd.c
32@@ -4121,6 +4121,9 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
33
34 iface->freq = freq_params->freq;
35 iface->conf->channel = freq_params->channel;
36+ if (iface->conf->channel != 0) /* If channel not zero, will disable acs. */
37+ iface->conf->acs = 0;
38+
39 iface->conf->secondary_channel = freq_params->sec_channel_offset;
40 hostapd_set_oper_centr_freq_seg0_idx(iface->conf, seg0_idx);
41 hostapd_set_oper_centr_freq_seg1_idx(iface->conf, seg1_idx);
42--
432.18.0
44