Lines Matching refs:pipe

36 ath10k_usb_alloc_urb_from_pipe(struct ath10k_usb_pipe *pipe)  in ath10k_usb_alloc_urb_from_pipe()  argument
42 if (!pipe->ar_usb) in ath10k_usb_alloc_urb_from_pipe()
45 spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags); in ath10k_usb_alloc_urb_from_pipe()
46 if (!list_empty(&pipe->urb_list_head)) { in ath10k_usb_alloc_urb_from_pipe()
47 urb_context = list_first_entry(&pipe->urb_list_head, in ath10k_usb_alloc_urb_from_pipe()
50 pipe->urb_cnt--; in ath10k_usb_alloc_urb_from_pipe()
52 spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags); in ath10k_usb_alloc_urb_from_pipe()
57 static void ath10k_usb_free_urb_to_pipe(struct ath10k_usb_pipe *pipe, in ath10k_usb_free_urb_to_pipe() argument
63 if (!pipe->ar_usb) in ath10k_usb_free_urb_to_pipe()
66 spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags); in ath10k_usb_free_urb_to_pipe()
68 pipe->urb_cnt++; in ath10k_usb_free_urb_to_pipe()
69 list_add(&urb_context->link, &pipe->urb_list_head); in ath10k_usb_free_urb_to_pipe()
71 spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags); in ath10k_usb_free_urb_to_pipe()
79 ath10k_usb_free_urb_to_pipe(urb_context->pipe, urb_context); in ath10k_usb_cleanup_recv_urb()
83 struct ath10k_usb_pipe *pipe) in ath10k_usb_free_pipe_resources() argument
87 if (!pipe->ar_usb) { in ath10k_usb_free_pipe_resources()
94 pipe->logical_pipe_num, pipe->usb_pipe_handle, in ath10k_usb_free_pipe_resources()
95 pipe->urb_alloc, pipe->urb_cnt); in ath10k_usb_free_pipe_resources()
97 if (pipe->urb_alloc != pipe->urb_cnt) { in ath10k_usb_free_pipe_resources()
100 pipe->logical_pipe_num, pipe->usb_pipe_handle, in ath10k_usb_free_pipe_resources()
101 pipe->urb_alloc, pipe->urb_cnt); in ath10k_usb_free_pipe_resources()
105 urb_context = ath10k_usb_alloc_urb_from_pipe(pipe); in ath10k_usb_free_pipe_resources()
128 struct ath10k_usb_pipe *pipe = urb_context->pipe; in ath10k_usb_recv_complete() local
129 struct ath10k *ar = pipe->ar_usb->ar; in ath10k_usb_recv_complete()
135 pipe->logical_pipe_num, urb->status, urb->actual_length, in ath10k_usb_recv_complete()
152 pipe->logical_pipe_num, in ath10k_usb_recv_complete()
153 pipe->ep_address, urb->status); in ath10k_usb_recv_complete()
169 skb_queue_tail(&pipe->io_comp_queue, skb); in ath10k_usb_recv_complete()
170 schedule_work(&pipe->io_complete_work); in ath10k_usb_recv_complete()
176 pipe->urb_cnt >= pipe->urb_cnt_thresh) { in ath10k_usb_recv_complete()
178 ath10k_usb_post_recv_transfers(ar, pipe); in ath10k_usb_recv_complete()
185 struct ath10k_usb_pipe *pipe = urb_context->pipe; in ath10k_usb_transmit_complete() local
186 struct ath10k *ar = pipe->ar_usb->ar; in ath10k_usb_transmit_complete()
192 pipe->logical_pipe_num, urb->status); in ath10k_usb_transmit_complete()
197 ath10k_usb_free_urb_to_pipe(urb_context->pipe, urb_context); in ath10k_usb_transmit_complete()
200 skb_queue_tail(&pipe->io_comp_queue, skb); in ath10k_usb_transmit_complete()
201 schedule_work(&pipe->io_complete_work); in ath10k_usb_transmit_complete()
356 struct ath10k_usb_pipe *pipe = container_of(work, in ath10k_usb_io_comp_work() local
359 struct ath10k *ar = pipe->ar_usb->ar; in ath10k_usb_io_comp_work()
362 while ((skb = skb_dequeue(&pipe->io_comp_queue))) { in ath10k_usb_io_comp_work()
363 if (pipe->flags & ATH10K_USB_PIPE_FLAG_TX) in ath10k_usb_io_comp_work()
406 struct ath10k_usb_pipe *pipe = &ar_usb->pipes[pipe_id]; in ath10k_usb_hif_tx_sg() local
413 urb_context = ath10k_usb_alloc_urb_from_pipe(pipe); in ath10k_usb_hif_tx_sg()
430 pipe->usb_pipe_handle, in ath10k_usb_hif_tx_sg()
435 if (!(skb->len % pipe->max_packet_size)) { in ath10k_usb_hif_tx_sg()
440 usb_anchor_urb(urb, &pipe->urb_submitted); in ath10k_usb_hif_tx_sg()
457 ath10k_usb_free_urb_to_pipe(urb_context->pipe, urb_context); in ath10k_usb_hif_tx_sg()
784 struct ath10k_usb_pipe *pipe, in ath10k_usb_alloc_pipe_resources() argument
790 INIT_LIST_HEAD(&pipe->urb_list_head); in ath10k_usb_alloc_pipe_resources()
791 init_usb_anchor(&pipe->urb_submitted); in ath10k_usb_alloc_pipe_resources()
798 urb_context->pipe = pipe; in ath10k_usb_alloc_pipe_resources()
803 pipe->urb_alloc++; in ath10k_usb_alloc_pipe_resources()
804 ath10k_usb_free_urb_to_pipe(pipe, urb_context); in ath10k_usb_alloc_pipe_resources()
809 pipe->logical_pipe_num, pipe->usb_pipe_handle, in ath10k_usb_alloc_pipe_resources()
810 pipe->urb_alloc); in ath10k_usb_alloc_pipe_resources()
821 struct ath10k_usb_pipe *pipe; in ath10k_usb_setup_pipe_resources() local
869 pipe = &ar_usb->pipes[pipe_num]; in ath10k_usb_setup_pipe_resources()
870 if (pipe->ar_usb) in ath10k_usb_setup_pipe_resources()
874 pipe->ar_usb = ar_usb; in ath10k_usb_setup_pipe_resources()
875 pipe->logical_pipe_num = pipe_num; in ath10k_usb_setup_pipe_resources()
876 pipe->ep_address = endpoint->bEndpointAddress; in ath10k_usb_setup_pipe_resources()
877 pipe->max_packet_size = le16_to_cpu(endpoint->wMaxPacketSize); in ath10k_usb_setup_pipe_resources()
880 if (ATH10K_USB_IS_DIR_IN(pipe->ep_address)) { in ath10k_usb_setup_pipe_resources()
881 pipe->usb_pipe_handle = in ath10k_usb_setup_pipe_resources()
883 pipe->ep_address); in ath10k_usb_setup_pipe_resources()
885 pipe->usb_pipe_handle = in ath10k_usb_setup_pipe_resources()
887 pipe->ep_address); in ath10k_usb_setup_pipe_resources()
890 if (ATH10K_USB_IS_DIR_IN(pipe->ep_address)) { in ath10k_usb_setup_pipe_resources()
891 pipe->usb_pipe_handle = in ath10k_usb_setup_pipe_resources()
893 pipe->ep_address); in ath10k_usb_setup_pipe_resources()
895 pipe->usb_pipe_handle = in ath10k_usb_setup_pipe_resources()
897 pipe->ep_address); in ath10k_usb_setup_pipe_resources()
901 if (ATH10K_USB_IS_DIR_IN(pipe->ep_address)) { in ath10k_usb_setup_pipe_resources()
902 pipe->usb_pipe_handle = in ath10k_usb_setup_pipe_resources()
904 pipe->ep_address); in ath10k_usb_setup_pipe_resources()
906 pipe->usb_pipe_handle = in ath10k_usb_setup_pipe_resources()
908 pipe->ep_address); in ath10k_usb_setup_pipe_resources()
912 pipe->ep_desc = endpoint; in ath10k_usb_setup_pipe_resources()
914 if (!ATH10K_USB_IS_DIR_IN(pipe->ep_address)) in ath10k_usb_setup_pipe_resources()
915 pipe->flags |= ATH10K_USB_PIPE_FLAG_TX; in ath10k_usb_setup_pipe_resources()
917 ret = ath10k_usb_alloc_pipe_resources(ar, pipe, urbcount); in ath10k_usb_setup_pipe_resources()
930 struct ath10k_usb_pipe *pipe; in ath10k_usb_create() local
939 pipe = &ar_usb->pipes[i]; in ath10k_usb_create()
940 INIT_WORK(&pipe->io_complete_work, in ath10k_usb_create()
942 skb_queue_head_init(&pipe->io_comp_queue); in ath10k_usb_create()