From 147d6d3727432eda05b88cd921be31e47d1fa79d Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 7 Mar 2021 01:35:25 +0200 Subject: [PATCH] Update VHT capabilities info on channel switch event This is needed to be able to move from 80 MHz or lower bandwidth to 160 or 80+80 MHz bandwidth (and back) properly without leaving the Beacon frame VHT elements showing incorrect information. Signed-off-by: Jouni Malinen --- src/ap/drv_callbacks.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 53082f53c..290d354a0 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -961,6 +961,15 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht, hostapd_set_oper_chwidth(hapd->iconf, chwidth); hostapd_set_oper_centr_freq_seg0_idx(hapd->iconf, seg0_idx); hostapd_set_oper_centr_freq_seg1_idx(hapd->iconf, seg1_idx); + if (hapd->iconf->ieee80211ac) { + hapd->iconf->vht_capab &= ~VHT_CAP_SUPP_CHAN_WIDTH_MASK; + if (chwidth == CHANWIDTH_160MHZ) + hapd->iconf->vht_capab |= + VHT_CAP_SUPP_CHAN_WIDTH_160MHZ; + else if (chwidth == CHANWIDTH_80P80MHZ) + hapd->iconf->vht_capab |= + VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ; + } is_dfs = ieee80211_is_dfs(freq, hapd->iface->hw_features, hapd->iface->num_hw_features);