From cf5b89316f47e0f8a51cfb5e27ea4743880ec1c5 Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Mon, 2 Jul 2018 18:06:49 +0530 Subject: [PATCH] qcacld-3.0: Check for beacon channel in ACS channel list correctly Beacon's channel is checked against ACS channel list before even getting the beacon's channel resulting in no beacon parsing at all. Check for beacon channel in ACS channel list after getting the beacon's channel. Change-Id: I16edcf9eaa0eafce289cc050652702eb90d79c9d CRs-Fixed: 2271461 --- core/sap/src/sap_ch_select.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index dc6e5c0c4151..f5cdd0fd2a36 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -1590,13 +1590,24 @@ static void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams, for (chn_num = 0; chn_num < pSpectInfoParams->numSpectChans; chn_num++) { + /* + * If the Beacon has channel ID, use it other wise we + * will rely on the channelIdSelf + */ + if (pScanResult->BssDescriptor.channelId == 0) + channel_id = + pScanResult->BssDescriptor.channelIdSelf; + else + channel_id = + pScanResult->BssDescriptor.channelId; + /* * Check if channel is present in scan channel list or * not. If not present, then continue as no need to * process the beacon on this channel. */ for (i = 0; i < sap_ctx->num_of_channel; i++) { - if (pSpectCh->chNum == + if (channel_id == sap_ctx->channelList[i]) { found = true; break; @@ -1606,17 +1617,6 @@ static void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams, if (!found) continue; - /* - * if the Beacon has channel ID, use it other wise we will - * rely on the channelIdSelf - */ - if (pScanResult->BssDescriptor.channelId == 0) - channel_id = - pScanResult->BssDescriptor.channelIdSelf; - else - channel_id = - pScanResult->BssDescriptor.channelId; - if (pSpectCh && (channel_id == pSpectCh->chNum)) { if (pSpectCh->rssiAgr < pScanResult->BssDescriptor.rssi)