Lines Matching refs:packet

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