23 #define EHCI_MIN_ALIGN 32 30 #define EHCI_MTU 16384 33 #define EHCI_PAGE_ALIGN 4096 36 #define EHCI_BAR PCI_BASE_ADDRESS_0 39 #define EHCI_CAP_CAPLENGTH 0x00 42 #define EHCI_CAP_HCIVERSION 0x02 45 #define EHCI_CAP_HCSPARAMS 0x04 48 #define EHCI_HCSPARAMS_PORTS(params) ( ( (params) >> 0 ) & 0x0f ) 51 #define EHCI_CAP_HCCPARAMS 0x08 54 #define EHCI_HCCPARAMS_ADDR64(params) ( ( (params) >> 0 ) & 0x1 ) 57 #define EHCI_HCCPARAMS_FLSIZE(params) ( ( (params) >> 1 ) & 0x1 ) 60 #define EHCI_HCCPARAMS_EECP(params) ( ( ( (params) >> 8 ) & 0xff ) ) 63 #define EHCI_EECP_ID(eecp) ( ( (eecp) >> 0 ) & 0xff ) 66 #define EHCI_EECP_NEXT(eecp) ( ( ( (eecp) >> 8 ) & 0xff ) ) 69 #define EHCI_EECP_ID_LEGACY 1 72 #define EHCI_USBLEGSUP_BIOS 0x02 75 #define EHCI_USBLEGSUP_BIOS_OWNED 0x01 78 #define EHCI_USBLEGSUP_OS 0x03 81 #define EHCI_USBLEGSUP_OS_OWNED 0x01 84 #define EHCI_USBLEGSUP_CTLSTS 0x04 87 #define EHCI_OP_USBCMD 0x00 90 #define EHCI_USBCMD_RUN 0x00000001UL 93 #define EHCI_USBCMD_HCRST 0x00000002UL 96 #define EHCI_USBCMD_FLSIZE(flsize) ( (flsize) << 2 ) 99 #define EHCI_USBCMD_FLSIZE_MASK EHCI_USBCMD_FLSIZE ( 3 ) 102 #define EHCI_FLSIZE_DEFAULT 0 105 #define EHCI_FLSIZE_SMALL 2 108 #define EHCI_PERIODIC_FRAMES(flsize) ( 1024 >> (flsize) ) 111 #define EHCI_USBCMD_PERIODIC 0x00000010UL 114 #define EHCI_USBCMD_ASYNC 0x00000020UL 117 #define EHCI_USBCMD_ASYNC_ADVANCE 0x000040UL 120 #define EHCI_OP_USBSTS 0x04 123 #define EHCI_USBSTS_USBINT 0x00000001UL 126 #define EHCI_USBSTS_USBERRINT 0x00000002UL 129 #define EHCI_USBSTS_PORT 0x00000004UL 132 #define EHCI_USBSTS_ROLLOVER 0x00000008UL 135 #define EHCI_USBSTS_SYSERR 0x00000010UL 138 #define EHCI_USBSTS_ASYNC_ADVANCE 0x00000020UL 141 #define EHCI_USBSTS_PERIODIC 0x00004000UL 144 #define EHCI_USBSTS_ASYNC 0x00008000UL 147 #define EHCI_USBSTS_HCH 0x00001000UL 150 #define EHCI_USBSTS_CHANGE \ 151 ( EHCI_USBSTS_USBINT | EHCI_USBSTS_USBERRINT | \ 152 EHCI_USBSTS_PORT | EHCI_USBSTS_ROLLOVER | \ 153 EHCI_USBSTS_SYSERR | EHCI_USBSTS_ASYNC_ADVANCE ) 156 #define EHCI_OP_USBINTR 0x08 159 #define EHCI_OP_FRINDEX 0x0c 162 #define EHCI_OP_CTRLDSSEGMENT 0x10 165 #define EHCI_OP_PERIODICLISTBASE 0x14 168 #define EHCI_OP_ASYNCLISTADDR 0x18 171 #define EHCI_OP_CONFIGFLAG 0x40 174 #define EHCI_CONFIGFLAG_CF 0x00000001UL 177 #define EHCI_OP_PORTSC(port) ( 0x40 + ( (port) << 2 ) ) 180 #define EHCI_PORTSC_CCS 0x00000001UL 183 #define EHCI_PORTSC_CSC 0x00000002UL 186 #define EHCI_PORTSC_PED 0x00000004UL 189 #define EHCI_PORTSC_PEC 0x00000008UL 192 #define EHCI_PORTSC_OCC 0x00000020UL 195 #define EHCI_PORTSC_PR 0x00000100UL 198 #define EHCI_PORTSC_LINE_STATUS(portsc) ( ( (portsc) >> 10 ) & 0x3 ) 201 #define EHCI_PORTSC_LINE_STATUS_LOW 0x1 204 #define EHCI_PORTSC_PP 0x00001000UL 207 #define EHCI_PORTSC_OWNER 0x00002000UL 210 #define EHCI_PORTSC_CHANGE \ 211 ( EHCI_PORTSC_CSC | EHCI_PORTSC_PEC | EHCI_PORTSC_OCC ) 214 #define EHCI_LINK_TERMINATE 0x00000001UL 217 #define EHCI_LINK_TYPE(type) ( (type) << 1 ) 220 #define EHCI_LINK_TYPE_QH EHCI_LINK_TYPE ( 1 ) 249 #define EHCI_STATUS_XACT_ERR 0x08 252 #define EHCI_STATUS_BABBLE 0x10 255 #define EHCI_STATUS_BUFFER 0x20 258 #define EHCI_STATUS_HALTED 0x40 261 #define EHCI_STATUS_ACTIVE 0x80 264 #define EHCI_FL_PID(code) ( (code) << 0 ) 267 #define EHCI_FL_PID_OUT EHCI_FL_PID ( 0 ) 270 #define EHCI_FL_PID_IN EHCI_FL_PID ( 1 ) 273 #define EHCI_FL_PID_SETUP EHCI_FL_PID ( 2 ) 276 #define EHCI_FL_CERR( count ) ( (count) << 2 ) 279 #define EHCI_FL_CERR_MAX EHCI_FL_CERR ( 3 ) 282 #define EHCI_FL_IOC 0x80 285 #define EHCI_LEN_MASK 0x7fff 288 #define EHCI_LEN_TOGGLE 0x8000 305 #define EHCI_CHR_ADDRESS( address ) ( (address) << 0 ) 308 #define EHCI_CHR_ENDPOINT( address ) ( ( (address) & 0xf ) << 8 ) 311 #define EHCI_CHR_EPS( eps ) ( (eps) << 12 ) 314 #define EHCI_CHR_EPS_FULL EHCI_CHR_EPS ( 0 ) 317 #define EHCI_CHR_EPS_LOW EHCI_CHR_EPS ( 1 ) 320 #define EHCI_CHR_EPS_HIGH EHCI_CHR_EPS ( 2 ) 323 #define EHCI_CHR_TOGGLE 0x00004000UL 326 #define EHCI_CHR_HEAD 0x00008000UL 329 #define EHCI_CHR_MAX_LEN( len ) ( (len) << 16 ) 332 #define EHCI_CHR_CONTROL 0x08000000UL 335 #define EHCI_CAP_INTR_SCHED( uframe ) ( 1 << ( (uframe) + 0 ) ) 338 #define EHCI_CAP_SPLIT_SCHED( uframe ) ( 1 << ( (uframe) + 8 ) ) 354 #define EHCI_CAP_SPLIT_SCHED_DEFAULT \ 355 ( EHCI_CAP_SPLIT_SCHED ( 2 ) | EHCI_CAP_SPLIT_SCHED ( 3 ) | \ 356 EHCI_CAP_SPLIT_SCHED ( 4 ) | EHCI_CAP_SPLIT_SCHED ( 5 ) | \ 357 EHCI_CAP_SPLIT_SCHED ( 6 ) | EHCI_CAP_SPLIT_SCHED ( 7 ) ) 360 #define EHCI_CAP_TT_HUB( address ) ( (address) << 16 ) 363 #define EHCI_CAP_TT_PORT( port ) ( (port) << 23 ) 366 #define EHCI_CAP_MULT( mult ) ( (mult) << 30 ) 391 #define EHCI_RING_COUNT 64 425 #define EHCI_PORT_POWER_DELAY_MS 20 431 #define EHCI_DISOWN_DELAY_MS 100 437 #define EHCI_USBLEGSUP_MAX_WAIT_MS 100 443 #define EHCI_ASYNC_ADVANCE_MAX_WAIT_MS 100 449 #define EHCI_STOP_MAX_WAIT_MS 100 455 #define EHCI_RESET_MAX_WAIT_MS 500 461 #define EHCI_PORT_RESET_MAX_WAIT_MS 500 480 #define EHCI_FL_TOGGLE 0x8000 unsigned int cons
Consumer counter.
unsigned int ports
Number of ports.
uint32_t high[5]
Extended buffer pointers (high 32 bits)
A transfer descriptor ring.
struct list_head periodic
Periodic schedule.
void * op
Operational registers.
uint32_t ctrldssegment
Control data structure segment.
size_t residual
Residual untransferred data.
uint16_t len
Transfer length.
struct usb_bus * bus
USB bus.
uint32_t link
First queue head.
struct list_head schedule
Endpoint schedule.
uint32_t low[5]
Buffer pointers (low 32 bits)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
uint32_t next
Next transfer descriptor.
A doubly-linked list entry (or list head)
struct ehci_queue_head * head
Queue head.
struct ehci_queue_head * head
Asynchronous queue head.
struct io_buffer ** iobuf
I/O buffers.
unsigned int legacy
USB legacy support capability (if present and enabled)
uint32_t alt
Alternate next transfer descriptor.
struct ehci_device * ehci
EHCI device.
int addr64
64-bit addressing capability
unsigned int prod
Producer counter.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
struct usb_endpoint * ep
USB endpoint.
void * cap
Capability registers.
unsigned int flsize
Frame list size.
struct ehci_transfer_descriptor cache
Transfer descriptor cache.
struct ehci_ring ring
Transfer descriptor ring.
static unsigned int ehci_ring_remaining(struct ehci_ring *ring)
Calculate space remaining in transfer descriptor ring.
A periodic frame list entry.
struct ehci_periodic_frame * frame
Periodic frame list.
unsigned int ehci_companion(struct pci_device *pci)
Locate EHCI companion controller.
struct list_head endpoints
List of all endpoints.
uint8_t reserved[12]
Reserved.
Universal Serial Bus (USB)
unsigned int eecp
EHCI extended capabilities offset.
uint32_t link
Horizontal link pointer.
static unsigned int ehci_ring_fill(struct ehci_ring *ring)
Calculate space used in transfer descriptor ring.
uint32_t cap
Endpoint capabilities.
uint32_t current
Current transfer descriptor.
struct list_head async
Asynchronous schedule.
#define EHCI_RING_COUNT
Number of transfer descriptors in a ring.
struct list_head list
List of all endpoints.
struct ehci_transfer_descriptor * desc
Transfer descriptors.
uint32_t chr
Endpoint characteristics.