diff --git a/htc/htc.c b/htc/htc.c index 63442bddef..ea3a210f2c 100644 --- a/htc/htc.c +++ b/htc/htc.c @@ -266,6 +266,7 @@ HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, qdf_device_t osdev, qdf_spinlock_create(&target->HTCRxLock); qdf_spinlock_create(&target->HTCTxLock); qdf_spinlock_create(&target->HTCCreditLock); + target->is_nodrop_pkt = false; do { qdf_mem_copy(&target->HTCInitInfo, pInfo, diff --git a/htc/htc_api.h b/htc/htc_api.h index 5adc278bf8..dac72bc300 100644 --- a/htc/htc_api.h +++ b/htc/htc_api.h @@ -637,6 +637,19 @@ A_STATUS htc_add_receive_pkt_multiple(HTC_HANDLE HTCHandle, bool htc_is_endpoint_active(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID Endpoint); +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + @desc: Set up nodrop pkt flag for mboxping nodrop pkt + @function name: htc_set_nodrop_pkt + @input: HTCHandle - HTC handle + isNodropPkt - indicates whether it is nodrop pkt + @output: + @return: + @notes: + @example: + @see also: + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +void htc_set_nodrop_pkt(HTC_HANDLE HTCHandle, A_BOOL isNodropPkt); + /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @desc: Get the number of recv buffers currently queued into an HTC endpoint @function name: htc_get_num_recv_buffers diff --git a/htc/htc_internal.h b/htc/htc_internal.h index ccabdb6990..596628cead 100644 --- a/htc/htc_internal.h +++ b/htc/htc_internal.h @@ -201,6 +201,12 @@ typedef struct _HTC_TARGET { #endif uint32_t con_mode; + + /* + * This flag is from the mboxping tool. It indicates that we cannot + * drop it. Besides, nodrop pkts have higher priority than normal pkts. + */ + A_BOOL is_nodrop_pkt; } HTC_TARGET; #if defined ENABLE_BUNDLE_TX diff --git a/htc/htc_send.c b/htc/htc_send.c index 10874c68b2..a71c04f774 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -1122,11 +1122,22 @@ static HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target, LOCK_HTC_TX(target); if (!HTC_QUEUE_EMPTY(&sendQueue)) { - /* transfer packets to tail */ - HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&pEndpoint->TxQueue, - &sendQueue); - A_ASSERT(HTC_QUEUE_EMPTY(&sendQueue)); - INIT_HTC_PACKET_QUEUE(&sendQueue); + if (target->is_nodrop_pkt) { + /* + * nodrop pkts have higher priority than normal pkts, + * insert nodrop pkt to head for proper + * start/termination of test. + */ + HTC_PACKET_QUEUE_TRANSFER_TO_HEAD(&pEndpoint->TxQueue, + &sendQueue); + target->is_nodrop_pkt = false; + } else { + /* transfer packets to tail */ + HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&pEndpoint->TxQueue, + &sendQueue); + A_ASSERT(HTC_QUEUE_EMPTY(&sendQueue)); + INIT_HTC_PACKET_QUEUE(&sendQueue); + } } /* increment tx processing count on entry */ @@ -2034,6 +2045,12 @@ bool htc_is_endpoint_active(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID Endpoint) return true; } +void htc_set_nodrop_pkt(HTC_HANDLE HTCHandle, A_BOOL isNodropPkt) +{ + HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); + target->is_nodrop_pkt = isNodropPkt; +} + /** * htc_process_credit_rpt() - process credit report, call distribution function * @target: pointer to HTC_TARGET