AP: Add more 2.4 GHz channels for 20/40 MHz HT co-ex scan
authorJouni Malinen <j@w1.fi>
Tue, 23 Jun 2015 08:21:51 +0000 (11:21 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 23 Jun 2015 08:25:22 +0000 (11:25 +0300)
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 <j@w1.fi>
src/ap/hw_features.c

index 7c08e52..28324a8 100644 (file)
@@ -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);