Sfoglia il codice sorgente

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
Deepak Dhamdhere 9 anni fa
parent
commit
a56eeac9d4

+ 2 - 1
core/mac/inc/sir_api.h

@@ -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;

+ 2 - 0
core/mac/src/pe/lim/lim_scan_result_utils.c

@@ -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 =

+ 24 - 17
core/sme/src/csr/csr_api_scan.c

@@ -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;
-
-			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_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;
+			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 * 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 * 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