blob: 47e29703cd51bcf3425dd47ec9b1f062c13594a9 [file] [log] [blame]
From 5b750f3f78cec3b64ebb9bb3b74def424c7d57fd Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Tue, 8 Aug 2023 19:21:41 +0800
Subject: [PATCH 33/38] hostapd: mtk: add back ht vht cap missing field before
dfs channel fallback
hostapd_event_ch_switch would set / clear ht_capab and vht_capab, based
on the bandwidth of switched channel.
For example, vht bw 160 support field would be cleared if we switch to
non bw 160 channel.
This design works fine with NON-DFS channel switch.
However, for those DFS channels who require CAC, channel switch command
calls hostapd_switch_channel_fallback instead of hostapd_switch_channel.
This is simply restarting the interface not CHANNEL SWITCHING, so
hostapd will not receive any ch_switch event from kernel.
Therefore, the cleared field in vht_capab will not be set back to 1,
even if we channel switch to dfs channel bw 160.
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
src/ap/hostapd.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 3e184b5..b8ae8de 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -4111,6 +4111,13 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
break;
}
+ if ((iface->current_mode->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET) &&
+ freq_params->bandwidth > 20)
+ iface->conf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;
+ if ((iface->current_mode->vht_capab & VHT_CAP_SUPP_CHAN_WIDTH_160MHZ) &&
+ freq_params->bandwidth == 160)
+ iface->conf->vht_capab |= VHT_CAP_SUPP_CHAN_WIDTH_160MHZ;
+
iface->freq = freq_params->freq;
iface->conf->channel = freq_params->channel;
iface->conf->secondary_channel = freq_params->sec_channel_offset;
--
2.18.0