developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 1 | From 03ace053c9dfcbfafec764a894292180f5587c42 Mon Sep 17 00:00:00 2001 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 2 | From: "fancy.liu" <fancy.liu@mediatek.com> |
| 3 | Date: Wed, 1 Nov 2023 19:58:05 +0800 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 058/126] mtk: hostapd: Fix chan_switch to usable DFS channel |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 5 | fail due to ACS |
| 6 | |
| 7 | Step and issue: |
| 8 | 1. Enable ACS in hostapd config; |
| 9 | 2. Bootup and then use hostapd_cli cmd switch channel to a DFS channel; |
| 10 | 3. Will do ACS again, and no work on channel specified in step 2. |
| 11 | |
| 12 | Root cause: |
| 13 | When need do DFS-CAC, hostapd will do intf disable, then set the new |
| 14 | channel into running config settings, and finally enable intf; |
| 15 | In the test case, new DFS channel is set to runnint config settings, but |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 16 | another param acs is still 1 (enable), caused the ACS running when |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 17 | intf enabled. |
| 18 | |
| 19 | Solution: |
| 20 | In the hostapd_switch_channel_fallback, need to disable acs if channel |
| 21 | is valid. |
| 22 | |
| 23 | Signed-off-by: fancy.liu <fancy.liu@mediatek.com> |
| 24 | --- |
| 25 | src/ap/hostapd.c | 3 +++ |
| 26 | 1 file changed, 3 insertions(+) |
| 27 | |
| 28 | diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 29 | index 7ebdf4eb0..97bc4808e 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 30 | --- a/src/ap/hostapd.c |
| 31 | +++ b/src/ap/hostapd.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 32 | @@ -4669,6 +4669,9 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface, |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 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; |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 40 | if (ieee80211_freq_to_channel_ext(freq_params->freq, |
| 41 | freq_params->sec_channel_offset, bw, |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 42 | -- |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 43 | 2.18.0 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 44 | |