[PATCH] ACS: fix VHT20

Michal Kazior michal.kazior
Fri Feb 28 06:19:42 PST 2014


The center segment0 calculation for VHT20 ACS was
incorrect. This caused ACS to fail with:
"Could not set channel for kernel driver".

Signed-off-by: Michal Kazior <michal.kazior at tieto.com>
---
 src/ap/acs.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/ap/acs.c b/src/ap/acs.c
index f58b091..acb13b4 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -616,23 +616,26 @@ acs_find_ideal_chan(struct hostapd_iface *iface)
 
 static void acs_adjust_vht_center_freq(struct hostapd_iface *iface)
 {
+	int offset;
+
 	wpa_printf(MSG_DEBUG, "ACS: Adjusting VHT center frequency");
 
 	switch (iface->conf->vht_oper_chwidth) {
 	case VHT_CHANWIDTH_USE_HT:
-		iface->conf->vht_oper_centr_freq_seg0_idx =
-			iface->conf->channel + 2;
+		offset = 2 * iface->conf->secondary_channel;
 		break;
 	case VHT_CHANWIDTH_80MHZ:
-		iface->conf->vht_oper_centr_freq_seg0_idx =
-			iface->conf->channel + 6;
+		offset = 6;
 		break;
 	default:
 		/* TODO: How can this be calculated? Adjust
 		 * acs_find_ideal_chan() */
 		wpa_printf(MSG_INFO, "ACS: Only VHT20/40/80 is supported now");
-		break;
+		return;
 	}
+
+	iface->conf->vht_oper_centr_freq_seg0_idx =
+		iface->conf->channel + offset;
 }
 
 
-- 
1.8.5.3




More information about the Hostap mailing list