Lines Matching refs:pipe
340 static inline bool _buffer_can_fill(pipe_t *pipe) in _buffer_can_fill() argument
343 if (pipe->num_urb_pending > 0 && pipe->multi_buffer_control.buffer_num_to_fill > 0) { in _buffer_can_fill()
361 static void _buffer_fill(pipe_t *pipe);
370 static inline bool _buffer_can_exec(pipe_t *pipe) in _buffer_can_exec() argument
373 …if (!pipe->multi_buffer_control.buffer_is_executing && pipe->multi_buffer_control.buffer_num_to_ex… in _buffer_can_exec()
388 static void _buffer_exec(pipe_t *pipe);
400 static inline bool _buffer_check_done(pipe_t *pipe) in _buffer_check_done() argument
402 if (pipe->ep_char.type != USB_PRIV_XFER_TYPE_CTRL) { in _buffer_check_done()
406 dma_buffer_block_t *buffer_inflight = pipe->buffers[pipe->multi_buffer_control.rd_idx]; in _buffer_check_done()
417 static void _buffer_exec_cont(pipe_t *pipe);
429 static inline void _buffer_done(pipe_t *pipe, int stop_idx, hcd_pipe_event_t pipe_event, bool cance… in _buffer_done() argument
432 dma_buffer_block_t *buffer_done = pipe->buffers[pipe->multi_buffer_control.rd_idx]; in _buffer_done()
437 pipe->multi_buffer_control.rd_idx++; in _buffer_done()
438 pipe->multi_buffer_control.buffer_num_to_exec--; in _buffer_done()
439 pipe->multi_buffer_control.buffer_num_to_parse++; in _buffer_done()
440 pipe->multi_buffer_control.buffer_is_executing = 0; in _buffer_done()
450 static inline bool _buffer_can_parse(pipe_t *pipe) in _buffer_can_parse() argument
452 if (pipe->multi_buffer_control.buffer_num_to_parse > 0) { in _buffer_can_parse()
471 static void _buffer_parse(pipe_t *pipe);
483 static bool _buffer_flush_all(pipe_t *pipe, bool canceled);
508 static esp_err_t _pipe_cmd_halt(pipe_t *pipe);
520 static esp_err_t _pipe_cmd_flush(pipe_t *pipe);
532 static esp_err_t _pipe_cmd_clear(pipe_t *pipe);
673 static void _internal_pipe_event_wait(pipe_t *pipe);
683 static bool _internal_pipe_event_notify(pipe_t *pipe, bool from_isr);
719 static void _internal_pipe_event_wait(pipe_t *pipe) in _internal_pipe_event_wait() argument
722 assert(pipe->task_waiting_pipe_notif == NULL); in _internal_pipe_event_wait()
723 pipe->task_waiting_pipe_notif = xTaskGetCurrentTaskHandle(); in _internal_pipe_event_wait()
727 while (pipe->task_waiting_pipe_notif != NULL) { in _internal_pipe_event_wait()
735 static bool _internal_pipe_event_notify(pipe_t *pipe, bool from_isr) in _internal_pipe_event_notify() argument
738 assert(pipe->task_waiting_pipe_notif != NULL); in _internal_pipe_event_notify()
739 TaskHandle_t task_to_unblock = pipe->task_waiting_pipe_notif; in _internal_pipe_event_notify()
741 pipe->task_waiting_pipe_notif = NULL; in _internal_pipe_event_notify()
838 static hcd_pipe_event_t _intr_hdlr_chan(pipe_t *pipe, usbh_hal_chan_t *chan_obj, bool *yield) in _intr_hdlr_chan() argument
845 if (!_buffer_check_done(pipe)) { in _intr_hdlr_chan()
846 _buffer_exec_cont(pipe); in _intr_hdlr_chan()
849 pipe->last_event = HCD_PIPE_EVENT_URB_DONE; in _intr_hdlr_chan()
850 event = pipe->last_event; in _intr_hdlr_chan()
853 _buffer_done(pipe, stop_idx, pipe->last_event, false); in _intr_hdlr_chan()
855 if (_buffer_can_exec(pipe) && pipe->port->flags.conn_dev_ena) { in _intr_hdlr_chan()
857 _buffer_exec(pipe); in _intr_hdlr_chan()
860 _buffer_parse(pipe); in _intr_hdlr_chan()
862 if (_buffer_can_fill(pipe) && pipe->port->flags.conn_dev_ena) { in _intr_hdlr_chan()
864 _buffer_fill(pipe); in _intr_hdlr_chan()
871 pipe->last_event = pipe_decode_error_event(chan_error); in _intr_hdlr_chan()
872 event = pipe->last_event; in _intr_hdlr_chan()
873 pipe->state = HCD_PIPE_STATE_HALTED; in _intr_hdlr_chan()
876 _buffer_done(pipe, stop_idx, pipe->last_event, false); in _intr_hdlr_chan()
878 _buffer_parse(pipe); in _intr_hdlr_chan()
882 assert(pipe->cs_flags.waiting_halt); in _intr_hdlr_chan()
884 pipe->last_event = HCD_PIPE_EVENT_URB_DONE; in _intr_hdlr_chan()
885 event = pipe->last_event; in _intr_hdlr_chan()
887 pipe->state = HCD_PIPE_STATE_HALTED; in _intr_hdlr_chan()
889 _buffer_done(pipe, stop_idx, HCD_PIPE_EVENT_NONE, true); in _intr_hdlr_chan()
891 _buffer_parse(pipe); in _intr_hdlr_chan()
893 *yield |= _internal_pipe_event_notify(pipe, true); in _intr_hdlr_chan()
928 pipe_t *pipe = (pipe_t *)usbh_hal_chan_get_context(chan_obj); in intr_hdlr_main() local
929 hcd_pipe_event_t event = _intr_hdlr_chan(pipe, chan_obj, &yield); in intr_hdlr_main()
931 if (event != HCD_PIPE_EVENT_NONE && pipe->callback != NULL) { in intr_hdlr_main()
933 yield |= pipe->callback((hcd_pipe_handle_t)pipe, event, pipe->callback_arg, true); in intr_hdlr_main()
1071 pipe_t *pipe; in _port_persist_all_pipes() local
1073 TAILQ_FOREACH(pipe, &port->pipes_idle_tailq, tailq_entry) { in _port_persist_all_pipes()
1074 if (!pipe->cs_flags.persist) { in _port_persist_all_pipes()
1083 TAILQ_FOREACH(pipe, &port->pipes_idle_tailq, tailq_entry) { in _port_persist_all_pipes()
1084 pipe->cs_flags.reset_lock = 1; in _port_persist_all_pipes()
1085 usbh_hal_chan_free(port->hal, pipe->chan_obj); in _port_persist_all_pipes()
1092 pipe_t *pipe; in _port_recover_all_pipes() local
1093 TAILQ_FOREACH(pipe, &port->pipes_idle_tailq, tailq_entry) { in _port_recover_all_pipes()
1094 pipe->cs_flags.persist = 0; in _port_recover_all_pipes()
1095 pipe->cs_flags.reset_lock = 0; in _port_recover_all_pipes()
1096 usbh_hal_chan_alloc(port->hal, pipe->chan_obj, (void *)pipe); in _port_recover_all_pipes()
1097 usbh_hal_chan_set_ep_char(port->hal, pipe->chan_obj, &pipe->ep_char); in _port_recover_all_pipes()
1104 pipe_t *pipe; in _port_check_all_pipes_halted() local
1105 TAILQ_FOREACH(pipe, &port->pipes_active_tailq, tailq_entry) { in _port_check_all_pipes_halted()
1106 if (pipe->state != HCD_PIPE_STATE_HALTED) { in _port_check_all_pipes_halted()
1111 TAILQ_FOREACH(pipe, &port->pipes_idle_tailq, tailq_entry) { in _port_check_all_pipes_halted()
1112 if (pipe->state != HCD_PIPE_STATE_HALTED) { in _port_check_all_pipes_halted()
1715 static esp_err_t _pipe_cmd_halt(pipe_t *pipe) in _pipe_cmd_halt() argument
1720 if (pipe->state == HCD_PIPE_STATE_HALTED) { in _pipe_cmd_halt()
1725 if (pipe->port->flags.conn_dev_ena //Skip halting the underlying channel if the port is invalid in _pipe_cmd_halt()
1726 && !usbh_hal_chan_request_halt(pipe->chan_obj)) { //Check if the channel is already halted in _pipe_cmd_halt()
1728 pipe->cs_flags.waiting_halt = 1; in _pipe_cmd_halt()
1729 _internal_pipe_event_wait(pipe); in _pipe_cmd_halt()
1731 assert(pipe->state == HCD_PIPE_STATE_HALTED); in _pipe_cmd_halt()
1734 usbh_hal_chan_mark_halted(pipe->chan_obj); in _pipe_cmd_halt()
1735 pipe->state = HCD_PIPE_STATE_HALTED; in _pipe_cmd_halt()
1742 static esp_err_t _pipe_cmd_flush(pipe_t *pipe) in _pipe_cmd_flush() argument
1746 if (pipe->state != HCD_PIPE_STATE_HALTED) { in _pipe_cmd_flush()
1751 bool canceled = pipe->port->flags.conn_dev_ena; in _pipe_cmd_flush()
1754 call_pipe_cb = _buffer_flush_all(pipe, canceled); in _pipe_cmd_flush()
1756 if (pipe->num_urb_pending > 0) { in _pipe_cmd_flush()
1759 TAILQ_FOREACH(urb, &pipe->pending_urb_tailq, tailq_entry) { in _pipe_cmd_flush()
1765 if (pipe->ep_char.type == USB_PRIV_XFER_TYPE_ISOCHRONOUS) { in _pipe_cmd_flush()
1774 TAILQ_CONCAT(&pipe->done_urb_tailq, &pipe->pending_urb_tailq, tailq_entry); in _pipe_cmd_flush()
1775 pipe->num_urb_done += pipe->num_urb_pending; in _pipe_cmd_flush()
1776 pipe->num_urb_pending = 0; in _pipe_cmd_flush()
1782 pipe->callback((hcd_pipe_handle_t)pipe, HCD_PIPE_EVENT_URB_DONE, pipe->callback_arg, false); in _pipe_cmd_flush()
1790 static esp_err_t _pipe_cmd_clear(pipe_t *pipe) in _pipe_cmd_clear() argument
1794 if (pipe->state != HCD_PIPE_STATE_HALTED || !pipe->port->flags.conn_dev_ena) { in _pipe_cmd_clear()
1799 pipe->state = HCD_PIPE_STATE_ACTIVE; in _pipe_cmd_clear()
1800 if (pipe->num_urb_pending > 0) { in _pipe_cmd_clear()
1802 while (_buffer_can_fill(pipe)) { in _pipe_cmd_clear()
1803 _buffer_fill(pipe); in _pipe_cmd_clear()
1807 if (_buffer_can_exec(pipe)) { in _pipe_cmd_clear()
1808 _buffer_exec(pipe); in _pipe_cmd_clear()
1845 pipe_t *pipe = calloc(1, sizeof(pipe_t)); in hcd_pipe_alloc() local
1848 if (pipe == NULL|| chan_obj == NULL) { in hcd_pipe_alloc()
1861 TAILQ_INIT(&pipe->pending_urb_tailq); in hcd_pipe_alloc()
1862 TAILQ_INIT(&pipe->done_urb_tailq); in hcd_pipe_alloc()
1864 pipe->buffers[i] = buffers[i]; in hcd_pipe_alloc()
1866 pipe->multi_buffer_control.buffer_num_to_fill = NUM_BUFFERS; in hcd_pipe_alloc()
1867 pipe->port = port; in hcd_pipe_alloc()
1868 pipe->chan_obj = chan_obj; in hcd_pipe_alloc()
1871 memcpy(&pipe->ep_char, &ep_char, sizeof(usbh_hal_ep_char_t)); in hcd_pipe_alloc()
1872 pipe->state = HCD_PIPE_STATE_ACTIVE; in hcd_pipe_alloc()
1873 pipe->callback = pipe_config->callback; in hcd_pipe_alloc()
1874 pipe->callback_arg = pipe_config->callback_arg; in hcd_pipe_alloc()
1875 pipe->context = pipe_config->context; in hcd_pipe_alloc()
1884 bool chan_allocated = usbh_hal_chan_alloc(port->hal, pipe->chan_obj, (void *) pipe); in hcd_pipe_alloc()
1890 usbh_hal_chan_set_ep_char(port->hal, pipe->chan_obj, &pipe->ep_char); in hcd_pipe_alloc()
1892 TAILQ_INSERT_TAIL(&port->pipes_idle_tailq, pipe, tailq_entry); in hcd_pipe_alloc()
1896 *pipe_hdl = (hcd_pipe_handle_t)pipe; in hcd_pipe_alloc()
1904 free(pipe); in hcd_pipe_alloc()
1910 pipe_t *pipe = (pipe_t *)pipe_hdl; in hcd_pipe_free() local
1913 HCD_CHECK_FROM_CRIT(!pipe->multi_buffer_control.buffer_is_executing in hcd_pipe_free()
1914 && !pipe->cs_flags.has_urb in hcd_pipe_free()
1915 && !pipe->cs_flags.reset_lock, in hcd_pipe_free()
1918 TAILQ_REMOVE(&pipe->port->pipes_idle_tailq, pipe, tailq_entry); in hcd_pipe_free()
1919 pipe->port->num_pipes_idle--; in hcd_pipe_free()
1920 usbh_hal_chan_free(pipe->port->hal, pipe->chan_obj); in hcd_pipe_free()
1925 buffer_block_free(pipe->buffers[i]); in hcd_pipe_free()
1927 free(pipe->chan_obj); in hcd_pipe_free()
1928 free(pipe); in hcd_pipe_free()
1934 pipe_t *pipe = (pipe_t *)pipe_hdl; in hcd_pipe_update_mps() local
1937 HCD_CHECK_FROM_CRIT(!pipe->cs_flags.pipe_cmd_processing && in hcd_pipe_update_mps()
1938 !pipe->cs_flags.has_urb && in hcd_pipe_update_mps()
1939 !pipe->cs_flags.reset_lock, in hcd_pipe_update_mps()
1941 pipe->ep_char.mps = mps; in hcd_pipe_update_mps()
1943 usbh_hal_chan_set_ep_char(pipe->port->hal, pipe->chan_obj, &pipe->ep_char); in hcd_pipe_update_mps()
1950 pipe_t *pipe = (pipe_t *)pipe_hdl; in hcd_pipe_update_dev_addr() local
1953 HCD_CHECK_FROM_CRIT(!pipe->cs_flags.pipe_cmd_processing && in hcd_pipe_update_dev_addr()
1954 !pipe->cs_flags.has_urb && in hcd_pipe_update_dev_addr()
1955 !pipe->cs_flags.reset_lock, in hcd_pipe_update_dev_addr()
1957 pipe->ep_char.dev_addr = dev_addr; in hcd_pipe_update_dev_addr()
1959 usbh_hal_chan_set_ep_char(pipe->port->hal, pipe->chan_obj, &pipe->ep_char); in hcd_pipe_update_dev_addr()
1966 pipe_t *pipe = (pipe_t *)pipe_hdl; in hcd_pipe_update_callback() local
1969 HCD_CHECK_FROM_CRIT(!pipe->cs_flags.pipe_cmd_processing && in hcd_pipe_update_callback()
1970 !pipe->cs_flags.has_urb && in hcd_pipe_update_callback()
1971 !pipe->cs_flags.reset_lock, in hcd_pipe_update_callback()
1973 pipe->callback = callback; in hcd_pipe_update_callback()
1974 pipe->callback_arg = user_arg; in hcd_pipe_update_callback()
1981 pipe_t *pipe = (pipe_t *)pipe_hdl; in hcd_pipe_set_persist_reset() local
1984 HCD_CHECK_FROM_CRIT(!pipe->cs_flags.pipe_cmd_processing && in hcd_pipe_set_persist_reset()
1985 !pipe->cs_flags.has_urb && in hcd_pipe_set_persist_reset()
1986 !pipe->cs_flags.reset_lock, in hcd_pipe_set_persist_reset()
1988 pipe->cs_flags.persist = 1; in hcd_pipe_set_persist_reset()
1995 pipe_t *pipe = (pipe_t *)pipe_hdl; in hcd_pipe_get_context() local
1998 ret = pipe->context; in hcd_pipe_get_context()
2006 pipe_t *pipe = (pipe_t *)pipe_hdl; in hcd_pipe_get_state() local
2008 ret = pipe->state; in hcd_pipe_get_state()
2015 pipe_t *pipe = (pipe_t *)pipe_hdl; in hcd_pipe_command() local
2020 if (pipe->cs_flags.reset_lock) { in hcd_pipe_command()
2023 pipe->cs_flags.pipe_cmd_processing = 1; in hcd_pipe_command()
2026 ret = _pipe_cmd_halt(pipe); in hcd_pipe_command()
2030 ret = _pipe_cmd_flush(pipe); in hcd_pipe_command()
2034 ret = _pipe_cmd_clear(pipe); in hcd_pipe_command()
2038 pipe->cs_flags.pipe_cmd_processing = 0; in hcd_pipe_command()
2046 pipe_t *pipe = (pipe_t *)pipe_hdl; in hcd_pipe_get_event() local
2049 ret = pipe->last_event; in hcd_pipe_get_event()
2050 pipe->last_event = HCD_PIPE_EVENT_NONE; in hcd_pipe_get_event()
2183 static void _buffer_fill(pipe_t *pipe) in _buffer_fill() argument
2186 urb_t *urb = TAILQ_FIRST(&pipe->pending_urb_tailq); in _buffer_fill()
2187 assert(pipe->num_urb_pending > 0 && urb != NULL); in _buffer_fill()
2188 TAILQ_REMOVE(&pipe->pending_urb_tailq, urb, tailq_entry); in _buffer_fill()
2189 pipe->num_urb_pending--; in _buffer_fill()
2192 assert(pipe->multi_buffer_control.buffer_num_to_exec <= NUM_BUFFERS); in _buffer_fill()
2193 dma_buffer_block_t *buffer_to_fill = pipe->buffers[pipe->multi_buffer_control.wr_idx]; in _buffer_fill()
2196 bool is_in = pipe->ep_char.bEndpointAddress & USB_B_ENDPOINT_ADDRESS_EP_DIR_MASK; in _buffer_fill()
2197 int mps = pipe->ep_char.mps; in _buffer_fill()
2199 switch (pipe->ep_char.type) { in _buffer_fill()
2206 if (pipe->multi_buffer_control.buffer_num_to_exec == 0) { in _buffer_fill()
2208 uint32_t cur_frame_num = usbh_hal_port_get_cur_frame_num(pipe->port->hal); in _buffer_fill()
2209 …uint32_t cur_mod_idx_no_offset = (cur_frame_num - pipe->ep_char.periodic.phase_offset_frames) & (X… in _buffer_fill()
2211 …st_interval_mod_idx_no_offset = (cur_mod_idx_no_offset / pipe->ep_char.periodic.interval) * pipe->… in _buffer_fill()
2212 …uint32_t next_interval_idx_no_offset = (last_interval_mod_idx_no_offset + pipe->ep_char.periodic.i… in _buffer_fill()
2214 … if (next_interval_idx_no_offset - cur_mod_idx_no_offset > (pipe->ep_char.periodic.interval / 2) in _buffer_fill()
2216 …start_idx = (next_interval_idx_no_offset + pipe->ep_char.periodic.phase_offset_frames) & (XFER_LIS… in _buffer_fill()
2219 …start_idx = (next_interval_idx_no_offset + pipe->ep_char.periodic.interval + pipe->ep_char.period… in _buffer_fill()
2223 … uint32_t prev_buffer_idx = (pipe->multi_buffer_control.wr_idx - 1) & (NUM_BUFFERS - 1); in _buffer_fill()
2224 dma_buffer_block_t *prev_filled_buffer = pipe->buffers[prev_buffer_idx]; in _buffer_fill()
2227 …_buffer_fill_isoc(buffer_to_fill, transfer, is_in, mps, (int)pipe->ep_char.periodic.interval, star… in _buffer_fill()
2246 pipe->multi_buffer_control.wr_idx++; in _buffer_fill()
2247 pipe->multi_buffer_control.buffer_num_to_fill--; in _buffer_fill()
2248 pipe->multi_buffer_control.buffer_num_to_exec++; in _buffer_fill()
2251 static void _buffer_exec(pipe_t *pipe) in _buffer_exec() argument
2253 …assert(pipe->multi_buffer_control.rd_idx != pipe->multi_buffer_control.wr_idx || pipe->multi_buffe… in _buffer_exec()
2254 dma_buffer_block_t *buffer_to_exec = pipe->buffers[pipe->multi_buffer_control.rd_idx]; in _buffer_exec()
2259 switch (pipe->ep_char.type) { in _buffer_exec()
2264 usbh_hal_chan_set_dir(pipe->chan_obj, false); //Setup stage is always OUT in _buffer_exec()
2265 usbh_hal_chan_set_pid(pipe->chan_obj, 0); //Setup stage always has a PID of DATA0 in _buffer_exec()
2292 pipe->multi_buffer_control.buffer_is_executing = 1; in _buffer_exec()
2293 … usbh_hal_chan_activate(pipe->chan_obj, buffer_to_exec->xfer_desc_list, desc_list_len, start_idx); in _buffer_exec()
2296 static void _buffer_exec_cont(pipe_t *pipe) in _buffer_exec_cont() argument
2299 assert(pipe->ep_char.type == USB_PRIV_XFER_TYPE_CTRL); in _buffer_exec_cont()
2300 dma_buffer_block_t *buffer_inflight = pipe->buffers[pipe->multi_buffer_control.rd_idx]; in _buffer_exec_cont()
2322 usbh_hal_chan_set_dir(pipe->chan_obj, next_dir_is_in); in _buffer_exec_cont()
2323 usbh_hal_chan_set_pid(pipe->chan_obj, next_pid); in _buffer_exec_cont()
2324 …usbh_hal_chan_activate(pipe->chan_obj, buffer_inflight->xfer_desc_list, XFER_LIST_LEN_CTRL, buffer… in _buffer_exec_cont()
2471 static void _buffer_parse(pipe_t *pipe) in _buffer_parse() argument
2473 assert(pipe->multi_buffer_control.buffer_num_to_parse > 0); in _buffer_parse()
2474 dma_buffer_block_t *buffer_to_parse = pipe->buffers[pipe->multi_buffer_control.fr_idx]; in _buffer_parse()
2476 bool is_in = pipe->ep_char.bEndpointAddress & USB_B_ENDPOINT_ADDRESS_EP_DIR_MASK; in _buffer_parse()
2477 int mps = pipe->ep_char.mps; in _buffer_parse()
2482 switch (pipe->ep_char.type) { in _buffer_parse()
2513 TAILQ_INSERT_TAIL(&pipe->done_urb_tailq, urb, tailq_entry); in _buffer_parse()
2514 pipe->num_urb_done++; in _buffer_parse()
2516 pipe->multi_buffer_control.fr_idx++; in _buffer_parse()
2517 pipe->multi_buffer_control.buffer_num_to_parse--; in _buffer_parse()
2518 pipe->multi_buffer_control.buffer_num_to_fill++; in _buffer_parse()
2521 static bool _buffer_flush_all(pipe_t *pipe, bool canceled) in _buffer_flush_all() argument
2523 int cur_num_to_mark_done = pipe->multi_buffer_control.buffer_num_to_exec; in _buffer_flush_all()
2526 _buffer_done(pipe, 0, HCD_PIPE_EVENT_NONE, canceled); in _buffer_flush_all()
2528 int cur_num_to_parse = pipe->multi_buffer_control.buffer_num_to_parse; in _buffer_flush_all()
2530 _buffer_parse(pipe); in _buffer_flush_all()
2544 pipe_t *pipe = (pipe_t *)pipe_hdl; in hcd_urb_enqueue() local
2548 …HCD_CHECK_FROM_CRIT(pipe->port->state == HCD_PORT_STATE_ENABLED //The pipe's port must be … in hcd_urb_enqueue()
2549 … && pipe->state == HCD_PIPE_STATE_ACTIVE //The pipe must be in the correct state in hcd_urb_enqueue()
2550 …&& !pipe->cs_flags.pipe_cmd_processing //Pipe cannot currently be processing a pipe c… in hcd_urb_enqueue()
2551 …&& !pipe->cs_flags.reset_lock, //Pipe cannot be persisting through a port res… in hcd_urb_enqueue()
2554 urb->hcd_ptr = (void *)pipe; in hcd_urb_enqueue()
2557 TAILQ_INSERT_TAIL(&pipe->pending_urb_tailq, urb, tailq_entry); in hcd_urb_enqueue()
2558 pipe->num_urb_pending++; in hcd_urb_enqueue()
2560 if (_buffer_can_fill(pipe)) { in hcd_urb_enqueue()
2561 _buffer_fill(pipe); in hcd_urb_enqueue()
2563 if (_buffer_can_exec(pipe)) { in hcd_urb_enqueue()
2564 _buffer_exec(pipe); in hcd_urb_enqueue()
2566 if (!pipe->cs_flags.has_urb) { in hcd_urb_enqueue()
2568 TAILQ_REMOVE(&pipe->port->pipes_idle_tailq, pipe, tailq_entry); in hcd_urb_enqueue()
2569 TAILQ_INSERT_TAIL(&pipe->port->pipes_active_tailq, pipe, tailq_entry); in hcd_urb_enqueue()
2570 pipe->port->num_pipes_idle--; in hcd_urb_enqueue()
2571 pipe->port->num_pipes_queued++; in hcd_urb_enqueue()
2572 pipe->cs_flags.has_urb = 1; in hcd_urb_enqueue()
2580 pipe_t *pipe = (pipe_t *)pipe_hdl; in hcd_urb_dequeue() local
2584 if (pipe->num_urb_done > 0) { in hcd_urb_dequeue()
2585 urb = TAILQ_FIRST(&pipe->done_urb_tailq); in hcd_urb_dequeue()
2586 TAILQ_REMOVE(&pipe->done_urb_tailq, urb, tailq_entry); in hcd_urb_dequeue()
2587 pipe->num_urb_done--; in hcd_urb_dequeue()
2589 …assert(urb->hcd_ptr == (void *)pipe && urb->hcd_var == URB_HCD_STATE_DONE); //The URB's reserved … in hcd_urb_dequeue()
2592 if (pipe->cs_flags.has_urb in hcd_urb_dequeue()
2593 && pipe->num_urb_pending == 0 && pipe->num_urb_done == 0 in hcd_urb_dequeue()
2594 …&& pipe->multi_buffer_control.buffer_num_to_exec == 0 && pipe->multi_buffer_control.buffer_num_to_… in hcd_urb_dequeue()
2596 TAILQ_REMOVE(&pipe->port->pipes_active_tailq, pipe, tailq_entry); in hcd_urb_dequeue()
2597 TAILQ_INSERT_TAIL(&pipe->port->pipes_idle_tailq, pipe, tailq_entry); in hcd_urb_dequeue()
2598 pipe->port->num_pipes_idle++; in hcd_urb_dequeue()
2599 pipe->port->num_pipes_queued--; in hcd_urb_dequeue()
2600 pipe->cs_flags.has_urb = 0; in hcd_urb_dequeue()
2617 pipe_t *pipe = (pipe_t *)urb->hcd_ptr; in hcd_urb_abort() local
2619 TAILQ_REMOVE(&pipe->pending_urb_tailq, urb, tailq_entry); in hcd_urb_abort()
2620 pipe->num_urb_pending--; in hcd_urb_abort()
2622 TAILQ_INSERT_TAIL(&pipe->done_urb_tailq, urb, tailq_entry); in hcd_urb_abort()
2623 pipe->num_urb_done++; in hcd_urb_abort()