Lines Matching refs:pPacket

115 static inline void restore_tx_packet(HTC_TARGET *target, HTC_PACKET *pPacket)  in restore_tx_packet()  argument
117 qdf_nbuf_t netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket); in restore_tx_packet()
119 if (pPacket->PktInfo.AsTx.Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) { in restore_tx_packet()
121 pPacket->PktInfo.AsTx.Flags &= ~HTC_TX_PACKET_FLAG_FIXUP_NETBUF; in restore_tx_packet()
123 if (pPacket->PktInfo.AsTx.Flags & in restore_tx_packet()
126 pPacket->PktInfo.AsTx.Flags &= in restore_tx_packet()
131 static void send_packet_completion(HTC_TARGET *target, HTC_PACKET *pPacket) in send_packet_completion() argument
133 HTC_ENDPOINT *pEndpoint = &target->endpoint[pPacket->Endpoint]; in send_packet_completion()
136 if ((pPacket->PktInfo.AsTx.Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) && in send_packet_completion()
140 restore_tx_packet(target, pPacket); in send_packet_completion()
147 htc_free_control_tx_packet(target, pPacket); in send_packet_completion()
154 pEndpoint->Id, pPacket)); in send_packet_completion()
158 EpTxComplete(pEndpoint->EpCallBacks.pContext, pPacket); in send_packet_completion()
160 qdf_nbuf_free(pPacket->pPktContext); in send_packet_completion()
174 static void log_packet_info(HTC_TARGET *target, HTC_PACKET *pPacket) in log_packet_info() argument
176 HTC_ENDPOINT *pEndpoint = &target->endpoint[pPacket->Endpoint]; in log_packet_info()
178 qdf_nbuf_t netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket); in log_packet_info()
183 ep_log_pkt(pEndpoint->EpCallBacks.pContext, pPacket); in log_packet_info()
200 static void log_packet_info(HTC_TARGET *target, HTC_PACKET *pPacket) in log_packet_info() argument
219 HTC_PACKET *pPacket; in allocate_htc_bundle_packet() local
232 pPacket = qdf_mem_malloc(sizeof(HTC_PACKET)); in allocate_htc_bundle_packet()
233 AR_DEBUG_ASSERT(pPacket); in allocate_htc_bundle_packet()
234 if (!pPacket) { in allocate_htc_bundle_packet()
242 qdf_mem_free(pPacket); in allocate_htc_bundle_packet()
246 pPacket->pContext = pQueueSave; in allocate_htc_bundle_packet()
247 SET_HTC_PACKET_NET_BUF_CONTEXT(pPacket, netbuf); in allocate_htc_bundle_packet()
248 pPacket->pBuffer = qdf_nbuf_data(netbuf); in allocate_htc_bundle_packet()
249 pPacket->BufferLength = qdf_nbuf_len(netbuf); in allocate_htc_bundle_packet()
255 pPacket->netbufOrigHeadRoom = qdf_nbuf_headroom(netbuf); in allocate_htc_bundle_packet()
256 return pPacket; in allocate_htc_bundle_packet()
259 pPacket = target->pBundleFreeList; in allocate_htc_bundle_packet()
260 AR_DEBUG_ASSERT(pPacket); in allocate_htc_bundle_packet()
261 if (!pPacket) { in allocate_htc_bundle_packet()
265 target->pBundleFreeList = (HTC_PACKET *) pPacket->ListLink.pNext; in allocate_htc_bundle_packet()
267 pPacket->ListLink.pNext = NULL; in allocate_htc_bundle_packet()
269 return pPacket; in allocate_htc_bundle_packet()
272 void free_htc_bundle_packet(HTC_TARGET *target, HTC_PACKET *pPacket) in free_htc_bundle_packet() argument
278 netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket); in free_htc_bundle_packet()
294 pPacket->netbufOrigHeadRoom - curentHeadRoom); in free_htc_bundle_packet()
298 pPacket->pBuffer = qdf_nbuf_data(netbuf); in free_htc_bundle_packet()
299 pPacket->BufferLength = qdf_nbuf_len(netbuf); in free_htc_bundle_packet()
302 pQueueSave = (HTC_PACKET_QUEUE *) pPacket->pContext; in free_htc_bundle_packet()
313 target->pBundleFreeList = pPacket; in free_htc_bundle_packet()
314 pPacket->ListLink.pNext = NULL; in free_htc_bundle_packet()
316 pPacket->ListLink.pNext = (DL_LIST *) target->pBundleFreeList; in free_htc_bundle_packet()
317 target->pBundleFreeList = pPacket; in free_htc_bundle_packet()
555 HTC_PACKET *pPacket = NULL, *pPacketTx = NULL; in htc_issue_packets_bundle() local
582 pPacket = htc_packet_dequeue(pPktQueue); in htc_issue_packets_bundle()
583 if (!pPacket) in htc_issue_packets_bundle()
586 transferLength = pPacket->ActualLength + HTC_HDR_LENGTH; in htc_issue_packets_bundle()
614 HTC_PACKET_ENQUEUE_TO_HEAD(pPktQueue, pPacket); in htc_issue_packets_bundle()
622 HTC_PACKET_ENQUEUE_TO_HEAD(pPktQueue, pPacket); in htc_issue_packets_bundle()
634 p_last_htc_pkt = pPacket; in htc_issue_packets_bundle()
638 netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket); in htc_issue_packets_bundle()
644 SM(pPacket->ActualLength, in htc_issue_packets_bundle()
646 SM(pPacket->PktInfo.AsTx.SendFlags | in htc_issue_packets_bundle()
649 SM(pPacket->Endpoint, in htc_issue_packets_bundle()
652 SM(pPacket->PktInfo.AsTx.SeqNo, in htc_issue_packets_bundle()
658 nbytes = pPacket->ActualLength + HTC_HDR_LENGTH; in htc_issue_packets_bundle()
669 HTC_PACKET_ENQUEUE(pQueueSave, pPacket); in htc_issue_packets_bundle()
733 HTC_PACKET *pPacket = NULL; in htc_issue_packets() local
789 pPacket = htc_packet_dequeue(pPktQueue); in htc_issue_packets()
790 if (!pPacket) { in htc_issue_packets()
795 netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket); in htc_issue_packets()
802 payloadLen = pPacket->ActualLength; in htc_issue_packets()
819 SM(pPacket->PktInfo.AsTx.SendFlags, in htc_issue_packets()
821 SM(pPacket->Endpoint, in htc_issue_packets()
824 SM(pPacket->PktInfo.AsTx.SeqNo, in htc_issue_packets()
834 GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket), in htc_issue_packets()
840 HTC_PACKET_ENQUEUE_TO_HEAD(pPktQueue, pPacket); in htc_issue_packets()
844 pPacket->PktInfo.AsTx.Flags |= in htc_issue_packets()
852 HTC_PACKET_ENQUEUE(&pEndpoint->TxLookupQueue, pPacket); in htc_issue_packets()
861 if (pPacket->PktInfo.AsTx.Tag == HTC_TX_PACKET_SYSTEM_SUSPEND) { in htc_issue_packets()
866 htc_packet_set_magic_cookie(pPacket, HTC_PACKET_MAGIC_COOKIE); in htc_issue_packets()
872 if (pPacket->PktInfo.AsTx.Tag == HTC_TX_PACKET_TAG_RUNTIME_PUT) { in htc_issue_packets()
874 } else if (pPacket->PktInfo.AsTx.Tag == in htc_issue_packets()
884 HTC_HDR_LENGTH + pPacket->ActualLength); in htc_issue_packets()
888 htc_handle_extra_tx_credit(pEndpoint, pPacket, buf, in htc_issue_packets()
889 NULL, pPacket->ActualLength + in htc_issue_packets()
894 HTC_HDR_LENGTH + pPacket->ActualLength, in htc_issue_packets()
901 if (pPacket->PktInfo.AsTx.Tag == in htc_issue_packets()
941 GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket), in htc_issue_packets()
943 pPacket->PktInfo.AsTx.Flags &= in htc_issue_packets()
953 HTC_PACKET_REMOVE(&pEndpoint->TxLookupQueue, pPacket); in htc_issue_packets()
954 htc_packet_set_magic_cookie(pPacket, 0); in htc_issue_packets()
956 HTC_PACKET_ENQUEUE_TO_HEAD(pPktQueue, pPacket); in htc_issue_packets()
959 pPacket) { in htc_issue_packets()
961 pPacket->PktInfo.AsTx.CreditsUsed; in htc_issue_packets()
980 pPacket, status, pEndpoint->Id); in htc_issue_packets()
1164 HTC_PACKET *pPacket; in get_htc_send_packets_credit_based() local
1208 pPacket = htc_get_pkt_at_head(tx_queue); in get_htc_send_packets_credit_based()
1209 if (!pPacket || in get_htc_send_packets_credit_based()
1210 (pPacket->Endpoint >= ENDPOINT_MAX) || in get_htc_send_packets_credit_based()
1211 (pPacket->Endpoint <= ENDPOINT_UNUSED)) in get_htc_send_packets_credit_based()
1213 log_packet_info(target, pPacket); in get_htc_send_packets_credit_based()
1221 pPacket = htc_get_pkt_at_head(tx_queue); in get_htc_send_packets_credit_based()
1222 if (!pPacket) { in get_htc_send_packets_credit_based()
1241 pPacket, in get_htc_send_packets_credit_based()
1244 transferLength = pPacket->ActualLength + HTC_HDR_LENGTH; in get_htc_send_packets_credit_based()
1317 pPacket = htc_packet_dequeue(tx_queue); in get_htc_send_packets_credit_based()
1318 if (pPacket) { in get_htc_send_packets_credit_based()
1320 pPacket->PktInfo.AsTx.CreditsUsed = creditsRequired; in get_htc_send_packets_credit_based()
1322 pPacket->PktInfo.AsTx.SendFlags = sendFlags; in get_htc_send_packets_credit_based()
1325 HTC_PACKET_ENQUEUE(pQueue, pPacket); in get_htc_send_packets_credit_based()
1342 HTC_PACKET *pPacket; in get_htc_send_packets() local
1374 pPacket = htc_get_pkt_at_head(tx_queue); in get_htc_send_packets()
1375 if (!pPacket || in get_htc_send_packets()
1376 (pPacket->Endpoint >= ENDPOINT_MAX) || in get_htc_send_packets()
1377 (pPacket->Endpoint <= ENDPOINT_UNUSED)) in get_htc_send_packets()
1379 log_packet_info(target, pPacket); in get_htc_send_packets()
1395 pPacket = htc_packet_dequeue(tx_queue); in get_htc_send_packets()
1396 if (!pPacket) { in get_htc_send_packets()
1406 pPacket, in get_htc_send_packets()
1411 pPacket->PktInfo.AsTx.SendFlags = 0; in get_htc_send_packets()
1412 pPacket->PktInfo.AsTx.CreditsUsed = 0; in get_htc_send_packets()
1414 HTC_PACKET_ENQUEUE(pQueue, pPacket); in get_htc_send_packets()
1427 (pPacket->PktInfo.AsTx. in get_htc_send_packets()
1430 (pPacket)); in get_htc_send_packets()
1456 HTC_PACKET *pPacket; in htc_try_send() local
1529 pPacket = htc_packet_dequeue(pCallersSendQueue); in htc_try_send()
1530 A_ASSERT(pPacket); in htc_try_send()
1531 if (pPacket) in htc_try_send()
1534 pPacket); in htc_try_send()
1542 QueueHead, pPacket, in htc_try_send()
1547 pPacket)); in htc_try_send()
1555 (pPacket), in htc_try_send()
1557 pPacket->PktInfo.AsTx.Flags &= in htc_try_send()
1562 pPacket) == HTC_SEND_FULL_DROP) { in htc_try_send()
1574 pPacket); in htc_try_send()
1581 (pPacket), in htc_try_send()
1583 pPacket->PktInfo.AsTx.Flags |= in htc_try_send()
1586 HTC_PACKET_ENQUEUE(&sendQueue, pPacket); in htc_try_send()
1839 HTC_PACKET *pPacket; in htc_send_pkts_sched_queue() local
1853 pPacket = htc_packet_dequeue(pPktQueue); in htc_send_pkts_sched_queue()
1854 HTC_PACKET_ENQUEUE(pTxQueue, pPacket); in htc_send_pkts_sched_queue()
1863 ITERATE_OVER_LIST_ALLOW_REMOVE(&pPktQueue->QueueHead, pPacket, in htc_send_pkts_sched_queue()
1868 pPacket) == HTC_SEND_FULL_DROP) { in htc_send_pkts_sched_queue()
1871 HTC_PACKET_REMOVE(pPktQueue, pPacket); in htc_send_pkts_sched_queue()
1872 HTC_PACKET_ENQUEUE(pTxQueue, pPacket); in htc_send_pkts_sched_queue()
1886 HTC_PACKET *pPacket) in __htc_send_pkt() argument
1901 if (!pPacket) { in __htc_send_pkt()
1907 if ((pPacket->Endpoint >= ENDPOINT_MAX) || in __htc_send_pkt()
1908 (pPacket->Endpoint <= ENDPOINT_UNUSED)) { in __htc_send_pkt()
1914 pEndpoint = &target->endpoint[pPacket->Endpoint]; in __htc_send_pkt()
1929 netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket); in __htc_send_pkt()
1935 pPacket->PktInfo.AsTx.Flags |= in __htc_send_pkt()
1944 SM(pPacket->ActualLength, in __htc_send_pkt()
1946 SM(pPacket->Endpoint, in __htc_send_pkt()
1950 pPacket->PktInfo.AsTx.SeqNo = pEndpoint->SeqNo; in __htc_send_pkt()
1954 SM(pPacket->PktInfo.AsTx.SeqNo, in __htc_send_pkt()
1965 pPacket->PktInfo.AsTx.Flags |= HTC_TX_PACKET_FLAG_FIXUP_NETBUF; in __htc_send_pkt()
1967 GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket), in __htc_send_pkt()
1979 INIT_HTC_PACKET_QUEUE_AND_ADD(&pPktQueue, pPacket); in __htc_send_pkt()
1991 pPacket = htc_packet_dequeue(&pPktQueue); in __htc_send_pkt()
1994 pPacket->Status = QDF_STATUS_E_CANCELED; in __htc_send_pkt()
1996 pPacket->Status = QDF_STATUS_E_RESOURCES; in __htc_send_pkt()
1998 send_packet_completion(target, pPacket); in __htc_send_pkt()
2294 QDF_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket, in htc_send_data_pkt() argument
2307 if (pPacket) { in htc_send_data_pkt()
2308 if ((pPacket->Endpoint >= ENDPOINT_MAX) || in htc_send_data_pkt()
2309 (pPacket->Endpoint <= ENDPOINT_UNUSED)) { in htc_send_data_pkt()
2315 pEndpoint = &target->endpoint[pPacket->Endpoint]; in htc_send_data_pkt()
2318 netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket); in htc_send_data_pkt()
2323 SM(pPacket->ActualLength, in htc_send_data_pkt()
2325 SM(pPacket->PktInfo.AsTx.SendFlags, in htc_send_data_pkt()
2327 SM(pPacket->Endpoint, in htc_send_data_pkt()
2352 pPacket->PktInfo.AsTx.SeqNo = pEndpoint->SeqNo; in htc_send_data_pkt()
2356 SM(pPacket->PktInfo.AsTx.SeqNo, in htc_send_data_pkt()
2360 HTC_PACKET_ENQUEUE(&pEndpoint->TxQueue, pPacket); in htc_send_data_pkt()
2480 pPacket = htc_packet_dequeue(&sendQueue); in htc_send_data_pkt()
2481 if (!pPacket) in htc_send_data_pkt()
2483 netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket); in htc_send_data_pkt()
2488 HTC_PACKET_ENQUEUE(&pEndpoint->TxLookupQueue, pPacket); in htc_send_data_pkt()
2494 htc_handle_extra_tx_credit(pEndpoint, pPacket, in htc_send_data_pkt()
2497 pPacket->ActualLength in htc_send_data_pkt()
2503 HTC_HDR_LENGTH + pPacket->ActualLength, in htc_send_data_pkt()
2518 HTC_HDR_LENGTH + pPacket->ActualLength); in htc_send_data_pkt()
2527 HTC_PACKET_REMOVE(&pEndpoint->TxLookupQueue, pPacket); in htc_send_data_pkt()
2542 HTC_PACKET_ENQUEUE_TO_HEAD(&sendQueue, pPacket); in htc_send_data_pkt()
2583 HTC_PACKET *pPacket = NULL; in htc_lookup_tx_packet() local
2595 pPacket = htc_packet_dequeue(&pEndpoint->TxLookupQueue); in htc_lookup_tx_packet()
2596 if (qdf_unlikely(!pPacket)) { in htc_lookup_tx_packet()
2601 if (netbuf == (qdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket)) { in htc_lookup_tx_packet()
2604 return pPacket; in htc_lookup_tx_packet()
2606 HTC_PACKET_ENQUEUE(&lookupQueue, pPacket); in htc_lookup_tx_packet()
2615 ITERATE_OVER_LIST_ALLOW_REMOVE(&lookupQueue.QueueHead, pPacket, in htc_lookup_tx_packet()
2618 if (!pPacket) { in htc_lookup_tx_packet()
2619 pFoundPacket = pPacket; in htc_lookup_tx_packet()
2624 (qdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket)) { in htc_lookup_tx_packet()
2626 HTC_PACKET_REMOVE(&lookupQueue, pPacket); in htc_lookup_tx_packet()
2627 pFoundPacket = pPacket; in htc_lookup_tx_packet()
2657 HTC_PACKET *pPacket; in htc_tx_completion_handler() local
2672 pPacket = htc_lookup_tx_packet(target, pEndpoint, netbuf); in htc_tx_completion_handler()
2673 if (!pPacket) { in htc_tx_completion_handler()
2679 if (pPacket->PktInfo.AsTx.Tag != HTC_TX_PACKET_TAG_AUTO_PM && in htc_tx_completion_handler()
2680 pPacket->PktInfo.AsTx.Tag != HTC_TX_PACKET_TAG_RUNTIME_PUT && in htc_tx_completion_handler()
2681 pPacket->PktInfo.AsTx.Tag != HTC_TX_PACKET_TAG_RTPM_PUT_RC) { in htc_tx_completion_handler()
2687 if (pPacket->PktInfo.AsTx.Tag == HTC_TX_PACKET_TAG_BUNDLED) { in htc_tx_completion_handler()
2690 (HTC_PACKET_QUEUE *) pPacket->pContext; in htc_tx_completion_handler()
2693 pPacket->Status = QDF_STATUS_SUCCESS; in htc_tx_completion_handler()
2697 free_htc_bundle_packet(target, pPacket); in htc_tx_completion_handler()
2709 pPacket->Status = QDF_STATUS_SUCCESS; in htc_tx_completion_handler()
2710 send_packet_completion(target, pPacket); in htc_tx_completion_handler()
2819 HTC_PACKET *pPacket; in htc_flush_endpoint_tx() local
2823 pPacket = htc_packet_dequeue(&pEndpoint->TxQueue); in htc_flush_endpoint_tx()
2825 if (pPacket) { in htc_flush_endpoint_tx()
2827 pPacket->Status = QDF_STATUS_E_CANCELED; in htc_flush_endpoint_tx()
2828 send_packet_completion(target, pPacket); in htc_flush_endpoint_tx()