Lines Matching refs:pipe
79 struct ath6kl_usb_pipe *pipe; member
130 ath6kl_usb_alloc_urb_from_pipe(struct ath6kl_usb_pipe *pipe) in ath6kl_usb_alloc_urb_from_pipe() argument
136 if (!pipe->ar_usb) in ath6kl_usb_alloc_urb_from_pipe()
139 spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags); in ath6kl_usb_alloc_urb_from_pipe()
140 if (!list_empty(&pipe->urb_list_head)) { in ath6kl_usb_alloc_urb_from_pipe()
142 list_first_entry(&pipe->urb_list_head, in ath6kl_usb_alloc_urb_from_pipe()
145 pipe->urb_cnt--; in ath6kl_usb_alloc_urb_from_pipe()
147 spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags); in ath6kl_usb_alloc_urb_from_pipe()
152 static void ath6kl_usb_free_urb_to_pipe(struct ath6kl_usb_pipe *pipe, in ath6kl_usb_free_urb_to_pipe() argument
158 if (!pipe->ar_usb) in ath6kl_usb_free_urb_to_pipe()
161 spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags); in ath6kl_usb_free_urb_to_pipe()
162 pipe->urb_cnt++; in ath6kl_usb_free_urb_to_pipe()
164 list_add(&urb_context->link, &pipe->urb_list_head); in ath6kl_usb_free_urb_to_pipe()
165 spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags); in ath6kl_usb_free_urb_to_pipe()
173 ath6kl_usb_free_urb_to_pipe(urb_context->pipe, urb_context); in ath6kl_usb_cleanup_recv_urb()
182 static int ath6kl_usb_alloc_pipe_resources(struct ath6kl_usb_pipe *pipe, in ath6kl_usb_alloc_pipe_resources() argument
188 INIT_LIST_HEAD(&pipe->urb_list_head); in ath6kl_usb_alloc_pipe_resources()
189 init_usb_anchor(&pipe->urb_submitted); in ath6kl_usb_alloc_pipe_resources()
199 urb_context->pipe = pipe; in ath6kl_usb_alloc_pipe_resources()
205 pipe->urb_alloc++; in ath6kl_usb_alloc_pipe_resources()
206 ath6kl_usb_free_urb_to_pipe(pipe, urb_context); in ath6kl_usb_alloc_pipe_resources()
211 pipe->logical_pipe_num, pipe->usb_pipe_handle, in ath6kl_usb_alloc_pipe_resources()
212 pipe->urb_alloc); in ath6kl_usb_alloc_pipe_resources()
218 static void ath6kl_usb_free_pipe_resources(struct ath6kl_usb_pipe *pipe) in ath6kl_usb_free_pipe_resources() argument
222 if (pipe->ar_usb == NULL) { in ath6kl_usb_free_pipe_resources()
230 pipe->logical_pipe_num, pipe->usb_pipe_handle, in ath6kl_usb_free_pipe_resources()
231 pipe->urb_alloc, pipe->urb_cnt); in ath6kl_usb_free_pipe_resources()
233 if (pipe->urb_alloc != pipe->urb_cnt) { in ath6kl_usb_free_pipe_resources()
237 pipe->logical_pipe_num, pipe->usb_pipe_handle, in ath6kl_usb_free_pipe_resources()
238 pipe->urb_alloc, pipe->urb_cnt); in ath6kl_usb_free_pipe_resources()
242 urb_context = ath6kl_usb_alloc_urb_from_pipe(pipe); in ath6kl_usb_free_pipe_resources()
308 struct ath6kl_usb_pipe *pipe; in ath6kl_usb_setup_pipe_resources() local
357 pipe = &ar_usb->pipes[pipe_num]; in ath6kl_usb_setup_pipe_resources()
358 if (pipe->ar_usb != NULL) { in ath6kl_usb_setup_pipe_resources()
363 pipe->ar_usb = ar_usb; in ath6kl_usb_setup_pipe_resources()
364 pipe->logical_pipe_num = pipe_num; in ath6kl_usb_setup_pipe_resources()
365 pipe->ep_address = endpoint->bEndpointAddress; in ath6kl_usb_setup_pipe_resources()
366 pipe->max_packet_size = le16_to_cpu(endpoint->wMaxPacketSize); in ath6kl_usb_setup_pipe_resources()
369 if (ATH6KL_USB_IS_DIR_IN(pipe->ep_address)) { in ath6kl_usb_setup_pipe_resources()
370 pipe->usb_pipe_handle = in ath6kl_usb_setup_pipe_resources()
372 pipe->ep_address); in ath6kl_usb_setup_pipe_resources()
374 pipe->usb_pipe_handle = in ath6kl_usb_setup_pipe_resources()
376 pipe->ep_address); in ath6kl_usb_setup_pipe_resources()
379 if (ATH6KL_USB_IS_DIR_IN(pipe->ep_address)) { in ath6kl_usb_setup_pipe_resources()
380 pipe->usb_pipe_handle = in ath6kl_usb_setup_pipe_resources()
382 pipe->ep_address); in ath6kl_usb_setup_pipe_resources()
384 pipe->usb_pipe_handle = in ath6kl_usb_setup_pipe_resources()
386 pipe->ep_address); in ath6kl_usb_setup_pipe_resources()
390 if (ATH6KL_USB_IS_DIR_IN(pipe->ep_address)) { in ath6kl_usb_setup_pipe_resources()
391 pipe->usb_pipe_handle = in ath6kl_usb_setup_pipe_resources()
393 pipe->ep_address); in ath6kl_usb_setup_pipe_resources()
395 pipe->usb_pipe_handle = in ath6kl_usb_setup_pipe_resources()
397 pipe->ep_address); in ath6kl_usb_setup_pipe_resources()
401 pipe->ep_desc = endpoint; in ath6kl_usb_setup_pipe_resources()
403 if (!ATH6KL_USB_IS_DIR_IN(pipe->ep_address)) in ath6kl_usb_setup_pipe_resources()
404 pipe->flags |= ATH6KL_USB_PIPE_FLAG_TX; in ath6kl_usb_setup_pipe_resources()
406 status = ath6kl_usb_alloc_pipe_resources(pipe, urbcount); in ath6kl_usb_setup_pipe_resources()
505 struct ath6kl_usb_pipe *pipe = urb_context->pipe; in ath6kl_usb_recv_complete() local
511 pipe->logical_pipe_num, urb->status, urb->actual_length, in ath6kl_usb_recv_complete()
529 __func__, pipe->logical_pipe_num, in ath6kl_usb_recv_complete()
530 pipe->ep_address, urb->status); in ath6kl_usb_recv_complete()
546 skb_queue_tail(&pipe->io_comp_queue, skb); in ath6kl_usb_recv_complete()
547 schedule_work(&pipe->io_complete_work); in ath6kl_usb_recv_complete()
553 pipe->urb_cnt >= pipe->urb_cnt_thresh) { in ath6kl_usb_recv_complete()
555 ath6kl_usb_post_recv_transfers(pipe, ATH6KL_USB_RX_BUFFER_SIZE); in ath6kl_usb_recv_complete()
562 struct ath6kl_usb_pipe *pipe = urb_context->pipe; in ath6kl_usb_usb_transmit_complete() local
567 __func__, pipe->logical_pipe_num, urb->status, in ath6kl_usb_usb_transmit_complete()
573 __func__, pipe->logical_pipe_num, urb->status); in ath6kl_usb_usb_transmit_complete()
578 ath6kl_usb_free_urb_to_pipe(urb_context->pipe, urb_context); in ath6kl_usb_usb_transmit_complete()
581 skb_queue_tail(&pipe->io_comp_queue, skb); in ath6kl_usb_usb_transmit_complete()
582 schedule_work(&pipe->io_complete_work); in ath6kl_usb_usb_transmit_complete()
587 struct ath6kl_usb_pipe *pipe = container_of(work, in ath6kl_usb_io_comp_work() local
593 ar_usb = pipe->ar_usb; in ath6kl_usb_io_comp_work()
595 while ((skb = skb_dequeue(&pipe->io_comp_queue))) { in ath6kl_usb_io_comp_work()
596 if (pipe->flags & ATH6KL_USB_PIPE_FLAG_TX) { in ath6kl_usb_io_comp_work()
604 pipe->logical_pipe_num); in ath6kl_usb_io_comp_work()
630 struct ath6kl_usb_pipe *pipe; in ath6kl_usb_create() local
644 pipe = &ar_usb->pipes[i]; in ath6kl_usb_create()
645 INIT_WORK(&pipe->io_complete_work, in ath6kl_usb_create()
647 skb_queue_head_init(&pipe->io_comp_queue); in ath6kl_usb_create()
709 struct ath6kl_usb_pipe *pipe = &device->pipes[PipeID]; in ath6kl_usb_send() local
719 urb_context = ath6kl_usb_alloc_urb_from_pipe(pipe); in ath6kl_usb_send()
728 __func__, PipeID, pipe->urb_cnt); in ath6kl_usb_send()
741 ath6kl_usb_free_urb_to_pipe(urb_context->pipe, in ath6kl_usb_send()
748 pipe->usb_pipe_handle, in ath6kl_usb_send()
753 if ((len % pipe->max_packet_size) == 0) { in ath6kl_usb_send()
760 pipe->logical_pipe_num, pipe->usb_pipe_handle, in ath6kl_usb_send()
761 pipe->ep_address, len); in ath6kl_usb_send()
763 usb_anchor_urb(urb, &pipe->urb_submitted); in ath6kl_usb_send()
771 ath6kl_usb_free_urb_to_pipe(urb_context->pipe, in ath6kl_usb_send()