From 5144ba29e5687818afcfacaadb0c31575a8315e6 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Chitrapu Date: Fri, 19 Jun 2020 14:46:54 -0700 Subject: [PATCH 2/2] hostapd: fix enable 40/80mhz bandwidth in 6Ghz Currently higher bandwidths are being rejected by hostapd for 6ghz channels due to invalid sanity check. So fix that. Signed-off-by: Pradeep Kumar Chitrapu --- src/common/hw_features_common.c | 2 +- src/common/ieee802_11_common.c | 16 ++++++++-------- src/drivers/driver_nl80211.c | 3 ++- wpa_supplicant/op_classes.c | 8 ++++---- 4 files changed, 15 insertions(+), 14 deletions(-) --- a/src/common/hw_features_common.c +++ b/src/common/hw_features_common.c @@ -415,7 +415,7 @@ int hostapd_set_freq_params(struct hosta return -1; } - if (center_idx_to_bw_6ghz(channel) != 0) { + if (center_idx_to_bw_6ghz(channel) < 0) { wpa_printf(MSG_ERROR, "Invalid control channel for 6 GHz band"); return -1; --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -10677,7 +10677,8 @@ static int add_acs_ch_list(struct nl_msg * compatibility. */ if (!(freq >= 2412 && freq <= 2484) && - !(freq >= 5180 && freq <= 5900)) + !(freq >= 5180 && freq <= 5900) && + !(freq >= 5945 && freq <= 7115)) continue; hw_mode = ieee80211_freq_to_chan(freq, &ch_list[num_channels]); if (hw_mode != NUM_HOSTAPD_MODES) --- a/wpa_supplicant/op_classes.c +++ b/wpa_supplicant/op_classes.c @@ -242,7 +242,7 @@ static int wpas_op_class_supported(struc if (f == 0) break; /* end of list */ - if (f > 4000 && f < 6000) + if (f > 4000 && f < 7115) freq5 = 1; else if (f > 2400 && f < 2500) freq2 = 1; @@ -253,7 +253,7 @@ static int wpas_op_class_supported(struc freq2 = freq5 = 1; } - if (op_class->op_class >= 115 && op_class->op_class <= 130 && !freq5) + if (op_class->op_class >= 115 && op_class->op_class <= 136 && !freq5) return 0; if (op_class->op_class >= 81 && op_class->op_class <= 84 && !freq2) return 0;