6 GHz: Fix operating class in Supported Operating Classes element

Previously, the secondary channel was set only in presence of HT
capabilities based on HT40+ or HT40-. As HT capabilities and
secondary_channel are not present for the 6 GHz bamd, this causes
incorrect operating class indication in the Supported Operating Classes
element.

Fix this by assigning the secondary channel for bandwidths greater than
20 MHz in the 6 GHz band.

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
This commit is contained in:
Pradeep Kumar Chitrapu 2021-04-22 11:30:09 -07:00 committed by Jouni Malinen
parent 6162890798
commit 15742566fd

View file

@ -1674,6 +1674,26 @@ static int configured_fixed_chan_to_freq(struct hostapd_iface *iface)
}
static void hostapd_set_6ghz_sec_chan(struct hostapd_iface *iface)
{
int bw, seg0;
if (!is_6ghz_op_class(iface->conf->op_class))
return;
seg0 = hostapd_get_oper_centr_freq_seg0_idx(iface->conf);
bw = center_idx_to_bw_6ghz(seg0);
/* Assign the secondary channel if absent in config for
* bandwidths > 20 MHz */
if (bw > 20 && !iface->conf->secondary_channel) {
if (((iface->conf->channel - 1) / 4) % 2)
iface->conf->secondary_channel = -1;
else
iface->conf->secondary_channel = 1;
}
}
static int setup_interface2(struct hostapd_iface *iface)
{
iface->wait_channel_update = 0;
@ -1693,6 +1713,7 @@ static int setup_interface2(struct hostapd_iface *iface)
ch_width = op_class_to_ch_width(iface->conf->op_class);
hostapd_set_oper_chwidth(iface->conf, ch_width);
hostapd_set_6ghz_sec_chan(iface);
}
ret = hostapd_select_hw_mode(iface);