qcacld-3.0: Fix issue about signal jump

rssi_raw should not be updated when the channel
in probe response does not match the channel in BD.

Added rx_channel field to beacon descriptor passed from LIM to
CSR. Channel check is performed in csr_remove_dup_bss_description()
before computing new averaged rssi.

CRs-Fixed: 873549
Change-Id: Iefacbf73f880e9d0c957ad83839dd2203fdf862d
This commit is contained in:
Deepak Dhamdhere
2015-08-06 14:16:53 -07:00
committed by Akash Patel
parent 68929ec509
commit 652d7e834e
3 changed files with 26 additions and 16 deletions

View File

@@ -655,7 +655,8 @@ typedef struct sSirBssDescription {
/* whether it is from a probe rsp */
uint8_t fProbeRsp;
uint8_t reservedPadding1;
/* Actual channel the beacon/probe response was received on */
uint8_t rx_channel;
uint8_t reservedPadding2;
uint8_t reservedPadding3;
uint32_t WscIeLen;

View File

@@ -165,6 +165,8 @@ lim_collect_bss_description(tpAniSirGlobal pMac,
}
pBssDescr->channelIdSelf = pBssDescr->channelId;
pBssDescr->rx_channel = rxChannel;
/* set the network type in bss description */
channelNum = pBssDescr->channelId;
pBssDescr->nwType =

View File

@@ -2525,23 +2525,30 @@ bool csr_remove_dup_bss_description(tpAniSirGlobal pMac,
if (csr_is_duplicate_bss_description(pMac,
&scan_entry->Result.BssDescriptor,
bss_dscp, pIes, fForced)) {
int32_t rssi_new, rssi_old;
if (bss_dscp->rx_channel == bss_dscp->channelId) {
/*
* Update rssi values only if beacon is
* received on the same channel that was
* sent on.
*/
int32_t rssi_new, rssi_old;
const int32_t weight =
CSR_SCAN_RESULT_RSSI_WEIGHT;
rssi_new = (int32_t) bss_dscp->rssi;
rssi_old = (int32_t) scan_entry->
Result.BssDescriptor.rssi;
rssi_new = ((rssi_new * CSR_SCAN_RESULT_RSSI_WEIGHT) +
rssi_old *
(100 - CSR_SCAN_RESULT_RSSI_WEIGHT)) / 100;
bss_dscp->rssi = (int8_t) rssi_new;
rssi_new = (int32_t) bss_dscp->rssi;
rssi_old = (int32_t) scan_entry->
Result.BssDescriptor.rssi;
rssi_new = ((rssi_new * weight) +
rssi_old * (100 - weight)) / 100;
bss_dscp->rssi = (int8_t) rssi_new;
rssi_new = (int32_t) bss_dscp->rssi_raw;
rssi_old = (int32_t) scan_entry->
Result.BssDescriptor.rssi_raw;
rssi_new = ((rssi_new * CSR_SCAN_RESULT_RSSI_WEIGHT) +
rssi_old *
(100 - CSR_SCAN_RESULT_RSSI_WEIGHT)) / 100;
bss_dscp->rssi_raw = (int8_t) rssi_new;
rssi_new = (int32_t) bss_dscp->rssi_raw;
rssi_old = (int32_t) scan_entry->
Result.BssDescriptor.rssi_raw;
rssi_new = ((rssi_new * weight) +
rssi_old * (100 - weight)) / 100;
bss_dscp->rssi_raw = (int8_t) rssi_new;
}
/* Remove the old entry from the list */
if (csr_ll_remove_entry