diff mbox series

EHT: Fix updating center freq segment 0 index for HE and VHT

Message ID LV2PR19MB6030376812C003FB3C549A06AD86A@LV2PR19MB6030.namprd19.prod.outlook.com
State Accepted
Headers show
Series EHT: Fix updating center freq segment 0 index for HE and VHT | expand

Commit Message

Mikelis Vuls Dec. 4, 2023, 12:27 p.m. UTC
Added additional check for 6GHz OP class.
Otherwise this results in setting incorrect segment 0 index for 5GHz
40 MHz channel 157--161, which has the same center segment 0 index
159 as 6GHz 320MHz expected channel

Signed-off-by: Mikelis Vuls <mvuls@maxlinear.com>
---
 src/ap/ap_config.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jouni Malinen Dec. 6, 2023, 10:36 a.m. UTC | #1
On Mon, Dec 04, 2023 at 12:27:48PM +0000, Mikelis Vuls wrote:
> Added additional check for 6GHz OP class.
> Otherwise this results in setting incorrect segment 0 index for 5GHz
> 40 MHz channel 157--161, which has the same center segment 0 index
> 159 as 6GHz 320MHz expected channel

Thanks, applied.
diff mbox series

Patch

diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 5699a6be1..a8aafee3c 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -1240,7 +1240,8 @@  hostapd_set_oper_centr_freq_seg0_idx(struct hostapd_config *conf,
 #ifdef CONFIG_IEEE80211BE
 	if (conf->ieee80211be)
 		conf->eht_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
-	if (center_idx_to_bw_6ghz(oper_centr_freq_seg0_idx) == 4)
+	if (is_6ghz_op_class(conf->op_class) &&
+	    center_idx_to_bw_6ghz(oper_centr_freq_seg0_idx) == 4)
 		oper_centr_freq_seg0_idx +=
 			conf->channel > oper_centr_freq_seg0_idx ? 16 : -16;
 #endif /* CONFIG_IEEE80211BE */