summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimanshu Agarwal <himanaga@codeaurora.org>2018-06-18 17:18:59 +0530
committernshrivas <nshrivas@codeaurora.org>2018-06-19 08:14:22 -0700
commit477c04fc9807dc26cd1a72b4afac8e6664fffa99 (patch)
tree066ee75ce226b6b0a3af1163f5b453fa9fd9e42e
parentf062670eb116745987524f63392ec144ea7354b1 (diff)
qcacld-3.0: Initialize channel info for ACS even if channel is unsafe
Channel info for ACS is not getting initialized if channel is unsafe. So, channel number, rssi, ACS weight, etc. is not getting initialized and is 0 for all the unsafe channels. As a result, wrong weights are getting calculated in ACS algo and wrong channel number is getting printed in logs for all these channels. Initialize channel info for ACS even if channel is unsafe. Change-Id: Iec315ea818b5b51aef6879831b8be29ba4515983 CRs-Fixed: 2260798
-rw-r--r--core/sap/src/sap_ch_select.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c
index 1fe6ceda57c6..ef4ad35b393e 100644
--- a/core/sap/src/sap_ch_select.c
+++ b/core/sap/src/sap_ch_select.c
@@ -643,8 +643,9 @@ static bool sap_chan_sel_init(tHalHandle halHandle,
/* Allocate memory for weight computation of 2.4GHz */
pSpectCh =
- (tSapSpectChInfo *) qdf_mem_malloc((pSpectInfoParams->numSpectChans)
- * sizeof(*pSpectCh));
+ (tSapSpectChInfo *)qdf_mem_malloc(
+ (pSpectInfoParams->numSpectChans) *
+ sizeof(*pSpectCh));
if (pSpectCh == NULL) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -673,9 +674,18 @@ static bool sap_chan_sel_init(tHalHandle halHandle,
channelnum++, pChans++, pSpectCh++) {
chSafe = true;
+ pSpectCh->chNum = *pChans;
+ /* Initialise for all channels */
+ pSpectCh->rssiAgr = SOFTAP_MIN_RSSI;
+ /* Initialise 20MHz for all the Channels */
+ pSpectCh->channelWidth = SOFTAP_HT20_CHANNELWIDTH;
+ /* Initialise max ACS weight for all channels */
+ pSpectCh->weight = SAP_ACS_WEIGHT_MAX;
+
/* check if the channel is in NOL blacklist */
- if (sap_dfs_is_channel_in_nol_list(pSapCtx, *pChans,
- PHY_SINGLE_CHANNEL_CENTERED)) {
+ if (sap_dfs_is_channel_in_nol_list(
+ pSapCtx, *pChans,
+ PHY_SINGLE_CHANNEL_CENTERED)) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
"In %s, Ch %d is in NOL list", __func__,
*pChans);
@@ -725,12 +735,7 @@ static bool sap_chan_sel_init(tHalHandle halHandle,
continue;
if (true == chSafe) {
- pSpectCh->chNum = *pChans;
pSpectCh->valid = true;
- pSpectCh->rssiAgr = SOFTAP_MIN_RSSI; /* Initialise for all channels */
- pSpectCh->channelWidth = SOFTAP_HT20_CHANNELWIDTH; /* Initialise 20MHz for all the Channels */
- /* Initialise max ACS weight for all channels */
- pSpectCh->weight = SAP_ACS_WEIGHT_MAX;
for (chan_num = 0; chan_num < pSapCtx->num_of_channel;
chan_num++) {
if (pSpectCh->chNum !=