30 #define UHCI_BAR_SIZE 0x14 33 #define UHCI_USBCMD 0x00 36 #define UHCI_USBCMD_MAX64 0x0080 39 #define UHCI_USBCMD_HCRESET 0x0002 42 #define UHCI_USBCMD_RUN 0x0001 45 #define UHCI_USBSTS 0x02 48 #define UHCI_USBSTS_HCHALTED 0x0020 51 #define UHCI_USBSTS_USBINT 0x0001 54 #define UHCI_FLBASEADD 0x08 57 #define UHCI_PORTSC(port) ( 0x0e + ( (port) << 1 ) ) 60 #define UHCI_PORTSC_PR 0x0200 63 #define UHCI_PORTSC_LS 0x0100 66 #define UHCI_PORTSC_PEC 0x0008 69 #define UHCI_PORTSC_PED 0x0004 72 #define UHCI_PORTSC_CSC 0x0002 75 #define UHCI_PORTSC_CCS 0x0001 78 #define UHCI_PORTSC_CHANGE ( UHCI_PORTSC_CSC | UHCI_PORTSC_PEC ) 81 #define UHCI_LINK_DEPTH_FIRST 0x00000004UL 84 #define UHCI_LINK_TYPE_QH 0x00000002UL 87 #define UHCI_LINK_TERMINATE 0x00000001UL 90 #define UHCI_FRAMES 1024 115 #define UHCI_LEN_MASK 0x7ff 118 #define UHCI_ACTUAL_LEN( actual ) ( ( (actual) + 1 ) & UHCI_LEN_MASK ) 121 #define UHCI_STATUS_ACTIVE 0x80 124 #define UHCI_STATUS_STALLED 0x40 127 #define UHCI_STATUS_BUFFER 0x20 130 #define UHCI_STATUS_BABBLE 0x10 133 #define UHCI_STATUS_NAK 0x08 136 #define UHCI_STATUS_CRC_TIMEOUT 0x04 139 #define UHCI_STATUS_BITSTUFF 0x02 142 #define UHCI_FL_SPD 0x20 145 #define UHCI_FL_CERR( count ) ( (count) << 3 ) 148 #define UHCI_FL_CERR_MAX UHCI_FL_CERR ( 3 ) 151 #define UHCI_FL_LS 0x04 154 #define UHCI_FL_IOC 0x01 157 #define UHCI_CONTROL_PID( pid ) ( (pid) << 0 ) 160 #define UHCI_CONTROL_PID_MASK UHCI_CONTROL_PID ( 0xff ) 163 #define UHCI_CONTROL_DEVICE( address ) ( (address) << 8 ) 166 #define UHCI_CONTROL_ENDPOINT( address ) ( (address) << 15 ) 169 #define UHCI_CONTROL_TOGGLE ( 1 << 19 ) 172 #define UHCI_CONTROL_LEN( len ) ( ( ( (len) - 1 ) & UHCI_LEN_MASK ) << 21 ) 179 #define UHCI_DATA_PACKET( control ) ( ! ( control & 0x04 ) ) 182 #define UHCI_SHORT_PACKET( control, actual ) \ 183 ( ( ( (control) >> 21 ) ^ (actual) ) & UHCI_LEN_MASK ) 186 #define UHCI_USBLEGSUP 0xc0 189 #define UHCI_USBLEGSUP_DEFAULT 0x2000 228 #define UHCI_RING_COUNT 16 292 #define UHCI_STOP_MAX_WAIT_MS 100 298 #define UHCI_RESET_MAX_WAIT_MS 500 304 #define UHCI_PORT_ENABLE_MAX_WAIT_MS 500 unsigned int cons
Consumer counter.
unsigned int prod
Producer counter.
struct uhci_frame_list * frame
Frame list.
struct uhci_queue_head * head
Asynchronous queue head.
uint32_t link
Link pointer.
struct list_head async
Asynchronous schedule.
static unsigned int uhci_ring_fill(struct uhci_ring *ring)
Calculate space used in transfer ring.
#define UHCI_RING_COUNT
Number of transfer descriptors in a ring.
struct uhci_device * uhci
UHCI device.
static unsigned int uhci_ring_remaining(struct uhci_ring *ring)
Calculate space remaining in transfer ring.
uint32_t current
Current transfer descriptor.
unsigned int prod
Producer counter.
uint32_t link[UHCI_FRAMES]
Link pointer.
A doubly-linked list entry (or list head)
struct list_head periodic
Periodic schedule.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
struct uhci_queue_head * head
Queue head.
struct uhci_ring ring
Transfer ring.
unsigned int companion
EHCI companion controller bus:dev.fn address (if any)
uint16_t actual
Actual length.
unsigned long regs
Registers.
struct list_head endpoints
List of all endpoints.
#define UHCI_FRAMES
Number of frames in frame list.
struct io_buffer * iobuf
I/O buffer.
size_t len
Completed data length.
struct uhci_transfer * xfer[UHCI_RING_COUNT]
Transfers.
struct list_head schedule
Endpoint schedule.
struct usb_endpoint * ep
USB endpoint.
uint32_t control
Base control word.
struct uhci_transfer * end
End of transfer ring (if non-empty)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
Universal Serial Bus (USB)
uint32_t data
Buffer pointer.
uint32_t link
Horizontal link pointer.
struct list_head list
List of all endpoints.
unsigned int cons
Consumer counter.
struct uhci_transfer_descriptor * desc
Transfer descriptors.
size_t mtu
Maximum packet length.
struct usb_bus * bus
USB bus.