]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Update VHT capabilities info on channel switch event
authorJouni Malinen <j@w1.fi>
Sat, 6 Mar 2021 23:35:25 +0000 (01:35 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 6 Mar 2021 23:35:25 +0000 (01:35 +0200)
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 <j@w1.fi>
src/ap/drv_callbacks.c

index 53082f53c5f475a82ccb2aafc2ee481080e33b82..290d354a016c9183cc3a55be0c53d3504b8ad7f8 100644 (file)
@@ -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);