From: Jouni Malinen Date: Sat, 6 Mar 2021 23:35:25 +0000 (+0200) Subject: Update VHT capabilities info on channel switch event X-Git-Tag: hostap_2_10~463 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=147d6d3727432eda05b88cd921be31e47d1fa79d;p=thirdparty%2Fhostap.git 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 --- 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);