diff options
| author | Houston Hoffman <hhoffman@codeaurora.org> | 2017-10-11 23:08:34 -0700 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2017-10-16 06:06:55 -0700 |
| commit | 9e2593229078f60b4ceecd04d9a1c28da816bfd6 (patch) | |
| tree | ba2a4d2429e45813344a4c35003b2c1b737c020a | |
| parent | 864d8272695dd3b8857ab9fa823724736956e7a4 (diff) | |
qcacmn: Remove local queue from send_packet_completion
Static analysiscomplained about the htc_pkt having a pointer
to the local queue when the function returned. Remove the
local queue so that it is not an issue.
Requires epping to support individual single completions.
Change-Id: I8f96420f5f6305c43051a21073607cdd6c603855
CRs-Fixed: 2125394
| -rw-r--r-- | htc/htc_send.c | 79 |
1 files changed, 19 insertions, 60 deletions
diff --git a/htc/htc_send.c b/htc/htc_send.c index 95c31ff99695..c2c60003a8f9 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -189,61 +189,25 @@ static inline void restore_tx_packet(HTC_TARGET *target, HTC_PACKET *pPacket) } -static void do_send_completion(HTC_ENDPOINT *pEndpoint, - HTC_PACKET_QUEUE *pQueueToIndicate) -{ - do { - - if (HTC_QUEUE_EMPTY(pQueueToIndicate)) { - /* nothing to indicate */ - break; - } - - if (pEndpoint->EpCallBacks.EpTxCompleteMultiple != NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, - ("HTC calling ep %d, send complete multiple callback (%d pkts)\n", - pEndpoint->Id, - HTC_PACKET_QUEUE_DEPTH - (pQueueToIndicate))); - /* a multiple send complete handler is being used, pass - * the queue to the handler - */ - pEndpoint->EpCallBacks.EpTxCompleteMultiple( - pEndpoint->EpCallBacks.pContext, - pQueueToIndicate); - /* all packets are now owned by the callback, reset - * queue to be safe - */ - INIT_HTC_PACKET_QUEUE(pQueueToIndicate); - } else { - HTC_PACKET *pPacket; - /* using legacy EpTxComplete */ - do { - pPacket = htc_packet_dequeue(pQueueToIndicate); - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, - ("HTC calling ep %d send complete callback on packet %pK\n", - pEndpoint->Id, pPacket)); - pEndpoint->EpCallBacks.EpTxComplete(pEndpoint-> - EpCallBacks. - pContext, - pPacket); - } while (!HTC_QUEUE_EMPTY(pQueueToIndicate)); - } - - } while (false); - -} - static void send_packet_completion(HTC_TARGET *target, HTC_PACKET *pPacket) { HTC_ENDPOINT *pEndpoint = &target->endpoint[pPacket->Endpoint]; - HTC_PACKET_QUEUE container; + HTC_EP_SEND_PKT_COMPLETE EpTxComplete; restore_tx_packet(target, pPacket); - INIT_HTC_PACKET_QUEUE_AND_ADD(&container, pPacket); /* do completion */ - do_send_completion(pEndpoint, &container); + AR_DEBUG_PRINTF(ATH_DEBUG_SEND, + ("HTC calling ep %d send complete callback on packet %pK\n", + pEndpoint->Id, pPacket)); + + EpTxComplete = pEndpoint->EpCallBacks.EpTxComplete; + if (EpTxComplete != NULL) + EpTxComplete(pEndpoint->EpCallBacks.pContext, pPacket); + else + qdf_nbuf_free(pPacket->pPktContext); + + } void htc_send_complete_check_cleanup(void *context) @@ -1512,20 +1476,15 @@ static inline QDF_STATUS __htc_send_pkt(HTC_HANDLE HTCHandle, #endif /* do completion on any packets that couldn't get in */ - if (!HTC_QUEUE_EMPTY(&pPktQueue)) { + while (!HTC_QUEUE_EMPTY(&pPktQueue)) { + pPacket = htc_packet_dequeue(&pPktQueue); - HTC_PACKET_QUEUE_ITERATE_ALLOW_REMOVE(&pPktQueue, pPacket) { - /* remove the headroom reserved for HTC_FRAME_HDR */ - restore_tx_packet(target, pPacket); - - if (HTC_STOPPING(target)) - pPacket->Status = QDF_STATUS_E_CANCELED; - else - pPacket->Status = QDF_STATUS_E_RESOURCES; - } - HTC_PACKET_QUEUE_ITERATE_END; + if (HTC_STOPPING(target)) + pPacket->Status = QDF_STATUS_E_CANCELED; + else + pPacket->Status = QDF_STATUS_E_RESOURCES; - do_send_completion(pEndpoint, &pPktQueue); + send_packet_completion(target, pPacket); } AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("-__htc_send_pkt\n")); |
