From f224d5dc91b59a9c610fc38daaea236039645857 Mon Sep 17 00:00:00 2001 From: Neha Bisht Date: Thu, 28 May 2020 12:06:33 +0530 Subject: [PATCH] qcacmn: Introduce counters per endpoint to improve HTC debuggability To introduce counters htc_send_cnt and htc_comp_cnt per endpoint to enhance pdev level debugging in HTC path. Change-Id: I8d31e3a533e0f8de4c89d3609b20c148aef3a4ff --- htc/htc_internal.h | 2 ++ htc/htc_send.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htc/htc_internal.h b/htc/htc_internal.h index 5d002260f8d5..28151a1f5c9d 100644 --- a/htc/htc_internal.h +++ b/htc/htc_internal.h @@ -140,6 +140,8 @@ typedef struct _HTC_ENDPOINT { qdf_timer_t ul_poll_timer; int ul_poll_timer_active; int ul_outstanding_cnt; + uint32_t htc_send_cnt; + uint32_t htc_comp_cnt; /* Need to call HIF to fetch rx? (Not currently supported.) */ int dl_is_polled; /* not currently supported */ diff --git a/htc/htc_send.c b/htc/htc_send.c index c58f0112cd0b..ba94c76bee0a 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -866,6 +866,7 @@ static QDF_STATUS htc_issue_packets(HTC_TARGET *target, htc_issue_tx_bundle_stats_inc(target); target->ce_send_cnt++; + pEndpoint->htc_send_cnt++; if (qdf_unlikely(QDF_IS_STATUS_ERROR(status))) { if (status != QDF_STATUS_E_RESOURCES) { @@ -899,6 +900,7 @@ static QDF_STATUS htc_issue_packets(HTC_TARGET *target, LOCK_HTC_TX(target); } target->ce_send_cnt--; + pEndpoint->htc_send_cnt--; pEndpoint->ul_outstanding_cnt--; HTC_PACKET_REMOVE(&pEndpoint->TxLookupQueue, pPacket); htc_packet_set_magic_cookie(pPacket, 0); @@ -2245,7 +2247,6 @@ static HTC_PACKET *htc_lookup_tx_packet(HTC_TARGET *target, LOCK_HTC_EP_TX_LOOKUP(pEndpoint); LOCK_HTC_TX(target); - /* mark that HIF has indicated the send complete for another packet */ pEndpoint->ul_outstanding_cnt--; @@ -2324,6 +2325,7 @@ QDF_STATUS htc_tx_completion_handler(void *Context, pEndpoint = &target->endpoint[EpID]; target->TX_comp_cnt++; + pEndpoint->htc_comp_cnt++; do { pPacket = htc_lookup_tx_packet(target, pEndpoint, netbuf);