Lines Matching full:pipe

65 	/* protects pipe->urb_list_head and  pipe->urb_cnt */
80 struct ath6kl_usb_pipe *pipe; member
129 /* pipe/urb operations */
131 ath6kl_usb_alloc_urb_from_pipe(struct ath6kl_usb_pipe *pipe) in ath6kl_usb_alloc_urb_from_pipe() argument
136 /* bail if this pipe is not initialized */ in ath6kl_usb_alloc_urb_from_pipe()
137 if (!pipe->ar_usb) in ath6kl_usb_alloc_urb_from_pipe()
140 spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags); in ath6kl_usb_alloc_urb_from_pipe()
141 if (!list_empty(&pipe->urb_list_head)) { in ath6kl_usb_alloc_urb_from_pipe()
143 list_first_entry(&pipe->urb_list_head, in ath6kl_usb_alloc_urb_from_pipe()
146 pipe->urb_cnt--; in ath6kl_usb_alloc_urb_from_pipe()
148 spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags); in ath6kl_usb_alloc_urb_from_pipe()
153 static void ath6kl_usb_free_urb_to_pipe(struct ath6kl_usb_pipe *pipe, in ath6kl_usb_free_urb_to_pipe() argument
158 /* bail if this pipe is not initialized */ in ath6kl_usb_free_urb_to_pipe()
159 if (!pipe->ar_usb) in ath6kl_usb_free_urb_to_pipe()
162 spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags); in ath6kl_usb_free_urb_to_pipe()
163 pipe->urb_cnt++; in ath6kl_usb_free_urb_to_pipe()
165 list_add(&urb_context->link, &pipe->urb_list_head); in ath6kl_usb_free_urb_to_pipe()
166 spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags); in ath6kl_usb_free_urb_to_pipe()
174 ath6kl_usb_free_urb_to_pipe(urb_context->pipe, urb_context); in ath6kl_usb_cleanup_recv_urb()
182 /* pipe resource allocation/cleanup */
183 static int ath6kl_usb_alloc_pipe_resources(struct ath6kl_usb_pipe *pipe, in ath6kl_usb_alloc_pipe_resources() argument
189 INIT_LIST_HEAD(&pipe->urb_list_head); in ath6kl_usb_alloc_pipe_resources()
190 init_usb_anchor(&pipe->urb_submitted); in ath6kl_usb_alloc_pipe_resources()
200 urb_context->pipe = pipe; in ath6kl_usb_alloc_pipe_resources()
206 pipe->urb_alloc++; in ath6kl_usb_alloc_pipe_resources()
207 ath6kl_usb_free_urb_to_pipe(pipe, urb_context); in ath6kl_usb_alloc_pipe_resources()
212 pipe->logical_pipe_num, pipe->usb_pipe_handle, in ath6kl_usb_alloc_pipe_resources()
213 pipe->urb_alloc); in ath6kl_usb_alloc_pipe_resources()
219 static void ath6kl_usb_free_pipe_resources(struct ath6kl_usb_pipe *pipe) in ath6kl_usb_free_pipe_resources() argument
223 if (pipe->ar_usb == NULL) { in ath6kl_usb_free_pipe_resources()
224 /* nothing allocated for this pipe */ in ath6kl_usb_free_pipe_resources()
231 pipe->logical_pipe_num, pipe->usb_pipe_handle, in ath6kl_usb_free_pipe_resources()
232 pipe->urb_alloc, pipe->urb_cnt); in ath6kl_usb_free_pipe_resources()
234 if (pipe->urb_alloc != pipe->urb_cnt) { in ath6kl_usb_free_pipe_resources()
238 pipe->logical_pipe_num, pipe->usb_pipe_handle, in ath6kl_usb_free_pipe_resources()
239 pipe->urb_alloc, pipe->urb_cnt); in ath6kl_usb_free_pipe_resources()
243 urb_context = ath6kl_usb_alloc_urb_from_pipe(pipe); in ath6kl_usb_free_pipe_resources()
309 struct ath6kl_usb_pipe *pipe; in ath6kl_usb_setup_pipe_resources() local
358 pipe = &ar_usb->pipes[pipe_num]; in ath6kl_usb_setup_pipe_resources()
359 if (pipe->ar_usb != NULL) { in ath6kl_usb_setup_pipe_resources()
360 /* hmmm..pipe was already setup */ in ath6kl_usb_setup_pipe_resources()
364 pipe->ar_usb = ar_usb; in ath6kl_usb_setup_pipe_resources()
365 pipe->logical_pipe_num = pipe_num; in ath6kl_usb_setup_pipe_resources()
366 pipe->ep_address = endpoint->bEndpointAddress; in ath6kl_usb_setup_pipe_resources()
367 pipe->max_packet_size = le16_to_cpu(endpoint->wMaxPacketSize); in ath6kl_usb_setup_pipe_resources()
370 if (ATH6KL_USB_IS_DIR_IN(pipe->ep_address)) { in ath6kl_usb_setup_pipe_resources()
371 pipe->usb_pipe_handle = in ath6kl_usb_setup_pipe_resources()
373 pipe->ep_address); in ath6kl_usb_setup_pipe_resources()
375 pipe->usb_pipe_handle = in ath6kl_usb_setup_pipe_resources()
377 pipe->ep_address); in ath6kl_usb_setup_pipe_resources()
380 if (ATH6KL_USB_IS_DIR_IN(pipe->ep_address)) { in ath6kl_usb_setup_pipe_resources()
381 pipe->usb_pipe_handle = in ath6kl_usb_setup_pipe_resources()
383 pipe->ep_address); in ath6kl_usb_setup_pipe_resources()
385 pipe->usb_pipe_handle = in ath6kl_usb_setup_pipe_resources()
387 pipe->ep_address); in ath6kl_usb_setup_pipe_resources()
391 if (ATH6KL_USB_IS_DIR_IN(pipe->ep_address)) { in ath6kl_usb_setup_pipe_resources()
392 pipe->usb_pipe_handle = in ath6kl_usb_setup_pipe_resources()
394 pipe->ep_address); in ath6kl_usb_setup_pipe_resources()
396 pipe->usb_pipe_handle = in ath6kl_usb_setup_pipe_resources()
398 pipe->ep_address); in ath6kl_usb_setup_pipe_resources()
402 pipe->ep_desc = endpoint; in ath6kl_usb_setup_pipe_resources()
404 if (!ATH6KL_USB_IS_DIR_IN(pipe->ep_address)) in ath6kl_usb_setup_pipe_resources()
405 pipe->flags |= ATH6KL_USB_PIPE_FLAG_TX; in ath6kl_usb_setup_pipe_resources()
407 status = ath6kl_usb_alloc_pipe_resources(pipe, urbcount); in ath6kl_usb_setup_pipe_resources()
415 /* pipe operations */
488 * note: control pipe is no longer used in ath6kl_usb_start_recv_pipes()
506 struct ath6kl_usb_pipe *pipe = urb_context->pipe; in ath6kl_usb_recv_complete() local
511 "%s: recv pipe: %d, stat:%d, len:%d urb:0x%p\n", __func__, in ath6kl_usb_recv_complete()
512 pipe->logical_pipe_num, urb->status, urb->actual_length, in ath6kl_usb_recv_complete()
529 "%s recv pipe: %d (ep:0x%2.2X), failed:%d\n", in ath6kl_usb_recv_complete()
530 __func__, pipe->logical_pipe_num, in ath6kl_usb_recv_complete()
531 pipe->ep_address, urb->status); in ath6kl_usb_recv_complete()
547 skb_queue_tail(&pipe->io_comp_queue, skb); in ath6kl_usb_recv_complete()
548 queue_work(pipe->ar_usb->wq, &pipe->io_complete_work); in ath6kl_usb_recv_complete()
554 pipe->urb_cnt >= pipe->urb_cnt_thresh) { in ath6kl_usb_recv_complete()
556 ath6kl_usb_post_recv_transfers(pipe, ATH6KL_USB_RX_BUFFER_SIZE); in ath6kl_usb_recv_complete()
563 struct ath6kl_usb_pipe *pipe = urb_context->pipe; in ath6kl_usb_usb_transmit_complete() local
567 "%s: pipe: %d, stat:%d, len:%d\n", in ath6kl_usb_usb_transmit_complete()
568 __func__, pipe->logical_pipe_num, urb->status, in ath6kl_usb_usb_transmit_complete()
573 "%s: pipe: %d, failed:%d\n", in ath6kl_usb_usb_transmit_complete()
574 __func__, pipe->logical_pipe_num, urb->status); in ath6kl_usb_usb_transmit_complete()
579 ath6kl_usb_free_urb_to_pipe(urb_context->pipe, urb_context); in ath6kl_usb_usb_transmit_complete()
582 skb_queue_tail(&pipe->io_comp_queue, skb); in ath6kl_usb_usb_transmit_complete()
583 queue_work(pipe->ar_usb->wq, &pipe->io_complete_work); in ath6kl_usb_usb_transmit_complete()
588 struct ath6kl_usb_pipe *pipe = container_of(work, in ath6kl_usb_io_comp_work() local
594 ar_usb = pipe->ar_usb; in ath6kl_usb_io_comp_work()
596 while ((skb = skb_dequeue(&pipe->io_comp_queue))) { in ath6kl_usb_io_comp_work()
597 if (pipe->flags & ATH6KL_USB_PIPE_FLAG_TX) { in ath6kl_usb_io_comp_work()
605 pipe->logical_pipe_num); in ath6kl_usb_io_comp_work()
632 struct ath6kl_usb_pipe *pipe; in ath6kl_usb_create() local
652 pipe = &ar_usb->pipes[i]; in ath6kl_usb_create()
653 INIT_WORK(&pipe->io_complete_work, in ath6kl_usb_create()
655 skb_queue_head_init(&pipe->io_comp_queue); in ath6kl_usb_create()
697 /* exported hif usb APIs for htc pipe */
705 /* set the TX resource avail threshold for each TX pipe */ in hif_start()
717 struct ath6kl_usb_pipe *pipe = &device->pipes[PipeID]; in ath6kl_usb_send() local
724 ath6kl_dbg(ATH6KL_DBG_USB_BULK, "+%s pipe : %d, buf:0x%p\n", in ath6kl_usb_send()
727 urb_context = ath6kl_usb_alloc_urb_from_pipe(pipe); in ath6kl_usb_send()
732 * 2 endpoints map to the same pipe ID in ath6kl_usb_send()
735 "%s pipe:%d no urbs left. URB Cnt : %d\n", in ath6kl_usb_send()
736 __func__, PipeID, pipe->urb_cnt); in ath6kl_usb_send()
749 ath6kl_usb_free_urb_to_pipe(urb_context->pipe, in ath6kl_usb_send()
756 pipe->usb_pipe_handle, in ath6kl_usb_send()
761 if ((len % pipe->max_packet_size) == 0) { in ath6kl_usb_send()
762 /* hit a max packet boundary on this pipe */ in ath6kl_usb_send()
768 pipe->logical_pipe_num, pipe->usb_pipe_handle, in ath6kl_usb_send()
769 pipe->ep_address, len); in ath6kl_usb_send()
771 usb_anchor_urb(urb, &pipe->urb_submitted); in ath6kl_usb_send()
779 ath6kl_usb_free_urb_to_pipe(urb_context->pipe, in ath6kl_usb_send()
812 /* due to large control packets, shift to data pipe */ in ath6kl_usb_map_service_pipe()