Extend frequency configuration to handle 6 GHz channel 2

In hostapd_set_freq_params(), if center_segment0 is 2, call
ieee80211_chan_to_freq() with operating class 136 instead of 131.

This is needed because, channel 2 is an exception in the 6 GHz band. It
comes before channel 1 and is part of operating class 136.

Channels order in 6 GHz:
    2 (Operating Class 136)
    1   5   9 ....  (Operating Class 131)

Signed-off-by: Thirusenthil Kumaran J <quic_thirusen@quicinc.com>
This commit is contained in:
Thirusenthil Kumaran J 2024-01-10 08:49:11 +05:30 committed by Jouni Malinen
parent 8677844db8
commit 9e9afd9569

View file

@ -448,6 +448,7 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
} else {
int freq1, freq2 = 0;
int bw = center_idx_to_bw_6ghz(center_segment0);
int opclass;
if (bw < 0) {
wpa_printf(MSG_ERROR,
@ -455,7 +456,10 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
return -1;
}
freq1 = ieee80211_chan_to_freq(NULL, 131,
/* The 6 GHz channel 2 uses a different operating class
*/
opclass = center_segment0 == 2 ? 136 : 131;
freq1 = ieee80211_chan_to_freq(NULL, opclass,
center_segment0);
if (freq1 < 0) {
wpa_printf(MSG_ERROR,