diff --git a/htc/htc_api.h b/htc/htc_api.h index 2b8f3b1cad..14488e4260 100644 --- a/htc/htc_api.h +++ b/htc/htc_api.h @@ -689,6 +689,14 @@ A_STATUS HTCWaitForPendingRecv(HTC_HANDLE HTCHandle, /* function to fetch stats from htc layer*/ struct ol_ath_htc_stats *ieee80211_ioctl_get_htc_stats(HTC_HANDLE HTCHandle); +/** + * htc_get_tx_queue_depth() - get the tx queue depth of an htc endpoint + * @htc_handle: htc handle + * @enpoint_id: endpoint to check + * + * Return: htc_handle tx queue depth + */ +int htc_get_tx_queue_depth(HTC_HANDLE *htc_handle, HTC_ENDPOINT_ID endpoint_id); #ifdef HIF_USB #define HTCReturnReceivePkt(target, p, osbuf) \ diff --git a/htc/htc_send.c b/htc/htc_send.c index 79f6f47211..1a1f3f9de8 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -142,6 +142,14 @@ void htc_dump_counter_info(HTC_HANDLE HTCHandle) __func__, target->ce_send_cnt, target->TX_comp_cnt)); } +int htc_get_tx_queue_depth(HTC_HANDLE *htc_handle, HTC_ENDPOINT_ID endpoint_id) +{ + HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle); + HTC_ENDPOINT *endpoint = &target->endpoint[endpoint_id]; + + return HTC_PACKET_QUEUE_DEPTH(&endpoint->TxQueue); +} + void htc_get_control_endpoint_tx_host_credits(HTC_HANDLE HTCHandle, int *credits) { HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);