diff --git a/htc/htc.c b/htc/htc.c index 201c81849580..17080cdd8812 100644 --- a/htc/htc.c +++ b/htc/htc.c @@ -187,6 +187,8 @@ static void htc_cleanup(HTC_TARGET *target) } #endif + htc_flush_endpoint_txlookupQ(target, ENDPOINT_0); + qdf_spinlock_destroy(&target->HTCLock); qdf_spinlock_destroy(&target->HTCRxLock); qdf_spinlock_destroy(&target->HTCTxLock); diff --git a/htc/htc_internal.h b/htc/htc_internal.h index 068777e2053d..cdd387a52994 100644 --- a/htc/htc_internal.h +++ b/htc/htc_internal.h @@ -296,6 +296,9 @@ void free_htc_packet_container(HTC_TARGET *target, HTC_PACKET *pPacket); void htc_flush_rx_hold_queue(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint); void htc_flush_endpoint_tx(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint, HTC_TX_TAG Tag); +void htc_flush_endpoint_txlookupQ(HTC_TARGET *target, + HTC_ENDPOINT_ID endpoint_id); + void htc_recv_init(HTC_TARGET *target); QDF_STATUS htc_wait_recv_ctrl_message(HTC_TARGET *target); void htc_free_control_tx_packet(HTC_TARGET *target, HTC_PACKET *pPacket); diff --git a/htc/htc_send.c b/htc/htc_send.c index 75d5f2f59a3f..c58b37c10995 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -2058,6 +2058,28 @@ void htc_flush_endpoint_tx(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint, UNLOCK_HTC_TX(target); } +/* flush pending entries in endpoint TX Lookup queue */ +void htc_flush_endpoint_txlookupQ(HTC_TARGET *target, + HTC_ENDPOINT_ID endpoint_id) +{ + HTC_PACKET *packet; + HTC_ENDPOINT *endpoint; + + endpoint = &target->endpoint[endpoint_id]; + + if (!endpoint && endpoint->service_id == 0) + return; + + while (HTC_PACKET_QUEUE_DEPTH(&endpoint->TxLookupQueue)) { + packet = htc_packet_dequeue(&endpoint->TxLookupQueue); + + if (packet) { + packet->Status = QDF_STATUS_E_CANCELED; + send_packet_completion(target, packet); + } + } +} + /* HTC API to flush an endpoint's TX queue*/ void htc_flush_endpoint(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID Endpoint, HTC_TX_TAG Tag)