xHCI
include/drivers/usb/xhci.h View source View on GitHubStructs
Section titled “Structs”xhci_cap_regs
Section titled “xhci_cap_regs” struct xhci_cap_regs (10 fields) source
xhci_port_regs
Section titled “xhci_port_regs” struct xhci_port_regs (4 fields) source
xhci_usbcmd
Section titled “xhci_usbcmd” struct xhci_usbcmd (1 field) source
union uint32_t raw struct uint32_t run_stop : 1 uint32_t host_controller_reset : 1 uint32_t interrupter_enable : 1 uint32_t host_system_error_en : 1 uint32_t reserved0 : 3 uint32_t light_host_controller_reset : 1 uint32_t controller_save_state : 1 uint32_t controller_restore_state : 1 uint32_t enable_wrap_event : 1 uint32_t enable_u3_mf_index : 1 uint32_t reserved1 : 1 uint32_t cem_enable : 1 uint32_t extended_tbc_enable : 1 uint32_t extended_tbc_trb_status_enable : 1 uint32_t vtio_enable : 1 uint32_t reserved2 : 15 xhci_slot_ctx
Section titled “xhci_slot_ctx” struct xhci_slot_ctx (18 fields) source
Page 444
uint32_t route_string : 20 Location in USB topology
uint32_t speed : 4 Speed of the device
uint32_t reserved0 : 1 uint32_t mtt : 1 Set to ‘1’ by software if this is a high speed hub that supports multiple TTs
uint32_t hub : 1 Set to ‘1’ by software if this is a USB hub, 0 if function
uint32_t context_entries : 5 Index of the last valid endpoint context within this structure
uint32_t max_exit_latency : 16 In microseconds, worst case time it takes to wake up all links in path to device
uint32_t root_hub_port : 8 Root hub port number used to access the USB device
uint32_t num_ports : 8 If this is a hub, this is set by software to identify downstream ports supported by the hub
uint32_t parent_hub_slot_id : 8 Slot ID of the parent high-speed hub
uint32_t parent_port_number : 8 Port number of the parent high-speed hub
uint32_t parent_think_time : 2 Think time of the parent high-speed hub
uint32_t reserved1 : 4 uint32_t interrupter_target : 10 Index of the interrupter to events generated by this slot
uint32_t usb_device_address : 8 Address of USB device assigned by xHC
uint32_t reserved2 : 19 uint32_t slot_state : 5 0 - disabled/enabled, 1 - default, 2 - addressed, 3 - configured, rest reserved
uint32_t reserved3[4] xhci_ep_ctx
Section titled “xhci_ep_ctx” struct xhci_ep_ctx (18 fields) source
Refer to page 450 of the XHCI specification
uint32_t ep_state : 3 The current operational state of the endpoint 0 - Disabled (non-operational) 1 - Running 2 - Halted 3 - Stopped 4 - Error - SW can manipulate the transfer ring 5-7 - Reserved
uint32_t reserved1 : 5 uint32_t mult : 2 Maximum number of bursts in an interval that this endpoint supports. Zero-based value, 0-3 is 1-4 bursts 0 for all endpoint types except SS Isochronous
uint32_t max_pstreams : 5 Maximum Primary streams this endpoint supports. If this is ‘0’, the TR dequeue pointer should point to a transfer ring. If this is > ‘0’ the TR dequeue pointer points to a Primary Stream Context Array.
uint32_t lsa : 1 Linear Stream Array, identifies how an ID stream is interpreted ‘1’ disables Secondary Stream Arrays Linear index into Primary Stream Array Valid values are MaxPstreams 1 - 15
uint32_t interval : 8 Period between consecutive requests to a USB endpoint, expressed in 125 microsecond increments. Interval of 0 means period of 125us. A value of 1 means a period of 250us, etc.
uint32_t max_esit_payload_hi : 8 Max Endpoint Service Time Interval Payload High If LEC is ‘1’ this is the high order 8 bits of the max ESIT payload value. If this is ‘0’, then this is reserved
uint32_t reserved2 : 1 uint32_t error_count : 2 Two bit down count, identifying the number of consecutive USB-bus errors allowed while executing a TD.
uint32_t ep_type : 3 Endpoint type 0 - Not valid 1 - Isochronous Out 2 - Bulk Out 3 - Interrupt Out 4 - Control Bidirectional 5 - Isochronous In 6 - Bulk In 7 - Interrupt In
uint32_t reserved3 : 1 uint32_t host_initiate_disable : 1 The field affects Stream enabled endpoints allowing the HI stream selection feature to be disabled for the endpoint. Setting to ‘1’ disables the HI stream selection feature. ‘0’ enables normal stream operation
uint32_t max_burst_size : 8 Maximum number of consecutive USB transactions per scheduling opportunity. 0-based, 0-15 means 1-16
uint32_t max_packet_size : 16 Max packet size in bytes that this endpoint is capable of sending or receiving when configured.
uint32_t average_trb_length : 16 Average length of TRBs executed by this endpoint. Must be > ‘0’
uint32_t max_esit_payload_lo : 16 Low order 16 bits of max ESIT payload. Represends the total number of bytes this endpoint will transfer during an ESIT
uint32_t reserved5[3] xhci_input_ctrl_ctx
Section titled “xhci_input_ctrl_ctx” struct xhci_input_ctrl_ctx (7 fields) source
Refer to page 461 of the XHCI specification
uint32_t drop_flags Single bitfields to identify which device context data structs should be disabled by command. ‘1’ disables the respective EP CTX.
First two bits reserved
uint32_t add_flags Single bitfields to identify which device CTX data structures should be evaluated or enabled by command. ‘1’ enables the respective CTX
uint32_t reserved[5] uint32_t config : 8 If CIC = ‘1’ and CIE = ‘1’, and this input CTX is associated with a Configure Endpoint command, this field contains the value of the Standard Configuration Descriptor bConfiguration field associated with this command. Otherwise, clear to ‘0’
uint32_t interface_num : 8 If CIC = ‘1’ and CIE = ‘1’, and this input CTX is associated with a Configure Endpoint Command, and this command was issued due to a SET_INTERFACE request, this contains the Standard Interface Descriptor bInterfaceNumber field associated with the command. Otherwise, clear to ‘0’
uint32_t alternate_setting : 8 If CIC = ‘1’ and CIE = ‘1’, and this input CTX is associated with a Configure Endpoint command, and the command was issued due to a SET_INTERFACE request, then this field contains the value of the Standard Interface Descriptor bAlternateSetting field associated with the command. Otherwise, clear to ‘0’.
uint32_t reserved1 : 8 xhci_input_ctx
Section titled “xhci_input_ctx” struct xhci_input_ctx (3 fields) source
Refer to page 460 of the XHCI Spec
struct xhci_input_ctrl_ctx ctrl_ctx struct xhci_slot_ctx slot_ctx struct xhci_ep_ctx ep_ctx[31] xhci_device_ctx
Section titled “xhci_device_ctx” struct xhci_device_ctx (2 fields) source
struct xhci_slot_ctx slot_ctx struct xhci_ep_ctx ep_ctx[32] Endpoint 1–31 (ep0 separate)
xhci_op_regs
Section titled “xhci_op_regs” struct xhci_op_regs (11 fields) source
xhci_trb
Section titled “xhci_trb”xhci_ring
Section titled “xhci_ring” struct xhci_ring (7 fields) source
xhci_erst_entry
Section titled “xhci_erst_entry” struct xhci_erst_entry (3 fields) source
xhci_interrupter_regs
Section titled “xhci_interrupter_regs” struct xhci_interrupter_regs (6 fields) source
xhci_dcbaa
Section titled “xhci_dcbaa” struct xhci_dcbaa (1 field) source
Device context base address array - check page 441
uint64_t ptrs[256] xhci_ext_cap
Section titled “xhci_ext_cap”xhci_slot
Section titled “xhci_slot” struct xhci_slot (7 fields) source
atomic(enum xhci_slot_state) state struct xhci_device *dev uint8_t slot_id Just so everyone knows what slot we are
refcount_t refcount As soon as this drops to zero we clear the ep_rings
struct usb_device *udev xhci_port
Section titled “xhci_port” struct xhci_port (8 fields) source
xhci_device
Section titled “xhci_device” struct xhci_device (23 fields) source
struct pci_device *pci struct xhci_input_ctx *input_ctx struct xhci_cap_regs cc_mem_io *cap_regs Capability registers
struct xhci_op_regs cc_mem_io *op_regs Operational registers
struct xhci_interrupter_regs cc_mem_io *intr_regs Interrupter regs
struct xhci_dcbaa *dcbaa struct xhci_erst_entry *erst struct xhci_port_regs cc_mem_io *port_regs uint64_t ports struct xhci_slot slots[XHCI_SLOT_COUNT] struct xhci_port port_info[XHCI_PORT_COUNT] struct list_head requests[XHCI_REQ_LIST_MAX] size_t num_devices struct usb_controller *controller atomic_bool worker_waiting xhci_command
Section titled “xhci_command” struct xhci_command (7 fields) source
xhci_request
Section titled “xhci_request” struct xhci_request (17 fields) source
enum xhci_request_command_type type Tied back to the USB request
enum xhci_request_list list_owner struct usb_request *urb struct xhci_command *command uint64_t trb_phys uint8_t port What port is this for? Used to match requests on disconnect
volatile uint8_t completion_code the raw completion code for this request
volatile uint64_t return_parameter volatile uint32_t return_status volatile uint32_t return_control uint64_t generation volatile enum xhci_request_status status void (*callback)(struct xhci_device *, struct xhci_request *) void *private xhci_return
Section titled “xhci_return”xhci_slot_state
Section titled “xhci_slot_state” enum xhci_slot_state (4 variants) source
xhci_port_state
Section titled “xhci_port_state” enum xhci_port_state (5 variants) source
xhci_request_status
Section titled “xhci_request_status” enum xhci_request_status (5 variants) source
XHCI_REQUEST_SENDING The first 3 statuses indicate list state.
OUTGOING requests have a TRB, and have rang the doorbell.
WAITING requests cannot be currently satisfied because the command ring is full.
PROCESSED requests have been handled by the ISR with a success state. Technically they run in the worker thread but the status is set from ISR.
DISCONNECT requests occur when a port is disconnected and the request no longer goes anywhere (because the port is gone)
XHCI_REQUEST_OK XHCI_REQUEST_CANCELLED XHCI_REQUEST_DISCONNECT XHCI_REQUEST_ERR xhci_request_list
Section titled “xhci_request_list” enum xhci_request_list (5 variants) source
xhci_request_command_type
Section titled “xhci_request_command_type” enum xhci_request_command_type (15 variants) source
Abstract command types, not 1:1
XHCI_CMD_TYPE_NONE XHCI_CMD_TYPE_ENABLE_SLOT XHCI_CMD_TYPE_DISABLE_SLOT XHCI_CMD_TYPE_ADDRESS_DEVICE XHCI_CMD_TYPE_CONFIGURE_ENDPOINT XHCI_CMD_TYPE_EVALUATE_CONTEXT XHCI_CMD_TYPE_RESET_ENDPOINT XHCI_CMD_TYPE_STOP_ENDPOINT XHCI_CMD_TYPE_SET_TR_DEQUEUE_POINTER XHCI_CMD_TYPE_RESET_DEVICE XHCI_CMD_TYPE_FORCE_EVENT XHCI_CMD_TYPE_INTERRUPT_TRANSFER XHCI_CMD_TYPE_CONTROL_TRANSFER XHCI_CMD_TYPE_NO_OP XHCI_CMD_TYPE_NORMAL ‘misc.‘
Functions
Section titled “Functions”xhci_slot_state_str
Section titled “xhci_slot_state_str”const char * xhci_slot_state_str(enum xhci_slot_state s) source xhci_port_state_str
Section titled “xhci_port_state_str”const char * xhci_port_state_str(enum xhci_port_state s) source xhci_request_command_type_str
Section titled “xhci_request_command_type_str”const char * xhci_request_command_type_str(enum xhci_request_command_type t) source xhci_init
Section titled “xhci_init”void xhci_init(
uint8_t bus,
uint8_t slot,
uint8_t func,
struct pci_device *dev
) source Macros
Section titled “Macros”XHCI_DEVICE_TIMEOUT
Section titled “XHCI_DEVICE_TIMEOUT”#define XHCI_DEVICE_TIMEOUT 1000 source TRB_RING_SIZE
Section titled “TRB_RING_SIZE”#define TRB_RING_SIZE 256 source XHCI_PORT_COUNT
Section titled “XHCI_PORT_COUNT”#define XHCI_PORT_COUNT 64 source XHCI_SLOT_COUNT
Section titled “XHCI_SLOT_COUNT”#define XHCI_SLOT_COUNT 255 source XHCI_INPUT_CTX_ADD_FLAGS
Section titled “XHCI_INPUT_CTX_ADD_FLAGS”XHCI_SETUP_TRANSFER_TYPE_NONE
Section titled “XHCI_SETUP_TRANSFER_TYPE_NONE”#define XHCI_SETUP_TRANSFER_TYPE_NONE 0 source XHCI_SETUP_TRANSFER_TYPE_OUT
Section titled “XHCI_SETUP_TRANSFER_TYPE_OUT”#define XHCI_SETUP_TRANSFER_TYPE_OUT 2 source XHCI_SETUP_TRANSFER_TYPE_IN
Section titled “XHCI_SETUP_TRANSFER_TYPE_IN”#define XHCI_SETUP_TRANSFER_TYPE_IN 3 source XHCI_USBSTS_HCH
Section titled “XHCI_USBSTS_HCH”#define XHCI_USBSTS_HCH 1 source HC halted
XHCI_USBSTS_HSE
Section titled “XHCI_USBSTS_HSE”XHCI_USBSTS_EI
Section titled “XHCI_USBSTS_EI”XHCI_USBSTS_PCD
Section titled “XHCI_USBSTS_PCD”XHCI_IMAN_MASK
Section titled “XHCI_IMAN_MASK”#define XHCI_IMAN_MASK 0x2 source XHCI_IMAN_INT_PENDING
Section titled “XHCI_IMAN_INT_PENDING”#define XHCI_IMAN_INT_PENDING 0x1 source XHCI_IMAN_INT_ENABLE
Section titled “XHCI_IMAN_INT_ENABLE”#define XHCI_IMAN_INT_ENABLE 0x2 source XHCI_ENDPOINT_TYPE_INVAL
Section titled “XHCI_ENDPOINT_TYPE_INVAL”#define XHCI_ENDPOINT_TYPE_INVAL 0 source XHCI_ENDPOINT_TYPE_ISOCH_OUT
Section titled “XHCI_ENDPOINT_TYPE_ISOCH_OUT”#define XHCI_ENDPOINT_TYPE_ISOCH_OUT 1 source XHCI_ENDPOINT_TYPE_BULK_OUT
Section titled “XHCI_ENDPOINT_TYPE_BULK_OUT”#define XHCI_ENDPOINT_TYPE_BULK_OUT 2 source XHCI_ENDPOINT_TYPE_INTERRUPT_OUT
Section titled “XHCI_ENDPOINT_TYPE_INTERRUPT_OUT”#define XHCI_ENDPOINT_TYPE_INTERRUPT_OUT 3 source XHCI_ENDPOINT_TYPE_CONTROL_BI
Section titled “XHCI_ENDPOINT_TYPE_CONTROL_BI”#define XHCI_ENDPOINT_TYPE_CONTROL_BI 4 source XHCI_ENDPOINT_TYPE_ISOCH_IN
Section titled “XHCI_ENDPOINT_TYPE_ISOCH_IN”#define XHCI_ENDPOINT_TYPE_ISOCH_IN 5 source XHCI_ENDPOINT_TYPE_BULK_IN
Section titled “XHCI_ENDPOINT_TYPE_BULK_IN”#define XHCI_ENDPOINT_TYPE_BULK_IN 6 source XHCI_ENDPOINT_TYPE_INTERRUPT_IN
Section titled “XHCI_ENDPOINT_TYPE_INTERRUPT_IN”#define XHCI_ENDPOINT_TYPE_INTERRUPT_IN 7 source XHCI_EXT_CAP_ID_LEGACY_SUPPORT
Section titled “XHCI_EXT_CAP_ID_LEGACY_SUPPORT”#define XHCI_EXT_CAP_ID_LEGACY_SUPPORT 1 source In scatter gathers, the first TRD must NOT point to a page-aligned boundary. Following TRDs must point to page-aligned boundaries.
XHCI_EXT_CAP_ID_USB
Section titled “XHCI_EXT_CAP_ID_USB”#define XHCI_EXT_CAP_ID_USB 2 source TRB_TYPE_RESERVED
Section titled “TRB_TYPE_RESERVED”#define TRB_TYPE_RESERVED 0x00 source TRB Types (bits 10–15 in control word)
TRB_TYPE_NORMAL
Section titled “TRB_TYPE_NORMAL”#define TRB_TYPE_NORMAL 0x01 source TRB_TYPE_SETUP_STAGE
Section titled “TRB_TYPE_SETUP_STAGE”#define TRB_TYPE_SETUP_STAGE 0x02 source TRB_TYPE_DATA_STAGE
Section titled “TRB_TYPE_DATA_STAGE”#define TRB_TYPE_DATA_STAGE 0x03 source TRB_TYPE_STATUS_STAGE
Section titled “TRB_TYPE_STATUS_STAGE”#define TRB_TYPE_STATUS_STAGE 0x04 source TRB_TYPE_ISOCH
Section titled “TRB_TYPE_ISOCH”#define TRB_TYPE_ISOCH 0x05 source TRB_TYPE_LINK
Section titled “TRB_TYPE_LINK”#define TRB_TYPE_LINK 0x06 source TRB_TYPE_EVENT_DATA
Section titled “TRB_TYPE_EVENT_DATA”#define TRB_TYPE_EVENT_DATA 0x07 source TRB_TYPE_NO_OP
Section titled “TRB_TYPE_NO_OP”#define TRB_TYPE_NO_OP 0x08 source Command TRBs
TRB_TYPE_NO_OP_COMMAND
Section titled “TRB_TYPE_NO_OP_COMMAND”#define TRB_TYPE_NO_OP_COMMAND 0x8 source TRB_TYPE_ENABLE_SLOT
Section titled “TRB_TYPE_ENABLE_SLOT”#define TRB_TYPE_ENABLE_SLOT 0x09 source TRB_TYPE_DISABLE_SLOT
Section titled “TRB_TYPE_DISABLE_SLOT”#define TRB_TYPE_DISABLE_SLOT 0x0A source TRB_TYPE_ADDRESS_DEVICE
Section titled “TRB_TYPE_ADDRESS_DEVICE”#define TRB_TYPE_ADDRESS_DEVICE 0x0B source TRB_TYPE_CONFIGURE_ENDPOINT
Section titled “TRB_TYPE_CONFIGURE_ENDPOINT”#define TRB_TYPE_CONFIGURE_ENDPOINT 0x0C source TRB_TYPE_EVALUATE_CONTEXT
Section titled “TRB_TYPE_EVALUATE_CONTEXT”#define TRB_TYPE_EVALUATE_CONTEXT 0x0D source TRB_TYPE_RESET_ENDPOINT
Section titled “TRB_TYPE_RESET_ENDPOINT”#define TRB_TYPE_RESET_ENDPOINT 0x0E source TRB_TYPE_STOP_ENDPOINT
Section titled “TRB_TYPE_STOP_ENDPOINT”#define TRB_TYPE_STOP_ENDPOINT 0x0F source TRB_TYPE_SET_TR_DEQUEUE_POINTER
Section titled “TRB_TYPE_SET_TR_DEQUEUE_POINTER”#define TRB_TYPE_SET_TR_DEQUEUE_POINTER 0x10 source TRB_TYPE_RESET_DEVICE
Section titled “TRB_TYPE_RESET_DEVICE”#define TRB_TYPE_RESET_DEVICE 0x11 source TRB_TYPE_FORCE_EVENT
Section titled “TRB_TYPE_FORCE_EVENT”#define TRB_TYPE_FORCE_EVENT 0x12 source TRB_TYPE_NEGOTIATE_BW
Section titled “TRB_TYPE_NEGOTIATE_BW”#define TRB_TYPE_NEGOTIATE_BW 0x13 source TRB_TYPE_SET_LATENCY_TOLERANCE
Section titled “TRB_TYPE_SET_LATENCY_TOLERANCE”#define TRB_TYPE_SET_LATENCY_TOLERANCE 0x14 source TRB_TYPE_GET_PORT_BANDWIDTH
Section titled “TRB_TYPE_GET_PORT_BANDWIDTH”#define TRB_TYPE_GET_PORT_BANDWIDTH 0x15 source TRB_TYPE_FORCE_HEADER
Section titled “TRB_TYPE_FORCE_HEADER”#define TRB_TYPE_FORCE_HEADER 0x16 source TRB_TYPE_NO_OP_2_COMMAND
Section titled “TRB_TYPE_NO_OP_2_COMMAND”#define TRB_TYPE_NO_OP_2_COMMAND 0x17 source Event TRBs
TRB_TYPE_TRANSFER_EVENT
Section titled “TRB_TYPE_TRANSFER_EVENT”#define TRB_TYPE_TRANSFER_EVENT 0x20 source TRB_TYPE_COMMAND_COMPLETION
Section titled “TRB_TYPE_COMMAND_COMPLETION”#define TRB_TYPE_COMMAND_COMPLETION 0x21 source TRB_TYPE_PORT_STATUS_CHANGE
Section titled “TRB_TYPE_PORT_STATUS_CHANGE”#define TRB_TYPE_PORT_STATUS_CHANGE 0x22 source TRB_TYPE_BANDWIDTH_REQUEST
Section titled “TRB_TYPE_BANDWIDTH_REQUEST”#define TRB_TYPE_BANDWIDTH_REQUEST 0x23 source TRB_TYPE_DOORBELL_EVENT
Section titled “TRB_TYPE_DOORBELL_EVENT”#define TRB_TYPE_DOORBELL_EVENT 0x24 source TRB_TYPE_HOST_CONTROLLER_EVENT
Section titled “TRB_TYPE_HOST_CONTROLLER_EVENT”#define TRB_TYPE_HOST_CONTROLLER_EVENT 0x25 source TRB_TYPE_DEVICE_NOTIFICATION
Section titled “TRB_TYPE_DEVICE_NOTIFICATION”#define TRB_TYPE_DEVICE_NOTIFICATION 0x26 source TRB_TYPE_MFINDEX_WRAP
Section titled “TRB_TYPE_MFINDEX_WRAP”#define TRB_TYPE_MFINDEX_WRAP 0x27 source TRB_FIELD
Section titled “TRB_FIELD”#define TRB_FIELD(val, lo, hi) source TRB_TYPE
Section titled “TRB_TYPE”TRB_SLOT
Section titled “TRB_SLOT”TRB_EP
Section titled “TRB_EP”TRB_CC
Section titled “TRB_CC”TRB_PORT
Section titled “TRB_PORT”#define TRB_PORT(parameter) source TRB_SET_TYPE
Section titled “TRB_SET_TYPE”#define TRB_SET_TYPE(val) source Expansion
#define TRB_SET_TYPE(val) (((val) & 0x3F) << 10) TRB_SET_CYCLE
Section titled “TRB_SET_CYCLE”#define TRB_SET_CYCLE(val) source Expansion
#define TRB_SET_CYCLE(val) (((val) & 1)) TRB_SET_INTERRUPTER_TARGET
Section titled “TRB_SET_INTERRUPTER_TARGET”#define TRB_SET_INTERRUPTER_TARGET(target) source Expansion
#define TRB_SET_INTERRUPTER_TARGET(target) (((uint32_t) (target) & 0x3FF) << 22) TRB_CYCLE_BIT
Section titled “TRB_CYCLE_BIT”TRB_ENT_BIT
Section titled “TRB_ENT_BIT”TRB_ISP_BIT
Section titled “TRB_ISP_BIT”TRB_NS_BIT
Section titled “TRB_NS_BIT”TRB_CH_BIT
Section titled “TRB_CH_BIT”TRB_IOC_BIT
Section titled “TRB_IOC_BIT”TRB_IDT_BIT
Section titled “TRB_IDT_BIT”TRB_BEI_BIT
Section titled “TRB_BEI_BIT”TRB_TOGGLE_CYCLE_BIT
Section titled “TRB_TOGGLE_CYCLE_BIT”TRB_TYPE_SHIFT
Section titled “TRB_TYPE_SHIFT”#define TRB_TYPE_SHIFT 10 source TRB_SET_SLOT_ID
Section titled “TRB_SET_SLOT_ID”#define TRB_SET_SLOT_ID(id) source Expansion
#define TRB_SET_SLOT_ID(id) (((id) & 0xFF) << 24) PORTSC_CCS
Section titled “PORTSC_CCS”PORTSC_PED
Section titled “PORTSC_PED”PORTSC_OCA
Section titled “PORTSC_OCA”PORTSC_RESET
Section titled “PORTSC_RESET”PORTSC_PR
Section titled “PORTSC_PR”PORTSC_PLSE
Section titled “PORTSC_PLSE”PORTSC_PRES
Section titled “PORTSC_PRES”PORTSC_PP
Section titled “PORTSC_PP”PORTSC_SPEED_MASK
Section titled “PORTSC_SPEED_MASK”#define PORTSC_SPEED_MASK (0xF << 10) source Bits 10–13: Port Speed
PORTSC_SPEED_SHIFT
Section titled “PORTSC_SPEED_SHIFT”#define PORTSC_SPEED_SHIFT 10 source PORTSC_PLS_SHIFT
Section titled “PORTSC_PLS_SHIFT”#define PORTSC_PLS_SHIFT 5 source PORTSC_PLS_MASK
Section titled “PORTSC_PLS_MASK”#define PORTSC_PLS_MASK (0xF << 5) source PORTSC_LWS
Section titled “PORTSC_LWS”PORTSC_CSC
Section titled “PORTSC_CSC”PORTSC_PEC
Section titled “PORTSC_PEC”PORTSC_WRC
Section titled “PORTSC_WRC”PORTSC_OCC
Section titled “PORTSC_OCC”PORTSC_PRC
Section titled “PORTSC_PRC”PORTSC_PLC
Section titled “PORTSC_PLC”PORTSC_CEC
Section titled “PORTSC_CEC”PORTSC_PLS_POLLING
Section titled “PORTSC_PLS_POLLING”#define PORTSC_PLS_POLLING 7 source PORTSC_PLS_U0
Section titled “PORTSC_PLS_U0”#define PORTSC_PLS_U0 0 source PORTSC_PLS_U2
Section titled “PORTSC_PLS_U2”#define PORTSC_PLS_U2 2 source PORTSC_PLS_U3
Section titled “PORTSC_PLS_U3”#define PORTSC_PLS_U3 3 source PORTSC_PLS_RXDETECT
Section titled “PORTSC_PLS_RXDETECT”#define PORTSC_PLS_RXDETECT 5 source PORTSC_IND
Section titled “PORTSC_IND”PORTSC_LWS_BIT
Section titled “PORTSC_LWS_BIT”PORTSC_DR
Section titled “PORTSC_DR”PORTSC_WPR
Section titled “PORTSC_WPR”PORT_SPEED_FULL
Section titled “PORT_SPEED_FULL”#define PORT_SPEED_FULL 1 source USB 1.1 Full Speed
PORT_SPEED_LOW
Section titled “PORT_SPEED_LOW”#define PORT_SPEED_LOW 2 source USB 1.1 Low Speed
PORT_SPEED_HIGH
Section titled “PORT_SPEED_HIGH”#define PORT_SPEED_HIGH 3 source USB 2.0 High Speed
PORT_SPEED_SUPER
Section titled “PORT_SPEED_SUPER”#define PORT_SPEED_SUPER 4 source USB 3.0 SuperSpeed
PORT_SPEED_SUPER_PLUS
Section titled “PORT_SPEED_SUPER_PLUS”#define PORT_SPEED_SUPER_PLUS 5 source USB 3.1 Gen2 (SuperSpeed+)
CC_SUCCESS
Section titled “CC_SUCCESS”#define CC_SUCCESS 1 source CC_DATA_BUFFER_ERROR
Section titled “CC_DATA_BUFFER_ERROR”#define CC_DATA_BUFFER_ERROR 2 source CC_BABBLE_DETECTED
Section titled “CC_BABBLE_DETECTED”#define CC_BABBLE_DETECTED 3 source CC_USB_TRANSACTION_ERROR
Section titled “CC_USB_TRANSACTION_ERROR”#define CC_USB_TRANSACTION_ERROR 4 source CC_TRB_ERROR
Section titled “CC_TRB_ERROR”#define CC_TRB_ERROR 5 source CC_STALL_ERROR
Section titled “CC_STALL_ERROR”#define CC_STALL_ERROR 6 source CC_RESOURCE_ERROR
Section titled “CC_RESOURCE_ERROR”#define CC_RESOURCE_ERROR 7 source CC_BANDWIDTH_ERROR
Section titled “CC_BANDWIDTH_ERROR”#define CC_BANDWIDTH_ERROR 8 source CC_NO_SLOTS_AVAILABLE
Section titled “CC_NO_SLOTS_AVAILABLE”#define CC_NO_SLOTS_AVAILABLE 9 source CC_INVALID_STREAM_TYPE
Section titled “CC_INVALID_STREAM_TYPE”#define CC_INVALID_STREAM_TYPE 10 source CC_SLOT_NOT_ENABLED_ERROR
Section titled “CC_SLOT_NOT_ENABLED_ERROR”#define CC_SLOT_NOT_ENABLED_ERROR 11 source CC_ENDPOINT_NOT_ENABLED
Section titled “CC_ENDPOINT_NOT_ENABLED”#define CC_ENDPOINT_NOT_ENABLED 12 source CC_SHORT_PACKET
Section titled “CC_SHORT_PACKET”#define CC_SHORT_PACKET 13 source CC_RING_UNDERRUN
Section titled “CC_RING_UNDERRUN”#define CC_RING_UNDERRUN 14 source CC_RING_OVERRUN
Section titled “CC_RING_OVERRUN”#define CC_RING_OVERRUN 15 source CC_VF_EVENT_RING_FULL_ERROR
Section titled “CC_VF_EVENT_RING_FULL_ERROR”#define CC_VF_EVENT_RING_FULL_ERROR 16 source CC_PARAMETER_ERROR
Section titled “CC_PARAMETER_ERROR”#define CC_PARAMETER_ERROR 17 source CC_BANDWIDTH_OVERRUN_ERROR
Section titled “CC_BANDWIDTH_OVERRUN_ERROR”#define CC_BANDWIDTH_OVERRUN_ERROR 18 source CC_CONTEXT_STATE_ERROR
Section titled “CC_CONTEXT_STATE_ERROR”#define CC_CONTEXT_STATE_ERROR 19 source CC_NO_PING_RESPONSE_ERROR
Section titled “CC_NO_PING_RESPONSE_ERROR”#define CC_NO_PING_RESPONSE_ERROR 20 source CC_EVENT_RING_FULL
Section titled “CC_EVENT_RING_FULL”#define CC_EVENT_RING_FULL 21 source CC_INCOMPATIBLE_DEVICE
Section titled “CC_INCOMPATIBLE_DEVICE”#define CC_INCOMPATIBLE_DEVICE 22 source CC_MISSED_SERVICE
Section titled “CC_MISSED_SERVICE”#define CC_MISSED_SERVICE 23 source CC_COMMAND_RING_STOPPED
Section titled “CC_COMMAND_RING_STOPPED”#define CC_COMMAND_RING_STOPPED 24 source CC_COMMAND_ABORTED
Section titled “CC_COMMAND_ABORTED”#define CC_COMMAND_ABORTED 25 source CC_STOPPED
Section titled “CC_STOPPED”#define CC_STOPPED 26 source CC_STOPPED_LEN_INVALID
Section titled “CC_STOPPED_LEN_INVALID”#define CC_STOPPED_LEN_INVALID 27 source CC_STOPPED_SHORT_PACKET
Section titled “CC_STOPPED_SHORT_PACKET”#define CC_STOPPED_SHORT_PACKET 28 source CC_MAX_EXIT_LATENCY_TOO_LARGE
Section titled “CC_MAX_EXIT_LATENCY_TOO_LARGE”#define CC_MAX_EXIT_LATENCY_TOO_LARGE 29 source xhci_log
Section titled “xhci_log”xhci_warn
Section titled “xhci_warn”#define xhci_warn(fmt, ...) source xhci_error
Section titled “xhci_error”#define xhci_error(fmt, ...) source Expansion
#define xhci_error(fmt, ...) xhci_log(LOG_ERROR, fmt, ##__VA_ARGS__) xhci_info
Section titled “xhci_info”#define xhci_info(fmt, ...) source xhci_debug
Section titled “xhci_debug”#define xhci_debug(fmt, ...) source Expansion
#define xhci_debug(fmt, ...) xhci_log(LOG_DEBUG, fmt, ##__VA_ARGS__) xhci_trace
Section titled “xhci_trace”#define xhci_trace(fmt, ...) source Expansion
#define xhci_trace(fmt, ...) xhci_log(LOG_TRACE, fmt, ##__VA_ARGS__)