developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 1 | From f8f314f2ce3c4e8e82cc98bbd404c18424b13dd7 Mon Sep 17 00:00:00 2001 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Tue, 8 Aug 2023 19:21:41 +0800 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 4 | Subject: [PATCH 041/126] mtk: hostapd: add back ht vht cap missing field |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 5 | before dfs channel fallback |
| 6 | |
| 7 | hostapd_event_ch_switch would set / clear ht_capab and vht_capab, based |
| 8 | on the bandwidth of switched channel. |
| 9 | For example, vht bw 160 support field would be cleared if we switch to |
| 10 | non bw 160 channel. |
| 11 | This design works fine with NON-DFS channel switch. |
| 12 | However, for those DFS channels who require CAC, channel switch command |
| 13 | calls hostapd_switch_channel_fallback instead of hostapd_switch_channel. |
| 14 | This is simply restarting the interface not CHANNEL SWITCHING, so |
| 15 | hostapd will not receive any ch_switch event from kernel. |
| 16 | Therefore, the cleared field in vht_capab will not be set back to 1, |
| 17 | even if we channel switch to dfs channel bw 160. |
| 18 | |
| 19 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 20 | --- |
| 21 | src/ap/hostapd.c | 7 +++++++ |
| 22 | 1 file changed, 7 insertions(+) |
| 23 | |
| 24 | diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 25 | index f06687064..4549aecb2 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 26 | --- a/src/ap/hostapd.c |
| 27 | +++ b/src/ap/hostapd.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 28 | @@ -4658,6 +4658,13 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface, |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 29 | break; |
| 30 | } |
| 31 | |
| 32 | + if ((iface->current_mode->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET) && |
| 33 | + freq_params->bandwidth > 20) |
| 34 | + iface->conf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET; |
| 35 | + if ((iface->current_mode->vht_capab & VHT_CAP_SUPP_CHAN_WIDTH_160MHZ) && |
| 36 | + freq_params->bandwidth == 160) |
| 37 | + iface->conf->vht_capab |= VHT_CAP_SUPP_CHAN_WIDTH_160MHZ; |
| 38 | + |
| 39 | iface->freq = freq_params->freq; |
| 40 | iface->conf->channel = freq_params->channel; |
| 41 | iface->conf->secondary_channel = freq_params->sec_channel_offset; |
| 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 | |