Showing changes from revision #6 to #7:
Added | Removed | Changed
size_t HAL_USBControllerInfo(int bus, struct usbinfo *info, size_t len)
Entry | |
---|---|
bus | Bus/interface number to query |
info | usbinfo pointer to fill with data |
len | Length of info |
Exit | |
---|---|
- | Returns sizeof( usbinfo ) for valid bus indices |
Returns 0 for invalid bus indices. |
This is an internal call for OS use only and should not be used by user software.
Reads information about the available USB controllers. The information is stored in a usbinfo struct:
struct usbinfo { enum { OHCI = 0, EHCI = 1, MUSBMHDRC = 2, SynopsysDWC = 3, XHCI = 4 } type; /* Controller type */ int32 flags; /* Extra flags */ void *hw; /* Logical address of controller registers */ int devno; /* Device (interrupt) number of controller */ };
The available flags are as follows:
Bit | Meaning |
---|---|
0 | Port power controlled via HAL_USBPortPower (OHCI) |
1 | Port overcurrent status managed via HAL_USBPortDevice, HAL_USBPortIRQStatus, and HAL_USBPortIRQClear (OHCI) |
2 | Reserved for future use |
3 | Must use 32bit access for all registers (EHCI) |
31 | Controller has embedded transaction translator function (EHCI) |
The info structure will only be fully filled in if the supplied len is large enough. If len is too small, only the type field will be filled in.
OHCI, EHCI, MUSBMHDRC and XHCI controllers all use the usbinfo struct described above. DWC controllers extend the struct to provide extra information:
struct usbinfo_dwc { struct usbinfo base; /* Base structure */ int dma_offset; /* Offset to apply to ARM physical addresses to obtain DMA addresses */ void *hw_mphi; /* Logical address of msg based parallel host i/f */ int devno_mphi; /* Device (interrupt) number of msg based parallel host i/f */ };