Lines Matching refs:pipe

52 static void usb_hif_free_urb_to_pipe(struct HIF_USB_PIPE *pipe,  in usb_hif_free_urb_to_pipe()  argument
55 qdf_spin_lock_irqsave(&pipe->device->cs_lock); in usb_hif_free_urb_to_pipe()
56 pipe->urb_cnt++; in usb_hif_free_urb_to_pipe()
57 DL_ListAdd(&pipe->urb_list_head, &urb_context->link); in usb_hif_free_urb_to_pipe()
58 qdf_spin_unlock_irqrestore(&pipe->device->cs_lock); in usb_hif_free_urb_to_pipe()
67 struct HIF_URB_CONTEXT *usb_hif_alloc_urb_from_pipe(struct HIF_USB_PIPE *pipe) in usb_hif_alloc_urb_from_pipe() argument
72 qdf_spin_lock_irqsave(&pipe->device->cs_lock); in usb_hif_alloc_urb_from_pipe()
73 item = dl_list_remove_item_from_head(&pipe->urb_list_head); in usb_hif_alloc_urb_from_pipe()
77 pipe->urb_cnt--; in usb_hif_alloc_urb_from_pipe()
79 qdf_spin_unlock_irqrestore(&pipe->device->cs_lock); in usb_hif_alloc_urb_from_pipe()
91 (struct HIF_USB_PIPE *pipe) in usb_hif_dequeue_pending_transfer() argument
96 qdf_spin_lock_irqsave(&pipe->device->cs_lock); in usb_hif_dequeue_pending_transfer()
97 item = dl_list_remove_item_from_head(&pipe->urb_pending_list); in usb_hif_dequeue_pending_transfer()
101 qdf_spin_unlock_irqrestore(&pipe->device->cs_lock); in usb_hif_dequeue_pending_transfer()
113 void usb_hif_enqueue_pending_transfer(struct HIF_USB_PIPE *pipe, in usb_hif_enqueue_pending_transfer() argument
116 qdf_spin_lock_irqsave(&pipe->device->cs_lock); in usb_hif_enqueue_pending_transfer()
117 dl_list_insert_tail(&pipe->urb_pending_list, &urb_context->link); in usb_hif_enqueue_pending_transfer()
118 qdf_spin_unlock_irqrestore(&pipe->device->cs_lock); in usb_hif_enqueue_pending_transfer()
131 qdf_spin_lock_irqsave(&urb_context->pipe->device->cs_lock); in usb_hif_remove_pending_transfer()
133 qdf_spin_unlock_irqrestore(&urb_context->pipe->device->cs_lock); in usb_hif_remove_pending_transfer()
144 (struct HIF_USB_PIPE *pipe, int urb_cnt) in usb_hif_alloc_pipe_resources() argument
150 DL_LIST_INIT(&pipe->urb_list_head); in usb_hif_alloc_pipe_resources()
151 DL_LIST_INIT(&pipe->urb_pending_list); in usb_hif_alloc_pipe_resources()
159 urb_context->pipe = pipe; in usb_hif_alloc_pipe_resources()
173 pipe->urb_alloc++; in usb_hif_alloc_pipe_resources()
175 usb_hif_free_urb_to_pipe(pipe, urb_context); in usb_hif_alloc_pipe_resources()
179 pipe->logical_pipe_num, in usb_hif_alloc_pipe_resources()
180 pipe->usb_pipe_handle, in usb_hif_alloc_pipe_resources()
181 pipe->urb_alloc); in usb_hif_alloc_pipe_resources()
191 static void usb_hif_free_pipe_resources(struct HIF_USB_PIPE *pipe) in usb_hif_free_pipe_resources() argument
195 if (!pipe->device) { in usb_hif_free_pipe_resources()
202 pipe->logical_pipe_num, in usb_hif_free_pipe_resources()
203 pipe->usb_pipe_handle, pipe->urb_alloc, in usb_hif_free_pipe_resources()
204 pipe->urb_cnt); in usb_hif_free_pipe_resources()
206 if (pipe->urb_alloc != pipe->urb_cnt) { in usb_hif_free_pipe_resources()
208 pipe->logical_pipe_num, in usb_hif_free_pipe_resources()
209 pipe->usb_pipe_handle, pipe->urb_alloc, in usb_hif_free_pipe_resources()
210 pipe->urb_cnt); in usb_hif_free_pipe_resources()
214 urb_context = usb_hif_alloc_urb_from_pipe(pipe); in usb_hif_free_pipe_resources()
342 struct HIF_USB_PIPE *pipe; in usb_hif_setup_pipe_resources() local
379 pipe = &device->pipes[pipe_num]; in usb_hif_setup_pipe_resources()
380 if (pipe->device) { in usb_hif_setup_pipe_resources()
385 pipe->device = device; in usb_hif_setup_pipe_resources()
386 pipe->logical_pipe_num = pipe_num; in usb_hif_setup_pipe_resources()
387 pipe->ep_address = endpoint->bEndpointAddress; in usb_hif_setup_pipe_resources()
388 pipe->max_packet_size = in usb_hif_setup_pipe_resources()
392 if (IS_DIR_IN(pipe->ep_address)) { in usb_hif_setup_pipe_resources()
393 pipe->usb_pipe_handle = in usb_hif_setup_pipe_resources()
395 pipe->ep_address); in usb_hif_setup_pipe_resources()
397 pipe->usb_pipe_handle = in usb_hif_setup_pipe_resources()
399 pipe->ep_address); in usb_hif_setup_pipe_resources()
402 if (IS_DIR_IN(pipe->ep_address)) { in usb_hif_setup_pipe_resources()
403 pipe->usb_pipe_handle = in usb_hif_setup_pipe_resources()
405 pipe->ep_address); in usb_hif_setup_pipe_resources()
407 pipe->usb_pipe_handle = in usb_hif_setup_pipe_resources()
409 pipe->ep_address); in usb_hif_setup_pipe_resources()
413 if (IS_DIR_IN(pipe->ep_address)) { in usb_hif_setup_pipe_resources()
414 pipe->usb_pipe_handle = in usb_hif_setup_pipe_resources()
416 pipe->ep_address); in usb_hif_setup_pipe_resources()
418 pipe->usb_pipe_handle = in usb_hif_setup_pipe_resources()
420 pipe->ep_address); in usb_hif_setup_pipe_resources()
423 pipe->ep_desc = endpoint; in usb_hif_setup_pipe_resources()
425 if (!IS_DIR_IN(pipe->ep_address)) in usb_hif_setup_pipe_resources()
426 pipe->flags |= HIF_USB_PIPE_FLAG_TX; in usb_hif_setup_pipe_resources()
428 status = usb_hif_alloc_pipe_resources(pipe, urbcount); in usb_hif_setup_pipe_resources()
459 static void usb_hif_flush_pending_transfers(struct HIF_USB_PIPE *pipe) in usb_hif_flush_pending_transfers() argument
463 hif_info("+ pipe: %d", pipe->logical_pipe_num); in usb_hif_flush_pending_transfers()
466 urb_context = usb_hif_dequeue_pending_transfer(pipe); in usb_hif_flush_pending_transfers()
492 struct HIF_USB_PIPE *pipe; in usb_hif_flush_all() local
499 pipe = &device->pipes[i]; in usb_hif_flush_all()
501 HIF_USB_FLUSH_WORK(pipe); in usb_hif_flush_all()
522 usb_hif_free_urb_to_pipe(urb_context->pipe, urb_context); in usb_hif_cleanup_recv_urb()
533 usb_hif_free_urb_to_pipe(urb_context->pipe, urb_context); in usb_hif_cleanup_transmit_urb()
549 struct HIF_USB_PIPE *pipe = urb_context->pipe; in usb_hif_usb_recv_prestart_complete() local
550 struct hif_usb_softc *sc = HIF_GET_USB_SOFTC(pipe->device); in usb_hif_usb_recv_prestart_complete()
553 pipe->logical_pipe_num, in usb_hif_usb_recv_prestart_complete()
574 pipe->logical_pipe_num, in usb_hif_usb_recv_prestart_complete()
575 pipe->ep_address, in usb_hif_usb_recv_prestart_complete()
596 skb_queue_tail(&pipe->io_comp_queue, buf); in usb_hif_usb_recv_prestart_complete()
598 HIF_USB_SCHEDULE_WORK(pipe); in usb_hif_usb_recv_prestart_complete()
604 qdf_spin_lock_irqsave(&pipe->device->rx_prestart_lock); in usb_hif_usb_recv_prestart_complete()
605 if ((--pipe->urb_prestart_cnt == 0) && !sc->suspend_state) in usb_hif_usb_recv_prestart_complete()
606 usb_hif_start_recv_pipes(pipe->device); in usb_hif_usb_recv_prestart_complete()
607 qdf_spin_unlock_irqrestore(&pipe->device->rx_prestart_lock); in usb_hif_usb_recv_prestart_complete()
624 struct HIF_USB_PIPE *pipe = urb_context->pipe; in usb_hif_usb_recv_complete() local
625 struct hif_usb_softc *sc = HIF_GET_USB_SOFTC(pipe->device); in usb_hif_usb_recv_complete()
628 pipe->logical_pipe_num, in usb_hif_usb_recv_complete()
657 pipe->logical_pipe_num, in usb_hif_usb_recv_complete()
658 pipe->ep_address, in usb_hif_usb_recv_complete()
678 skb_queue_tail(&pipe->io_comp_queue, buf); in usb_hif_usb_recv_complete()
680 if (pipe->device->htc_callbacks.update_bundle_stats) in usb_hif_usb_recv_complete()
681 pipe->device->htc_callbacks.update_bundle_stats in usb_hif_usb_recv_complete()
682 (pipe->device->htc_callbacks.Context, 1); in usb_hif_usb_recv_complete()
684 HIF_USB_SCHEDULE_WORK(pipe); in usb_hif_usb_recv_complete()
693 if (pipe->urb_cnt >= pipe->urb_cnt_thresh) { in usb_hif_usb_recv_complete()
695 usb_hif_post_recv_transfers(pipe, in usb_hif_usb_recv_complete()
700 pipe->logical_pipe_num, in usb_hif_usb_recv_complete()
720 struct HIF_USB_PIPE *pipe = urb_context->pipe; in usb_hif_usb_recv_bundle_complete() local
729 pipe->logical_pipe_num, in usb_hif_usb_recv_bundle_complete()
752 pipe->logical_pipe_num, in usb_hif_usb_recv_bundle_complete()
753 pipe->ep_address, in usb_hif_usb_recv_bundle_complete()
818 skb_queue_tail(&pipe->io_comp_queue, new_skb); in usb_hif_usb_recv_bundle_complete()
825 if (pipe->device->htc_callbacks.update_bundle_stats) in usb_hif_usb_recv_bundle_complete()
826 pipe->device->htc_callbacks.update_bundle_stats in usb_hif_usb_recv_bundle_complete()
827 (pipe->device->htc_callbacks.Context, in usb_hif_usb_recv_bundle_complete()
830 HIF_USB_SCHEDULE_WORK(pipe); in usb_hif_usb_recv_bundle_complete()
837 usb_hif_free_urb_to_pipe(urb_context->pipe, urb_context); in usb_hif_usb_recv_bundle_complete()
840 if (pipe->urb_cnt >= pipe->urb_cnt_thresh) { in usb_hif_usb_recv_bundle_complete()
842 usb_hif_post_recv_bundle_transfers(pipe, in usb_hif_usb_recv_bundle_complete()
843 pipe->device->rx_bundle_buf_len); in usb_hif_usb_recv_bundle_complete()
1033 usb_hif_free_urb_to_pipe(urb_context->pipe, in usb_hif_post_recv_bundle_transfers()
1050 struct HIF_USB_PIPE *pipe; in usb_hif_prestart_recv_pipes() local
1054 pipe = &device->pipes[HIF_RX_CTRL_PIPE]; in usb_hif_prestart_recv_pipes()
1056 usb_hif_post_recv_prestart_transfers(pipe, prestart_cnt); in usb_hif_prestart_recv_pipes()
1064 pipe = &device->pipes[HIF_RX_DATA_PIPE]; in usb_hif_prestart_recv_pipes()
1065 usb_hif_post_recv_prestart_transfers(pipe, prestart_cnt); in usb_hif_prestart_recv_pipes()
1078 struct HIF_USB_PIPE *pipe; in usb_hif_start_recv_pipes() local
1082 pipe = &device->pipes[HIF_RX_DATA_PIPE]; in usb_hif_start_recv_pipes()
1083 pipe->urb_cnt_thresh = pipe->urb_alloc / 2; in usb_hif_start_recv_pipes()
1089 usb_hif_post_recv_bundle_transfers(pipe, in usb_hif_start_recv_pipes()
1090 pipe->device->rx_bundle_buf_len); in usb_hif_start_recv_pipes()
1093 usb_hif_post_recv_transfers(pipe, buf_len); in usb_hif_start_recv_pipes()
1102 pipe = &device->pipes[HIF_RX_DATA2_PIPE]; in usb_hif_start_recv_pipes()
1103 pipe->urb_cnt_thresh = pipe->urb_alloc / 2; in usb_hif_start_recv_pipes()
1104 usb_hif_post_recv_transfers(pipe, HIF_USB_RX_BUFFER_SIZE); in usb_hif_start_recv_pipes()
1111 pipe = &device->pipes[HIF_RX_CTRL_PIPE]; in usb_hif_start_recv_pipes()
1112 pipe->urb_cnt_thresh = pipe->urb_alloc / 2; in usb_hif_start_recv_pipes()
1113 usb_hif_post_recv_transfers(pipe, HIF_USB_RX_BUFFER_SIZE); in usb_hif_start_recv_pipes()
1232 static void usb_hif_io_complete(struct HIF_USB_PIPE *pipe) in usb_hif_io_complete() argument
1239 struct hif_usb_softc *sc = HIF_GET_USB_SOFTC(pipe->device); in usb_hif_io_complete()
1241 device = pipe->device; in usb_hif_io_complete()
1243 while ((buf = skb_dequeue(&pipe->io_comp_queue))) { in usb_hif_io_complete()
1244 if (pipe->flags & HIF_USB_PIPE_FLAG_TX) { in usb_hif_io_complete()
1273 pipe->logical_pipe_num); in usb_hif_io_complete()
1291 struct HIF_USB_PIPE *pipe = (struct HIF_USB_PIPE *) context; in usb_hif_io_comp_tasklet() local
1293 usb_hif_io_complete(pipe); in usb_hif_io_comp_tasklet()
1305 struct HIF_USB_PIPE *pipe = container_of(work, struct HIF_USB_PIPE, in usb_hif_io_comp_work() local
1308 usb_hif_io_complete(pipe); in usb_hif_io_comp_work()