summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CORE/SERVICES/HTC/htc_send.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/CORE/SERVICES/HTC/htc_send.c b/CORE/SERVICES/HTC/htc_send.c
index 508e4f43d3ab..f416f6bdd95f 100644
--- a/CORE/SERVICES/HTC/htc_send.c
+++ b/CORE/SERVICES/HTC/htc_send.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -482,13 +482,18 @@ static void HTCIssuePacketsBundle(HTC_TARGET *target,
/* send out previous buffer */
HTCSendBundledNetbuf(target, pEndpoint,
pBundleBuffer - last_creditPad, pPacketTx);
- if (HTC_PACKET_QUEUE_DEPTH(pPktQueue) < HTC_MIN_MSG_PER_BUNDLE){
+ /* One packet has been dequeued from sending queue when enter
+ * this loop, so need to add 1 back for this checking.
+ */
+ if ((HTC_PACKET_QUEUE_DEPTH(pPktQueue) + 1) < HTC_MIN_MSG_PER_BUNDLE){
+ HTC_PACKET_ENQUEUE_TO_HEAD(pPktQueue, pPacket);
return;
}
bundlesSpaceRemaining = HTC_MAX_MSG_PER_BUNDLE_TX * pEndpoint->TxCreditSize;
pPacketTx = AllocateHTCBundleTxPacket(target);
if (!pPacketTx)
{
+ HTC_PACKET_ENQUEUE_TO_HEAD(pPktQueue, pPacket);
//good time to panic
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("AllocateHTCBundleTxPacket failed \n"));
AR_DEBUG_ASSERT(FALSE);