qcacld-3.0: Pass correct channel in ch_in_pcl()
Presently, wrong channel is passed in ch_in_pcl() as a result of which
PCL discount is applied on wrong channel resulting in wrong ACS weight
calculation.
Pass correct channel in ch_in_pcl().
Change-Id: Id87c0afe501d7217ae6b170656bf6d2fab89b5b7
CRs-Fixed: 2257182
diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c
index 8c93879..9e63431 100644
--- a/core/sap/src/sap_ch_select.c
+++ b/core/sap/src/sap_ch_select.c
@@ -1678,9 +1678,12 @@
*/
rssi = (int8_t) pSpectCh->rssiAgr;
- if (ch_in_pcl(sap_ctx, chn_num))
+ if (ch_in_pcl(sap_ctx, pSpectCh->chNum))
rssi -= PCL_RSSI_DISCOUNT;
+ if (rssi < SOFTAP_MIN_RSSI)
+ rssi = SOFTAP_MIN_RSSI;
+
if (pSpectCh->weight == SAP_ACS_WEIGHT_MAX)
goto debug_info;
@@ -1697,9 +1700,9 @@
debug_info:
/* ------ Debug Info ------ */
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
- "In %s, Chan=%d Weight= %d rssiAgr=%d bssCount=%d",
+ "In %s, Chan=%d Weight= %d rssiAgr=%d rssi_pcl_discount: %d bssCount=%d",
__func__, pSpectCh->chNum, pSpectCh->weight,
- pSpectCh->rssiAgr, pSpectCh->bssCount);
+ pSpectCh->rssiAgr, rssi, pSpectCh->bssCount);
host_log_acs_chan_spect_weight(pSpectCh->chNum,
(uint16_t)pSpectCh->weight,
pSpectCh->rssiAgr,