Lines Matching defs:pipe

65 	/* protects pipe->urb_list_head and  pipe->urb_cnt */
79 struct ath6kl_usb_pipe *pipe;
128 /* pipe/urb operations */
130 ath6kl_usb_alloc_urb_from_pipe(struct ath6kl_usb_pipe *pipe)
135 /* bail if this pipe is not initialized */
136 if (!pipe->ar_usb)
139 spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags);
140 if (!list_empty(&pipe->urb_list_head)) {
142 list_first_entry(&pipe->urb_list_head,
145 pipe->urb_cnt--;
147 spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags);
152 static void ath6kl_usb_free_urb_to_pipe(struct ath6kl_usb_pipe *pipe,
157 /* bail if this pipe is not initialized */
158 if (!pipe->ar_usb)
161 spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags);
162 pipe->urb_cnt++;
164 list_add(&urb_context->link, &pipe->urb_list_head);
165 spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags);
173 ath6kl_usb_free_urb_to_pipe(urb_context->pipe, urb_context);
181 /* pipe resource allocation/cleanup */
182 static int ath6kl_usb_alloc_pipe_resources(struct ath6kl_usb_pipe *pipe,
188 INIT_LIST_HEAD(&pipe->urb_list_head);
189 init_usb_anchor(&pipe->urb_submitted);
199 urb_context->pipe = pipe;
205 pipe->urb_alloc++;
206 ath6kl_usb_free_urb_to_pipe(pipe, urb_context);
211 pipe->logical_pipe_num, pipe->usb_pipe_handle,
212 pipe->urb_alloc);
218 static void ath6kl_usb_free_pipe_resources(struct ath6kl_usb_pipe *pipe)
222 if (pipe->ar_usb == NULL) {
223 /* nothing allocated for this pipe */
230 pipe->logical_pipe_num, pipe->usb_pipe_handle,
231 pipe->urb_alloc, pipe->urb_cnt);
233 if (pipe->urb_alloc != pipe->urb_cnt) {
237 pipe->logical_pipe_num, pipe->usb_pipe_handle,
238 pipe->urb_alloc, pipe->urb_cnt);
242 urb_context = ath6kl_usb_alloc_urb_from_pipe(pipe);
308 struct ath6kl_usb_pipe *pipe;
357 pipe = &ar_usb->pipes[pipe_num];
358 if (pipe->ar_usb != NULL) {
359 /* hmmm..pipe was already setup */
363 pipe->ar_usb = ar_usb;
364 pipe->logical_pipe_num = pipe_num;
365 pipe->ep_address = endpoint->bEndpointAddress;
366 pipe->max_packet_size = le16_to_cpu(endpoint->wMaxPacketSize);
369 if (ATH6KL_USB_IS_DIR_IN(pipe->ep_address)) {
370 pipe->usb_pipe_handle =
372 pipe->ep_address);
374 pipe->usb_pipe_handle =
376 pipe->ep_address);
379 if (ATH6KL_USB_IS_DIR_IN(pipe->ep_address)) {
380 pipe->usb_pipe_handle =
382 pipe->ep_address);
384 pipe->usb_pipe_handle =
386 pipe->ep_address);
390 if (ATH6KL_USB_IS_DIR_IN(pipe->ep_address)) {
391 pipe->usb_pipe_handle =
393 pipe->ep_address);
395 pipe->usb_pipe_handle =
397 pipe->ep_address);
401 pipe->ep_desc = endpoint;
403 if (!ATH6KL_USB_IS_DIR_IN(pipe->ep_address))
404 pipe->flags |= ATH6KL_USB_PIPE_FLAG_TX;
406 status = ath6kl_usb_alloc_pipe_resources(pipe, urbcount);
414 /* pipe operations */
487 * note: control pipe is no longer used
505 struct ath6kl_usb_pipe *pipe = urb_context->pipe;
510 "%s: recv pipe: %d, stat:%d, len:%d urb:0x%p\n", __func__,
511 pipe->logical_pipe_num, urb->status, urb->actual_length,
528 "%s recv pipe: %d (ep:0x%2.2X), failed:%d\n",
529 __func__, pipe->logical_pipe_num,
530 pipe->ep_address, urb->status);
546 skb_queue_tail(&pipe->io_comp_queue, skb);
547 schedule_work(&pipe->io_complete_work);
553 pipe->urb_cnt >= pipe->urb_cnt_thresh) {
555 ath6kl_usb_post_recv_transfers(pipe, ATH6KL_USB_RX_BUFFER_SIZE);
562 struct ath6kl_usb_pipe *pipe = urb_context->pipe;
566 "%s: pipe: %d, stat:%d, len:%d\n",
567 __func__, pipe->logical_pipe_num, urb->status,
572 "%s: pipe: %d, failed:%d\n",
573 __func__, pipe->logical_pipe_num, urb->status);
578 ath6kl_usb_free_urb_to_pipe(urb_context->pipe, urb_context);
581 skb_queue_tail(&pipe->io_comp_queue, skb);
582 schedule_work(&pipe->io_complete_work);
587 struct ath6kl_usb_pipe *pipe = container_of(work,
593 ar_usb = pipe->ar_usb;
595 while ((skb = skb_dequeue(&pipe->io_comp_queue))) {
596 if (pipe->flags & ATH6KL_USB_PIPE_FLAG_TX) {
604 pipe->logical_pipe_num);
630 struct ath6kl_usb_pipe *pipe;
644 pipe = &ar_usb->pipes[i];
645 INIT_WORK(&pipe->io_complete_work,
647 skb_queue_head_init(&pipe->io_comp_queue);
689 /* exported hif usb APIs for htc pipe */
697 /* set the TX resource avail threshold for each TX pipe */
709 struct ath6kl_usb_pipe *pipe = &device->pipes[PipeID];
716 ath6kl_dbg(ATH6KL_DBG_USB_BULK, "+%s pipe : %d, buf:0x%p\n",
719 urb_context = ath6kl_usb_alloc_urb_from_pipe(pipe);
724 * 2 endpoints map to the same pipe ID
727 "%s pipe:%d no urbs left. URB Cnt : %d\n",
728 __func__, PipeID, pipe->urb_cnt);
741 ath6kl_usb_free_urb_to_pipe(urb_context->pipe,
748 pipe->usb_pipe_handle,
753 if ((len % pipe->max_packet_size) == 0) {
754 /* hit a max packet boundary on this pipe */
760 pipe->logical_pipe_num, pipe->usb_pipe_handle,
761 pipe->ep_address, len);
763 usb_anchor_urb(urb, &pipe->urb_submitted);
771 ath6kl_usb_free_urb_to_pipe(urb_context->pipe,
804 /* due to large control packets, shift to data pipe */