qcacmn: RSSI averaging function accuracy

improvement on function for avergaging rssi accuracy

Change-Id: I4fb231aacb2ed76a2e5e1b5843a8b095e9901406
This commit is contained in:
Ruben Columbus
2019-10-24 18:25:02 -07:00
committed by nshrivas
parent 8f44a7e494
commit 282f3a5ce1
2 changed files with 15 additions and 4 deletions

View File

@@ -116,6 +116,17 @@
#define INVALID_RSSI 255
#define CDP_RSSI_MULTIPLIER BIT(8)
#define CDP_RSSI_MUL(x, mul) ((x) * (mul))
#define CDP_RSSI_RND(x, mul) ((((x) % (mul)) >= ((mul) / 2)) ?\
((x) + ((mul) - 1)) / (mul) : (x) / (mul))
#define CDP_RSSI_OUT(x) (CDP_RSSI_RND((x), CDP_RSSI_MULTIPLIER))
#define CDP_RSSI_IN(x) (CDP_RSSI_MUL((x), CDP_RSSI_MULTIPLIER))
#define CDP_RSSI_AVG(x, y) ((((x) << 2) + (y) - (x)) >> 2)
#define CDP_RSSI_UPDATE_AVG(x, y) x = CDP_RSSI_AVG((x), CDP_RSSI_IN((y)))
/*Max SU EVM count */
#define DP_RX_MAX_SU_EVM_COUNT 32

View File

@@ -506,11 +506,11 @@ static void dp_rx_stats_update(struct dp_pdev *pdev,
DP_STATS_UPD(peer, rx.rssi, (ppdu->rssi + pkt_bw_offset));
if (peer->stats.rx.avg_rssi == INVALID_RSSI)
peer->stats.rx.avg_rssi = ppdu->rssi;
else
peer->stats.rx.avg_rssi =
DP_GET_AVG_RSSI(peer->stats.rx.avg_rssi,
ppdu->rssi);
CDP_RSSI_IN(peer->stats.rx.rssi);
else
CDP_RSSI_UPDATE_AVG(peer->stats.rx.avg_rssi,
peer->stats.rx.rssi);
if ((preamble == DOT11_A) || (preamble == DOT11_B))
nss = 1;