Lines Matching refs:pipe
34 /* pipe/urb operations */
36 ath10k_usb_alloc_urb_from_pipe(struct ath10k_usb_pipe *pipe)
41 /* bail if this pipe is not initialized */
42 if (!pipe->ar_usb)
45 spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags);
46 if (!list_empty(&pipe->urb_list_head)) {
47 urb_context = list_first_entry(&pipe->urb_list_head,
50 pipe->urb_cnt--;
52 spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags);
57 static void ath10k_usb_free_urb_to_pipe(struct ath10k_usb_pipe *pipe,
62 /* bail if this pipe is not initialized */
63 if (!pipe->ar_usb)
66 spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags);
68 pipe->urb_cnt++;
69 list_add(&urb_context->link, &pipe->urb_list_head);
71 spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags);
79 ath10k_usb_free_urb_to_pipe(urb_context->pipe, urb_context);
83 struct ath10k_usb_pipe *pipe)
87 if (!pipe->ar_usb) {
88 /* nothing allocated for this pipe */
94 pipe->logical_pipe_num, pipe->usb_pipe_handle,
95 pipe->urb_alloc, pipe->urb_cnt);
97 if (pipe->urb_alloc != pipe->urb_cnt) {
100 pipe->logical_pipe_num, pipe->usb_pipe_handle,
101 pipe->urb_alloc, pipe->urb_cnt);
105 urb_context = ath10k_usb_alloc_urb_from_pipe(pipe);
128 struct ath10k_usb_pipe *pipe = urb_context->pipe;
129 struct ath10k *ar = pipe->ar_usb->ar;
134 "usb recv pipe %d stat %d len %d urb 0x%pK\n",
135 pipe->logical_pipe_num, urb->status, urb->actual_length,
151 "usb recv pipe %d ep 0x%2.2x failed: %d\n",
152 pipe->logical_pipe_num,
153 pipe->ep_address, urb->status);
169 skb_queue_tail(&pipe->io_comp_queue, skb);
170 schedule_work(&pipe->io_complete_work);
176 pipe->urb_cnt >= pipe->urb_cnt_thresh) {
178 ath10k_usb_post_recv_transfers(ar, pipe);
185 struct ath10k_usb_pipe *pipe = urb_context->pipe;
186 struct ath10k *ar = pipe->ar_usb->ar;
191 "pipe: %d, failed:%d\n",
192 pipe->logical_pipe_num, urb->status);
197 ath10k_usb_free_urb_to_pipe(urb_context->pipe, urb_context);
200 skb_queue_tail(&pipe->io_comp_queue, skb);
201 schedule_work(&pipe->io_complete_work);
204 /* pipe operations */
362 struct ath10k_usb_pipe *pipe = container_of(work,
365 struct ath10k *ar = pipe->ar_usb->ar;
368 while ((skb = skb_dequeue(&pipe->io_comp_queue))) {
369 if (pipe->flags & ATH10K_USB_PIPE_FLAG_TX)
399 /* set the TX resource avail threshold for each TX pipe */
413 struct ath10k_usb_pipe *pipe = &ar_usb->pipes[pipe_id];
420 urb_context = ath10k_usb_alloc_urb_from_pipe(pipe);
437 pipe->usb_pipe_handle,
442 if (!(skb->len % pipe->max_packet_size)) {
443 /* hit a max packet boundary on this pipe */
447 usb_anchor_urb(urb, &pipe->urb_submitted);
464 ath10k_usb_free_urb_to_pipe(urb_context->pipe, urb_context);
687 /* due to large control packets, shift to data pipe */
792 struct ath10k_usb_pipe *pipe,
798 INIT_LIST_HEAD(&pipe->urb_list_head);
799 init_usb_anchor(&pipe->urb_submitted);
806 urb_context->pipe = pipe;
811 pipe->urb_alloc++;
812 ath10k_usb_free_urb_to_pipe(pipe, urb_context);
817 pipe->logical_pipe_num, pipe->usb_pipe_handle,
818 pipe->urb_alloc);
829 struct ath10k_usb_pipe *pipe;
877 pipe = &ar_usb->pipes[pipe_num];
878 if (pipe->ar_usb)
879 /* hmmm..pipe was already setup */
882 pipe->ar_usb = ar_usb;
883 pipe->logical_pipe_num = pipe_num;
884 pipe->ep_address = endpoint->bEndpointAddress;
885 pipe->max_packet_size = le16_to_cpu(endpoint->wMaxPacketSize);
888 if (ATH10K_USB_IS_DIR_IN(pipe->ep_address)) {
889 pipe->usb_pipe_handle =
891 pipe->ep_address);
893 pipe->usb_pipe_handle =
895 pipe->ep_address);
898 if (ATH10K_USB_IS_DIR_IN(pipe->ep_address)) {
899 pipe->usb_pipe_handle =
901 pipe->ep_address);
903 pipe->usb_pipe_handle =
905 pipe->ep_address);
909 if (ATH10K_USB_IS_DIR_IN(pipe->ep_address)) {
910 pipe->usb_pipe_handle =
912 pipe->ep_address);
914 pipe->usb_pipe_handle =
916 pipe->ep_address);
920 pipe->ep_desc = endpoint;
922 if (!ATH10K_USB_IS_DIR_IN(pipe->ep_address))
923 pipe->flags |= ATH10K_USB_PIPE_FLAG_TX;
925 ret = ath10k_usb_alloc_pipe_resources(ar, pipe, urbcount);
938 struct ath10k_usb_pipe *pipe;
947 pipe = &ar_usb->pipes[i];
948 INIT_WORK(&pipe->io_complete_work,
950 skb_queue_head_init(&pipe->io_comp_queue);