From 2eb5967d99cf88a305cbf3919028aaa91aac3eaf Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 23 Jun 2015 11:21:51 +0300 Subject: [PATCH] AP: Add more 2.4 GHz channels for 20/40 MHz HT co-ex scan This needs to find the PRI channel also in cases where the affected channel is the SEC channel of a 40 MHz BSS, so need to include the scanning coverage here to be 40 MHz from the center frequency. Without this, it was possible to miss a neighboring 40 MHz BSS that was at the other end of the 2.4 GHz band and had its PRI channel further away from the local BSS. Signed-off-by: Jouni Malinen --- src/ap/hw_features.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index 7c08e524d..28324a8ee 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -347,8 +347,13 @@ static void ieee80211n_scan_channels_2g4(struct hostapd_iface *iface, sec_freq = pri_freq + 20; else sec_freq = pri_freq - 20; - affected_start = (pri_freq + sec_freq) / 2 - 25; - affected_end = (pri_freq + sec_freq) / 2 + 25; + /* + * Note: Need to find the PRI channel also in cases where the affected + * channel is the SEC channel of a 40 MHz BSS, so need to include the + * scanning coverage here to be 40 MHz from the center frequency. + */ + affected_start = (pri_freq + sec_freq) / 2 - 40; + affected_end = (pri_freq + sec_freq) / 2 + 40; wpa_printf(MSG_DEBUG, "40 MHz affected channel range: [%d,%d] MHz", affected_start, affected_end);