summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHouston Hoffman <hhoffman@codeaurora.org>2017-03-14 16:15:29 -0700
committerSandeep Puligilla <spuligil@codeaurora.org>2017-03-20 13:36:57 -0700
commit3e371a3de358d00579ae8bde2c459c48f6752529 (patch)
tree250f655cda2034cdd633e64a20c485d3e8f8edd8
parent67a67fa5f0e693ec7bc177ce149bd3e4ccad9894 (diff)
qcacmn: add htc_get_tx_queue_depth api
Wish to know the number of unsent packets in a given tx queue Change-Id: I73999de9aaadbb61eea13388e583e341e1d7855a CRs-Fixed: 2018893
-rw-r--r--htc/htc_api.h10
-rw-r--r--htc/htc_send.c8
2 files changed, 17 insertions, 1 deletions
diff --git a/htc/htc_api.h b/htc/htc_api.h
index dac72bc3001b..3a517e3c9325 100644
--- a/htc/htc_api.h
+++ b/htc/htc_api.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2014, 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, 2016-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -688,6 +688,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 543fb3aad054..f50073b045fc 100644
--- a/htc/htc_send.c
+++ b/htc/htc_send.c
@@ -97,6 +97,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);