diff --git a/htc/htc.c b/htc/htc.c index 3f11ef9f30..9992d01978 100644 --- a/htc/htc.c +++ b/htc/htc.c @@ -200,6 +200,9 @@ static void htc_cleanup(HTC_TARGET *target) qdf_mem_free(pPacket); } #endif + HTC_INFO("%s: Non flow ctrl enabled endpoints nbuf map: %d, unamp: %d", + __func__, target->nbuf_nfc_map_count, + target->nbuf_nfc_unmap_count); htc_flush_endpoint_txlookupQ(target, ENDPOINT_0, true); diff --git a/htc/htc_internal.h b/htc/htc_internal.h index 8119ab1a6e..9db8847daa 100644 --- a/htc/htc_internal.h +++ b/htc/htc_internal.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -264,6 +265,9 @@ typedef struct _HTC_TARGET { /* Runtime count for H2T msg with response */ qdf_atomic_t htc_runtime_cnt; #endif + /* Non flow ctrl enabled endpoints nbuf map unmap count */ + uint32_t nbuf_nfc_map_count; + uint32_t nbuf_nfc_unmap_count; } HTC_TARGET; diff --git a/htc/htc_send.c b/htc/htc_send.c index a0f681db6b..8afc1de7cf 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -131,6 +132,10 @@ static void send_packet_completion(HTC_TARGET *target, HTC_PACKET *pPacket) HTC_ENDPOINT *pEndpoint = &target->endpoint[pPacket->Endpoint]; HTC_EP_SEND_PKT_COMPLETE EpTxComplete; + if ((pPacket->PktInfo.AsTx.Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) && + (!IS_TX_CREDIT_FLOW_ENABLED(pEndpoint))) + target->nbuf_nfc_unmap_count++; + restore_tx_packet(target, pPacket); /* @@ -1933,7 +1938,9 @@ static inline QDF_STATUS __htc_send_pkt(HTC_HANDLE HTCHandle, status = qdf_nbuf_map(target->osdev, GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket), QDF_DMA_TO_DEVICE); - if (status != QDF_STATUS_SUCCESS) { + if (status == QDF_STATUS_SUCCESS) { + target->nbuf_nfc_map_count++; + } else { AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: nbuf map failed, endpoint %pK, seq_no. %d\n", __func__, pEndpoint, pEndpoint->SeqNo));