Browse Source

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
Himanshu Agarwal 7 years ago
parent
commit
cf5b89316f
1 changed files with 12 additions and 12 deletions
  1. 12 12
      core/sap/src/sap_ch_select.c

+ 12 - 12
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)