qcacmn: Correct the offsets & byte cnt computation in HTT stats

Offsets used by host for HTT stats are not aligned as per the
structure declaration given in file htt.h .
Make change to use the correct offsets to get the correct stats.

Also make change for byte count computation.

Also make cleanup changes for FR65817.

Change-Id: I8bc6164cc4994c49536d7277779f25b258be1592
CRs-Fixed: 3082742
This commit is contained in:
Harsh Kumar Bijlani
2021-12-03 12:22:51 +05:30
committato da Madan Koyyalamudi
parent 95cb0e103f
commit 21fb667866
7 ha cambiato i file con 51 aggiunte e 28 eliminazioni

Vedi File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -2174,27 +2175,27 @@ static void dp_vdev_txrx_hw_stats_handler(struct htt_soc *soc,
tag_buf = tlv_buf_temp +
HTT_VDEV_STATS_GET_INDEX(TX_SUCCESS_PKT_CNT);
pkt_count = HTT_VDEV_GET_STATS_U64(tag_buf);
tx_comp.num += pkt_count;
tx_comp.num = pkt_count;
/* Extract tx success packet byte count from buffer */
tag_buf = tlv_buf_temp +
HTT_VDEV_STATS_GET_INDEX(TX_SUCCESS_BYTE_CNT);
byte_count = HTT_VDEV_GET_STATS_U64(tag_buf);
tx_comp.bytes += byte_count;
tx_comp.bytes = byte_count;
/* Extract tx retry packet count from buffer */
tag_buf = tlv_buf_temp +
HTT_VDEV_STATS_GET_INDEX(TX_RETRY_PKT_CNT);
pkt_count = HTT_VDEV_GET_STATS_U64(tag_buf);
tx_comp.num += pkt_count;
tx_failed.num += pkt_count;
tx_failed.num = pkt_count;
/* Extract tx retry packet byte count from buffer */
tag_buf = tlv_buf_temp +
HTT_VDEV_STATS_GET_INDEX(TX_RETRY_BYTE_CNT);
pkt_count = HTT_VDEV_GET_STATS_U64(tag_buf);
byte_count = HTT_VDEV_GET_STATS_U64(tag_buf);
tx_comp.bytes += byte_count;
tx_failed.bytes += byte_count;
tx_failed.bytes = byte_count;
/* Extract tx drop packet count from buffer */
tag_buf = tlv_buf_temp +
@@ -2206,7 +2207,7 @@ static void dp_vdev_txrx_hw_stats_handler(struct htt_soc *soc,
/* Extract tx drop packet byte count from buffer */
tag_buf = tlv_buf_temp +
HTT_VDEV_STATS_GET_INDEX(TX_DROP_BYTE_CNT);
pkt_count = HTT_VDEV_GET_STATS_U64(tag_buf);
byte_count = HTT_VDEV_GET_STATS_U64(tag_buf);
tx_comp.bytes += byte_count;
tx_failed.bytes += byte_count;
@@ -2220,7 +2221,7 @@ static void dp_vdev_txrx_hw_stats_handler(struct htt_soc *soc,
/* Extract tx age-out packet byte count from buffer */
tag_buf = tlv_buf_temp +
HTT_VDEV_STATS_GET_INDEX(TX_AGE_OUT_BYTE_CNT);
pkt_count = HTT_VDEV_GET_STATS_U64(tag_buf);
byte_count = HTT_VDEV_GET_STATS_U64(tag_buf);
tx_comp.bytes += byte_count;
tx_failed.bytes += byte_count;