Lines Matching full:packet

25 			      struct htc_packet *packet);
29 static inline void restore_tx_packet(struct htc_packet *packet) in restore_tx_packet() argument
31 if (packet->info.tx.flags & HTC_FLAGS_TX_FIXUP_NETBUF) { in restore_tx_packet()
32 skb_pull(packet->skb, sizeof(struct htc_frame_hdr)); in restore_tx_packet()
33 packet->info.tx.flags &= ~HTC_FLAGS_TX_FIXUP_NETBUF; in restore_tx_packet()
40 struct htc_packet *packet; in do_send_completion() local
65 packet = list_first_entry(queue_to_indicate, in do_send_completion()
68 list_del(&packet->list); in do_send_completion()
70 "%s: calling ep %d send complete callback on packet 0x%p\n", in do_send_completion()
71 __func__, ep->eid, packet); in do_send_completion()
72 ep->ep_cb.tx_complete(ep->target, packet); in do_send_completion()
78 struct htc_packet *packet) in send_packet_completion() argument
80 struct htc_endpoint *ep = &target->endpoint[packet->endpoint]; in send_packet_completion()
83 restore_tx_packet(packet); in send_packet_completion()
85 list_add_tail(&packet->list, &container); in send_packet_completion()
98 struct htc_packet *packet; in get_htc_packet_credit_based() local
109 /* get packet at head, but don't remove it */ in get_htc_packet_credit_based()
110 packet = list_first_entry(&ep->txq, struct htc_packet, list); in get_htc_packet_credit_based()
113 "%s: got head packet:0x%p , queue depth: %d\n", in get_htc_packet_credit_based()
114 __func__, packet, get_queue_depth(&ep->txq)); in get_htc_packet_credit_based()
116 transfer_len = packet->act_len + HTC_HDR_LENGTH; in get_htc_packet_credit_based()
159 packet = list_first_entry(&ep->txq, struct htc_packet, list); in get_htc_packet_credit_based()
161 list_del(&packet->list); in get_htc_packet_credit_based()
162 /* save the number of credits this packet consumed */ in get_htc_packet_credit_based()
163 packet->info.tx.cred_used = credits_required; in get_htc_packet_credit_based()
165 packet->info.tx.flags = send_flags; in get_htc_packet_credit_based()
166 packet->info.tx.seqno = ep->seqno; in get_htc_packet_credit_based()
168 /* queue this packet into the caller's queue */ in get_htc_packet_credit_based()
169 list_add_tail(&packet->list, queue); in get_htc_packet_credit_based()
177 struct htc_packet *packet; in get_htc_packet() local
186 packet = list_first_entry(&ep->txq, struct htc_packet, list); in get_htc_packet()
187 list_del(&packet->list); in get_htc_packet()
190 "%s: got packet:0x%p , new queue depth: %d\n", in get_htc_packet()
191 __func__, packet, get_queue_depth(&ep->txq)); in get_htc_packet()
192 packet->info.tx.seqno = ep->seqno; in get_htc_packet()
193 packet->info.tx.flags = 0; in get_htc_packet()
194 packet->info.tx.cred_used = 0; in get_htc_packet()
197 /* queue this packet into the caller's queue */ in get_htc_packet()
198 list_add_tail(&packet->list, queue); in get_htc_packet()
211 struct htc_packet *packet; in htc_issue_packets() local
218 packet = list_first_entry(pkt_queue, struct htc_packet, list); in htc_issue_packets()
219 list_del(&packet->list); in htc_issue_packets()
221 skb = packet->skb; in htc_issue_packets()
228 payload_len = packet->act_len; in htc_issue_packets()
238 packet->info.tx.flags |= HTC_FLAGS_TX_FIXUP_NETBUF; in htc_issue_packets()
241 htc_hdr->flags = packet->info.tx.flags; in htc_issue_packets()
242 htc_hdr->eid = (u8) packet->endpoint; in htc_issue_packets()
244 htc_hdr->ctrl[1] = (u8) packet->info.tx.seqno; in htc_issue_packets()
249 list_add_tail(&packet->list, &ep->pipe.tx_lookup_queue); in htc_issue_packets()
268 list_del(&packet->list); in htc_issue_packets()
271 ep->cred_dist.credits += packet->info.tx.cred_used; in htc_issue_packets()
275 list_add(&packet->list, pkt_queue); in htc_issue_packets()
285 __func__, packet, status); in htc_issue_packets()
288 packet = list_first_entry(pkt_queue, in htc_issue_packets()
290 list_del(&packet->list); in htc_issue_packets()
291 packet->status = status; in htc_issue_packets()
292 send_packet_completion(target, packet); in htc_issue_packets()
304 struct htc_packet *packet, *tmp_pkt; in htc_try_send() local
369 packet = list_first_entry(txq, in htc_try_send()
373 list_move_tail(&packet->list, &send_queue); in htc_try_send()
381 list_for_each_entry_safe(packet, tmp_pkt, in htc_try_send()
385 __func__, packet); in htc_try_send()
386 action = ep->ep_cb.tx_full(ep->target, packet); in htc_try_send()
388 /* callback wants the packet dropped */ in htc_try_send()
394 /* callback wants to keep this packet, in htc_try_send()
397 list_move_tail(&packet->list, in htc_try_send()
499 /* htc control packet manipulation */
500 static void destroy_htc_txctrl_packet(struct htc_packet *packet) in destroy_htc_txctrl_packet() argument
503 skb = packet->skb; in destroy_htc_txctrl_packet()
505 kfree(packet); in destroy_htc_txctrl_packet()
510 struct htc_packet *packet = NULL; in build_htc_txctrl_packet() local
513 packet = kzalloc(sizeof(struct htc_packet), GFP_KERNEL); in build_htc_txctrl_packet()
514 if (packet == NULL) in build_htc_txctrl_packet()
520 kfree(packet); in build_htc_txctrl_packet()
523 packet->skb = skb; in build_htc_txctrl_packet()
525 return packet; in build_htc_txctrl_packet()
529 struct htc_packet *packet) in htc_free_txctrl_packet() argument
531 destroy_htc_txctrl_packet(packet); in htc_free_txctrl_packet()
540 struct htc_packet *packet) in htc_txctrl_complete() argument
542 htc_free_txctrl_packet(target, packet); in htc_txctrl_complete()
693 struct htc_packet *packet; in htc_flush_tx_endpoint() local
697 packet = list_first_entry(&ep->txq, struct htc_packet, list); in htc_flush_tx_endpoint()
698 list_del(&packet->list); in htc_flush_tx_endpoint()
699 packet->status = 0; in htc_flush_tx_endpoint()
700 send_packet_completion(target, packet); in htc_flush_tx_endpoint()
708 * skb and lookup it's corresponding HTC packet buffer from a lookup list.
716 struct htc_packet *packet, *tmp_pkt, *found_packet = NULL; in htc_lookup_tx_packet() local
723 * so the completed packet should be at the head of the list generally in htc_lookup_tx_packet()
725 list_for_each_entry_safe(packet, tmp_pkt, &ep->pipe.tx_lookup_queue, in htc_lookup_tx_packet()
728 if (skb == packet->skb) { in htc_lookup_tx_packet()
730 list_del(&packet->list); in htc_lookup_tx_packet()
731 found_packet = packet; in htc_lookup_tx_packet()
746 struct htc_packet *packet; in ath6kl_htc_pipe_tx_complete() local
756 packet = htc_lookup_tx_packet(target, ep, skb); in ath6kl_htc_pipe_tx_complete()
757 if (packet == NULL) { in ath6kl_htc_pipe_tx_complete()
762 packet->status = 0; in ath6kl_htc_pipe_tx_complete()
763 send_packet_completion(target, packet); in ath6kl_htc_pipe_tx_complete()
771 * non-TX credit case, we recheck after the packet completes in ath6kl_htc_pipe_tx_complete()
783 struct htc_packet *packet, *tmp_pkt; in htc_send_packets_multiple() local
788 /* get first packet to find out which ep the packets will go into */ in htc_send_packets_multiple()
789 packet = list_first_entry(pkt_queue, struct htc_packet, list); in htc_send_packets_multiple()
791 if (packet->endpoint >= ENDPOINT_MAX) { in htc_send_packets_multiple()
795 ep = &target->endpoint[packet->endpoint]; in htc_send_packets_multiple()
801 list_for_each_entry_safe(packet, tmp_pkt, pkt_queue, list) { in htc_send_packets_multiple()
802 packet->status = -ENOMEM; in htc_send_packets_multiple()
814 struct htc_packet *packet; in alloc_htc_packet_container() local
822 packet = target->pipe.htc_packet_pool; in alloc_htc_packet_container()
823 target->pipe.htc_packet_pool = (struct htc_packet *) packet->list.next; in alloc_htc_packet_container()
827 packet->list.next = NULL; in alloc_htc_packet_container()
828 return packet; in alloc_htc_packet_container()
832 struct htc_packet *packet) in free_htc_packet_container() argument
839 target->pipe.htc_packet_pool = packet; in free_htc_packet_container()
840 packet->list.next = NULL; in free_htc_packet_container()
843 packet->list.next = lh; in free_htc_packet_container()
844 target->pipe.htc_packet_pool = packet; in free_htc_packet_container()
911 struct htc_packet *packet; in do_recv_completion() local
920 packet = list_first_entry(queue_to_indicate, in do_recv_completion()
922 list_del(&packet->list); in do_recv_completion()
923 ep->ep_cb.rx(ep->target, packet); in do_recv_completion()
931 struct htc_packet *packet) in recv_packet_completion() argument
935 list_add_tail(&packet->list, &container); in recv_packet_completion()
948 struct htc_packet *packet; in ath6kl_htc_pipe_rx_complete() local
1018 /* zero length packet with trailer, just drop these */ in ath6kl_htc_pipe_rx_complete()
1062 packet = alloc_htc_packet_container(target); in ath6kl_htc_pipe_rx_complete()
1063 if (packet == NULL) { in ath6kl_htc_pipe_rx_complete()
1068 packet->status = 0; in ath6kl_htc_pipe_rx_complete()
1069 packet->endpoint = htc_hdr->eid; in ath6kl_htc_pipe_rx_complete()
1070 packet->pkt_cntxt = skb; in ath6kl_htc_pipe_rx_complete()
1073 packet->buf = skb_push(skb, 0) + HTC_HDR_LENGTH; in ath6kl_htc_pipe_rx_complete()
1074 packet->act_len = netlen - HTC_HDR_LENGTH - trailerlen; in ath6kl_htc_pipe_rx_complete()
1082 recv_packet_completion(target, ep, packet); in ath6kl_htc_pipe_rx_complete()
1084 /* recover the packet container */ in ath6kl_htc_pipe_rx_complete()
1085 free_htc_packet_container(target, packet); in ath6kl_htc_pipe_rx_complete()
1098 struct htc_packet *packet; in htc_flush_rx_queue() local
1106 packet = list_first_entry(&ep->rx_bufq, in htc_flush_rx_queue()
1108 list_del(&packet->list); in htc_flush_rx_queue()
1111 packet->status = -ECANCELED; in htc_flush_rx_queue()
1112 packet->act_len = 0; in htc_flush_rx_queue()
1115 "Flushing RX packet:0x%p, length:%d, ep:%d\n", in htc_flush_rx_queue()
1116 packet, packet->buf_len, in htc_flush_rx_queue()
1117 packet->endpoint); in htc_flush_rx_queue()
1120 list_add_tail(&packet->list, &container); in htc_flush_rx_queue()
1122 /* give the packet back */ in htc_flush_rx_queue()
1130 /* polling routine to wait for a control packet to be received */
1160 struct htc_packet *packet) in htc_rxctrl_complete() argument
1162 struct sk_buff *skb = packet->skb; in htc_rxctrl_complete()
1164 if (packet->endpoint == ENDPOINT_0 && in htc_rxctrl_complete()
1165 packet->status == -ECANCELED && in htc_rxctrl_complete()
1222 struct htc_packet *packet = NULL; in ath6kl_htc_pipe_conn_service() local
1253 /* allocate a packet to send to the target */ in ath6kl_htc_pipe_conn_service()
1254 packet = htc_alloc_txctrl_packet(target); in ath6kl_htc_pipe_conn_service()
1256 if (packet == NULL) { in ath6kl_htc_pipe_conn_service()
1262 skb = packet->skb; in ath6kl_htc_pipe_conn_service()
1289 set_htc_pkt_info(packet, NULL, (u8 *) conn_msg, in ath6kl_htc_pipe_conn_service()
1293 status = ath6kl_htc_pipe_tx(target, packet); in ath6kl_htc_pipe_conn_service()
1296 packet = NULL; in ath6kl_htc_pipe_conn_service()
1398 if (packet != NULL) in ath6kl_htc_pipe_conn_service()
1399 htc_free_txctrl_packet(target, packet); in ath6kl_htc_pipe_conn_service()
1409 struct htc_packet *packet; in ath6kl_htc_pipe_create() local
1426 packet = kzalloc(sizeof(struct htc_packet), GFP_KERNEL); in ath6kl_htc_pipe_create()
1428 if (packet != NULL) in ath6kl_htc_pipe_create()
1429 free_htc_packet_container(target, packet); in ath6kl_htc_pipe_create()
1462 struct htc_packet *packet; in ath6kl_htc_pipe_cleanup() local
1465 packet = alloc_htc_packet_container(target); in ath6kl_htc_pipe_cleanup()
1466 if (packet == NULL) in ath6kl_htc_pipe_cleanup()
1468 kfree(packet); in ath6kl_htc_pipe_cleanup()
1481 struct htc_packet *packet; in ath6kl_htc_pipe_start() local
1486 packet = htc_alloc_txctrl_packet(target); in ath6kl_htc_pipe_start()
1487 if (packet == NULL) { in ath6kl_htc_pipe_start()
1492 skb = packet->skb; in ath6kl_htc_pipe_start()
1501 set_htc_pkt_info(packet, NULL, (u8 *) setup, in ath6kl_htc_pipe_start()
1507 return ath6kl_htc_pipe_tx(target, packet); in ath6kl_htc_pipe_start()
1539 struct htc_packet *packet) in ath6kl_htc_pipe_tx() argument
1545 __func__, packet->endpoint, packet->buf, in ath6kl_htc_pipe_tx()
1546 packet->act_len); in ath6kl_htc_pipe_tx()
1549 list_add_tail(&packet->list, &queue); in ath6kl_htc_pipe_tx()
1624 struct htc_packet *packet, *tmp_pkt, *first; in ath6kl_htc_pipe_add_rxbuf_multiple() local
1653 list_for_each_entry_safe(packet, tmp_pkt, pkt_queue, list) { in ath6kl_htc_pipe_add_rxbuf_multiple()
1654 packet->status = -ECANCELED; in ath6kl_htc_pipe_add_rxbuf_multiple()
1673 struct htc_packet *packet, *tmp_pkt; in ath6kl_htc_pipe_flush_rx_buf() local
1681 list_for_each_entry_safe(packet, tmp_pkt, in ath6kl_htc_pipe_flush_rx_buf()
1683 list_del(&packet->list); in ath6kl_htc_pipe_flush_rx_buf()
1687 packet, packet->buf_len, in ath6kl_htc_pipe_flush_rx_buf()
1688 packet->endpoint); in ath6kl_htc_pipe_flush_rx_buf()
1689 dev_kfree_skb(packet->pkt_cntxt); in ath6kl_htc_pipe_flush_rx_buf()