From 7f8eb34dee5755e923d39df7f10abe6b3035ad03 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 23 Mar 2014 23:54:50 +0200 Subject: [PATCH] SME: Fix OBSS scan result processing for 20/40 MHz co-ex report The 40 MHz intolerant bit needs to be checked before skipping the BSS based on the channel already being in the lost (which could have happened due to another BSS that does not indicate 40 MHz intolerant). This fixed the 20/40 MHz co-ex report to indicate 20 MHz request properly if there are both 40 MHz tolerant and intolerant BSSes on the same channel. Signed-off-by: Jouni Malinen --- wpa_supplicant/sme.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 63beaefab..0732769ea 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -1053,6 +1053,9 @@ int sme_proc_obss_scan(struct wpa_supplicant *wpa_s) ht_cap = (ie && (ie[1] == 26)) ? WPA_GET_LE16(ie + 2) : 0; if (!ht_cap || (ht_cap & HT_CAP_INFO_40MHZ_INTOLERANT)) { + if (ht_cap & HT_CAP_INFO_40MHZ_INTOLERANT) + num_intol++; + /* Check whether the channel is already considered */ for (i = 0; i < num_channels; i++) { if (channel == chan_list[i]) @@ -1061,9 +1064,6 @@ int sme_proc_obss_scan(struct wpa_supplicant *wpa_s) if (i != num_channels) continue; - if (ht_cap & HT_CAP_INFO_40MHZ_INTOLERANT) - num_intol++; - chan_list[num_channels++] = channel; } }