]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Extend frequency configuration to handle 6 GHz channel 2
authorThirusenthil Kumaran J <quic_thirusen@quicinc.com>
Wed, 10 Jan 2024 03:19:11 +0000 (08:49 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 26 Jan 2024 18:08:41 +0000 (20:08 +0200)
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>
src/common/hw_features_common.c

index 57b5a8e23eb9026a2819f7f62adf9da9f38a6605..f45d2e9ed98c19c2617c9c1d749a30e21ceae7e7 100644 (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,