From 9e9afd9569a7ed7c65a96a8d9131b319e458776f Mon Sep 17 00:00:00 2001 From: Thirusenthil Kumaran J Date: Wed, 10 Jan 2024 08:49:11 +0530 Subject: [PATCH] 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 --- src/common/hw_features_common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c index 57b5a8e23..f45d2e9ed 100644 --- a/src/common/hw_features_common.c +++ b/src/common/hw_features_common.c @@ -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,