blob: 1397dbfd9937f3194699a3520d533240bd93a476 [file] [log] [blame]
From 9f8c94852992afe2d6f354464a692779bb12015a Mon Sep 17 00:00:00 2001
From: "fancy.liu" <fancy.liu@mediatek.com>
Date: Wed, 1 Nov 2023 19:58:05 +0800
Subject: [PATCH 56/69] mtk: hostapd: Fix chan_switch to usable DFS channel
fail due to ACS
Step and issue:
1. Enable ACS in hostapd config;
2. Bootup and then use hostapd_cli cmd switch channel to a DFS channel;
3. Will do ACS again, and no work on channel specified in step 2.
Root cause:
When need do DFS-CAC, hostapd will do intf disable, then set the new
channel into running config settings, and finally enable intf;
In the test case, new DFS channel is set to runnint config settings, but
another param "acs" is still 1 (enable), caused the ACS running when
intf enabled.
Solution:
In the hostapd_switch_channel_fallback, need to disable acs if channel
is valid.
Signed-off-by: fancy.liu <fancy.liu@mediatek.com>
---
src/ap/hostapd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 43b479e9b..627c9ba6e 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -4267,6 +4267,9 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
iface->freq = freq_params->freq;
iface->conf->channel = freq_params->channel;
+ if (iface->conf->channel != 0) /* If channel not zero, will disable acs. */
+ iface->conf->acs = 0;
+
iface->conf->secondary_channel = freq_params->sec_channel_offset;
hostapd_set_oper_centr_freq_seg0_idx(iface->conf, seg0_idx);
hostapd_set_oper_centr_freq_seg1_idx(iface->conf, seg1_idx);
--
2.39.2