summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimanshu Agarwal <himanaga@codeaurora.org>2016-07-21 14:59:50 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-09-16 05:50:05 -0700
commitcd8a84ad4622d4871d47bb92e2b6a5de8d0cfea7 (patch)
tree512bb3d2141744216ed18f5f7cd7607b51274275
parent37e4241cf0b53719fcd521ea61a24f2f8c84c3c6 (diff)
qcacld-3.0: Refactor support to get per chain rssi stats
Propagation from qcacld-2.0 to qcacld-3.0. Add sanity check based on TLV len in addition to the check based on TLV tag id to ensure that if fw does not support or is not sending rssi stats then HOST does not process it at all. Change-Id: I92b197f9578aa003bf622617c363fea7334dbcb2 CRs-Fixed: 1023179
-rw-r--r--core/wma/src/wma_utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c
index aa18f515acb5..866149dc82ee 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -1550,8 +1550,10 @@ int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
rssi_event = (wmi_per_chain_rssi_stats *) param_buf->chain_stats;
if (rssi_event) {
- if ((rssi_event->tlv_header & 0xFFFF0000) >> 16 ==
- WMITLV_TAG_STRUC_wmi_per_chain_rssi_stats) {
+ if (((rssi_event->tlv_header & 0xFFFF0000) >> 16 ==
+ WMITLV_TAG_STRUC_wmi_per_chain_rssi_stats) &&
+ ((rssi_event->tlv_header & 0x0000FFFF) ==
+ WMITLV_GET_STRUCT_TLVLEN(wmi_per_chain_rssi_stats))) {
WMA_LOGD("%s: num_rssi_stats %u", __func__,
rssi_event->num_per_chain_rssi_stats);
if (rssi_event->num_per_chain_rssi_stats > 0) {