From 4afd7bacb24a30f4a39d5c4e64ecf78597b1d141 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Wed, 30 Mar 2022 16:44:53 +0200
Subject: [PATCH 2/2] hostapd: do not set second freq when running ACS

Signed-off-by: John Crispin <john@phrozen.org>
---
 package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index 823cb0180c..818d88377e 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -314,7 +314,7 @@ mac80211_hostapd_setup_base() {
 		done
 
 		append base_cfg "vht_oper_chwidth=$vht_oper_chwidth" "$N"
-		append base_cfg "vht_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N"
+		[ "$auto_channel" -gt 0 ] || append base_cfg "vht_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N"
 
 		cap_rx_stbc=$((($vht_cap >> 8) & 7))
 		[ "$rx_stbc" -lt "$cap_rx_stbc" ] && cap_rx_stbc="$rx_stbc"
@@ -423,7 +423,7 @@ mac80211_hostapd_setup_base() {
 		[ -n "$he_bss_color" ] && append base_cfg "he_bss_color=$he_bss_color" "$N"
 		[ "$hwmode" = "a" ] && {
 			append base_cfg "he_oper_chwidth=$vht_oper_chwidth" "$N"
-			append base_cfg "he_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N"
+			[ "$auto_channel" -gt 0 ] || append base_cfg "he_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N"
 		}
 
 		mac80211_add_he_capabilities \
-- 
2.25.1

