summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Ambure <aambure@codeaurora.org>2020-09-16 13:24:32 +0530
committerIsaac Chiou <isaacchiou@google.com>2020-10-14 09:26:58 +0000
commit315e03a100d39db541b68e0923ea904f0310ab90 (patch)
tree6b869c50462c81c7b8031a48b9e74b52881ab519
parent995dccf12bf5723c11e1844e125fd183251acfa9 (diff)
downloadqcacld-315e03a100d39db541b68e0923ea904f0310ab90.tar.gz
qcacld-3.0: Update proper RCPI value in beacon report
In beacon report's RCPI, host updates current RSSI which is incorrect according to "2008 11k spec reference: 18.4.8.5 RCPI Measurement". Hence fill RCPI value in beacon report as per "2008 11k spec reference: 18.4.8.5 RCPI Measurement". Bug: 168426596 Change-Id: I2ce88ad9f5d0db252d96f9e25db336b081cdd9bb CRs-Fixed: 2776844
-rw-r--r--core/mac/src/pe/rrm/rrm_api.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/core/mac/src/pe/rrm/rrm_api.c b/core/mac/src/pe/rrm/rrm_api.c
index da3a4c628b..33c6c06084 100644
--- a/core/mac/src/pe/rrm/rrm_api.c
+++ b/core/mac/src/pe/rrm/rrm_api.c
@@ -231,6 +231,24 @@ tSirRetStatus rrm_set_max_tx_power_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ)
return retCode;
}
+/**
+ * rrm_calculate_and_fill_rcpi() - calculates and fills RCPI value
+ * @rcpi: pointer to hold calculated RCPI value
+ * @cur_rssi: value of current RSSI
+ *
+ * @return None
+ */
+static void rrm_calculate_and_fill_rcpi(uint8_t *rcpi, int8_t cur_rssi)
+{
+ /* 2008 11k spec reference: 18.4.8.5 RCPI Measurement */
+ if (cur_rssi <= RCPI_LOW_RSSI_VALUE)
+ *rcpi = 0;
+ else if ((cur_rssi > RCPI_LOW_RSSI_VALUE) && (cur_rssi <= 0))
+ *rcpi = CALCULATE_RCPI(cur_rssi);
+ else
+ *rcpi = RCPI_MAX_VALUE;
+}
+
/* -------------------------------------------------------------------- */
/**
* rrm_process_link_measurement_request
@@ -291,14 +309,7 @@ rrm_process_link_measurement_request(tpAniSirGlobal pMac,
pe_debug("Received Link report frame with %d", currentRSSI);
- /* 2008 11k spec reference: 18.4.8.5 RCPI Measurement */
- if ((currentRSSI) <= RCPI_LOW_RSSI_VALUE)
- LinkReport.rcpi = 0;
- else if ((currentRSSI > RCPI_LOW_RSSI_VALUE) && (currentRSSI <= 0))
- LinkReport.rcpi = CALCULATE_RCPI(currentRSSI);
- else
- LinkReport.rcpi = RCPI_MAX_VALUE;
-
+ rrm_calculate_and_fill_rcpi(&LinkReport.rcpi, currentRSSI);
LinkReport.rsni = WMA_GET_RX_SNR(pRxPacketInfo);
pe_debug("Sending Link report frame");
@@ -855,7 +866,9 @@ rrm_process_beacon_report_xmit(tpAniSirGlobal mac_ctx,
beacon_report->phyType = bss_desc->nwType;
beacon_report->bcnProbeRsp = 1;
beacon_report->rsni = bss_desc->sinr;
- beacon_report->rcpi = bss_desc->rssi;
+
+ rrm_calculate_and_fill_rcpi(&beacon_report->rcpi,
+ bss_desc->rssi);
beacon_report->antennaId = 0;
beacon_report->parentTSF = bss_desc->parentTSF;
qdf_mem_copy(beacon_report->bssid,