summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com>2020-11-06 14:09:57 -0800
committerSecurityBot <android-nexus-securitybot@system.gserviceaccount.com>2020-11-06 14:09:57 -0800
commit854a33723eab0f3d0987aa490000da233b82b10f (patch)
tree6b869c50462c81c7b8031a48b9e74b52881ab519
parent62255f32da898f098adc0f95048a72260e2b2267 (diff)
parent315e03a100d39db541b68e0923ea904f0310ab90 (diff)
downloadqcacld-854a33723eab0f3d0987aa490000da233b82b10f.tar.gz
Merge android-msm-pixel-4.9-rvc-qpr2 into android-msm-pixel-4.9
SBMerger: 325904710 Change-Id: I3249c1114d3deb565a5e155253abaa4aeec90400 Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-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,