From ad591e951585e77b97bb52d59cd07fcefcc5110f Mon Sep 17 00:00:00 2001 From: bings Date: Wed, 2 Aug 2017 17:48:56 +0800 Subject: qcacld-3.0: Optimize channel selection in ACS mode SAP selects different channel between cld2.0 driver and cld3.0 driver in ACS mode, which leads to confusion. In cld2.0 driver, channel with the least weight is the first choice, and non-overlap channel will be selected only when overlap channel is disabled and its weight is not bigger than the first choice channel. In cld3.0 driver, non-overlap channel will be selected when overlap channel is disabled. The behavior in cld2.0 is more reasonable. Make cld3.0 driver follow cld2.0 driver. Change-Id: I6243ace8db7314c698a9b554e65794d2ee66e555 CRs-Fixed: 2086287 --- core/sap/src/sap_ch_select.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index f760da157c8e..2b690225a7cd 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -2651,6 +2651,16 @@ uint8_t sap_select_channel(tHalHandle hal, ptSapContext sap_ctx, continue; } + if (spect_info->pSpectCh[count].weight_copy > + sap_ctx->acsBestChannelInfo.weight) { + QDF_TRACE(QDF_MODULE_ID_SAP, + QDF_TRACE_LEVEL_INFO_HIGH, + "candidate ch weight: %d, best ch weight: %d", + spect_info->pSpectCh[count].weight_copy, + sap_ctx->acsBestChannelInfo.weight); + continue; + } + if (CDS_IS_DFS_CH(spect_info->pSpectCh[count].chNum) && cds_disallow_mcc(spect_info->pSpectCh[count].chNum)) { QDF_TRACE(QDF_MODULE_ID_SAP, -- cgit v1.2.3