Lines Matching +full:full +full:- +full:frame

1 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
3 * hcd.h - DesignWare HS OTG Controller host-mode declarations
5 * Copyright (C) 2004-2013 Synopsys, Inc.
24 * struct dwc2_host_chan - Software host channel descriptor
31 * - USB_SPEED_LOW
32 * - USB_SPEED_FULL
33 * - USB_SPEED_HIGH
35 * - USB_ENDPOINT_XFER_CONTROL: 0
36 * - USB_ENDPOINT_XFER_ISOC: 1
37 * - USB_ENDPOINT_XFER_BULK: 2
38 * - USB_ENDPOINT_XFER_INTR: 3
44 * 3: MDATA (non-Control EP),
47 * (micro)frame
57 * @error_state: True if the error count for this transaction is non-zero
67 * @hub_port: Port of the low/full speed device for the split
69 * - DWC2_HCSPLT_XACTPOS_MID
70 * - DWC2_HCSPLT_XACTPOS_BEGIN
71 * - DWC2_HCSPLT_XACTPOS_END
72 * - DWC2_HCSPLT_XACTPOS_ALL
75 * @schinfo: Scheduling micro-frame bitmap
196 * struct dwc2_tt - dwc2 data associated with a usb_tt
200 * @periodic_bitmaps: Bitmap for which parts of the 1ms frame are accounted
213 * struct dwc2_hs_transfer_time - Info about a transfer on the high speed bus.
229 * struct dwc2_qh - Software queue head structure
233 * - USB_ENDPOINT_XFER_CONTROL
234 * - USB_ENDPOINT_XFER_BULK
235 * - USB_ENDPOINT_XFER_INT
236 * - USB_ENDPOINT_XFER_ISOC
241 * - USB_SPEED_LOW
242 * - USB_SPEED_FULL
243 * - USB_SPEED_HIGH
245 * non-controltransfers. Ignored for control transfers.
247 * - DWC2_HC_PID_DATA0
248 * - DWC2_HC_PID_DATA1
250 * @do_split: Full/low speed endpoint on high-speed hub requires split
260 * @next_active_frame: (Micro)frame _before_ we next need to put something on
263 * the host is in low speed mode this will be a full frame.
269 * Always >= 1 unless the host is in low/full speed mode.
271 * bus. Not used if host is in low or full speed mode (but
272 * note that it IS USED if the device is low or full speed
282 * is not dword-aligned
286 * @qh_list_entry: Entry for QH in either the periodic or non-periodic
295 * @wait_timer: Timer used to wait before re-queuing.
300 * @schedule_low_speed: True if we have a low/full speed component (either the
301 * host is in low/full speed mode or do_split).
302 * @want_wait: We should wait before re-queuing; only matters for non-
309 * be entered in either the non-periodic or periodic schedule.
354 * struct dwc2_qtd - Software queue transfer descriptor (QTD)
362 * - DWC2_HC_PID_DATA0
363 * - DWC2_HC_PID_DATA1
366 * @isoc_split_pos: Position of the ISOC split in full/low speed
367 * @isoc_frame_index: Index of the next frame descriptor for an isochronous
368 * transfer. A frame descriptor describes the buffer
370 * next scheduled (micro)frame of an isochronous transfer.
371 * It also holds status for that transaction. The frame
374 * current frame
379 * @isoc_frame_index_last: Last activated frame (packet) index, used in
396 * non-periodic or periodic schedule for execution. When a QTD is chosen for
434 return (struct usb_hcd *)hsotg->priv; in dwc2_hsotg_to_hcd()
441 * channel is re-assigned. In fact, subsequent handling may cause crashes
472 return pipe->ep_num; in dwc2_hcd_get_ep_num()
477 return pipe->pipe_type; in dwc2_hcd_get_pipe_type()
482 return pipe->maxp; in dwc2_hcd_get_maxp()
487 return pipe->maxp_mult; in dwc2_hcd_get_maxp_mult()
492 return pipe->dev_addr; in dwc2_hcd_get_dev_addr()
497 return pipe->pipe_type == USB_ENDPOINT_XFER_ISOC; in dwc2_hcd_is_pipe_isoc()
502 return pipe->pipe_type == USB_ENDPOINT_XFER_INT; in dwc2_hcd_is_pipe_int()
507 return pipe->pipe_type == USB_ENDPOINT_XFER_BULK; in dwc2_hcd_is_pipe_bulk()
512 return pipe->pipe_type == USB_ENDPOINT_XFER_CONTROL; in dwc2_hcd_is_pipe_control()
517 return pipe->pipe_dir == USB_DIR_IN; in dwc2_hcd_is_pipe_in()
554 list_del(&qtd->qtd_list_entry); in dwc2_hcd_qtd_unlink_and_free()
569 /* Check if QH is non-periodic */
571 ((_qh_ptr_)->ep_type == USB_ENDPOINT_XFER_BULK || \
572 (_qh_ptr_)->ep_type == USB_ENDPOINT_XFER_CONTROL)
582 return hc->ep_type == USB_ENDPOINT_XFER_BULK || in dbg_hc()
583 hc->ep_type == USB_ENDPOINT_XFER_CONTROL; in dbg_hc()
588 return qh->ep_type == USB_ENDPOINT_XFER_BULK || in dbg_qh()
589 qh->ep_type == USB_ENDPOINT_XFER_CONTROL; in dbg_qh()
594 return usb_pipetype(urb->pipe) == PIPE_BULK || in dbg_urb()
595 usb_pipetype(urb->pipe) == PIPE_CONTROL; in dbg_urb()
604 * frame number when the max index frame number is reached.
608 u16 diff = fr_idx1 - fr_idx2; in dwc2_frame_idx_num_gt()
617 * frame number when the max frame number is reached.
621 return ((frame2 - frame1) & HFNUM_MAX_FRNUM) <= (HFNUM_MAX_FRNUM >> 1); in dwc2_frame_num_le()
626 * modulo HFNUM_MAX_FRNUM. This accounts for the rollover of the frame
627 * number when the max frame number is reached.
632 ((frame1 - frame2) & HFNUM_MAX_FRNUM) < (HFNUM_MAX_FRNUM >> 1); in dwc2_frame_num_gt()
636 * Increments frame by the amount specified by inc. The addition is done
639 static inline u16 dwc2_frame_num_inc(u16 frame, u16 inc) in dwc2_frame_num_inc() argument
641 return (frame + inc) & HFNUM_MAX_FRNUM; in dwc2_frame_num_inc()
644 static inline u16 dwc2_frame_num_dec(u16 frame, u16 dec) in dwc2_frame_num_dec() argument
646 return (frame + HFNUM_MAX_FRNUM + 1 - dec) & HFNUM_MAX_FRNUM; in dwc2_frame_num_dec()
649 static inline u16 dwc2_full_frame_num(u16 frame) in dwc2_full_frame_num() argument
651 return (frame & HFNUM_MAX_FRNUM) >> 3; in dwc2_full_frame_num()
654 static inline u16 dwc2_micro_frame_num(u16 frame) in dwc2_micro_frame_num() argument
656 return frame & 0x7; in dwc2_micro_frame_num()
671 return dwc2_urb->status; in dwc2_hcd_urb_get_status()
677 return dwc2_urb->actual_length; in dwc2_hcd_urb_get_actual_length()
682 return dwc2_urb->error_count; in dwc2_hcd_urb_get_error_count()
689 dwc2_urb->iso_descs[desc_num].offset = offset; in dwc2_hcd_urb_set_iso_desc_params()
690 dwc2_urb->iso_descs[desc_num].length = length; in dwc2_hcd_urb_set_iso_desc_params()
696 return dwc2_urb->iso_descs[desc_num].status; in dwc2_hcd_urb_get_iso_desc_status()
702 return dwc2_urb->iso_descs[desc_num].actual_length; in dwc2_hcd_urb_get_iso_desc_actual_length()
708 struct dwc2_qh *qh = ep->hcpriv; in dwc2_hcd_is_bandwidth_allocated()
710 if (qh && !list_empty(&qh->qh_list_entry)) in dwc2_hcd_is_bandwidth_allocated()
719 struct dwc2_qh *qh = ep->hcpriv; in dwc2_hcd_get_ep_bandwidth()
726 return qh->host_us; in dwc2_hcd_get_ep_bandwidth()
736 * dwc2_handle_hcd_intr() - Called on every hardware interrupt
746 * dwc2_hcd_stop() - Halts the DWC_otg host mode operation
753 * dwc2_hcd_is_b_host() - Returns 1 if core currently is acting as B host,
761 * dwc2_hcd_dump_state() - Dumps hsotg state