46#define XHC_MICROSECOND_TO_NANOSECOND(Time) (MultU64x32((Time), 1000))
51#define XHC_1_MICROSECOND (1)
55#define XHC_1_MILLISECOND (1000)
60#define XHC_GENERIC_TIMEOUT (10 * 1000)
65#define XHC_RESET_TIMEOUT (1000)
70#define XHC_RESET_RECOVERY_DELAY (10 * 1000)
75#define XHC_ASYNC_TIMER_INTERVAL EFI_TIMER_PERIOD_MILLISECONDS(1)
81#define XHC_TPL TPL_NOTIFY
83#define CMD_RING_TRB_NUMBER 0x100
84#define TR_RING_TRB_NUMBER 0x100
85#define ERST_NUMBER 0x01
86#define EVENT_RING_TRB_NUMBER 0x200
92#define INT_INTER_ASYNC 4
94#define EFI_LIST_CONTAINER(Entry, Type, Field) BASE_CR(Entry, Type, Field)
96#define XHC_LOW_32BIT(Addr64) ((UINT32)(((UINTN)(Addr64)) & 0xFFFFFFFF))
97#define XHC_HIGH_32BIT(Addr64) ((UINT32)(RShiftU64((UINT64)(UINTN)(Addr64), 32) & 0xFFFFFFFF))
98#define XHC_BIT_IS_SET(Data, Bit) ((BOOLEAN)(((Data) & (Bit)) == (Bit)))
100#define XHC_REG_BIT_IS_SET(Xhc, Offset, Bit) \
101 (XHC_BIT_IS_SET(XhcReadOpReg ((Xhc), (Offset)), (Bit)))
103#define XHCI_IS_DATAIN(EndpointAddr) XHC_BIT_IS_SET((EndpointAddr), 0x80)
105#define XHCI_INSTANCE_SIG SIGNATURE_32 ('x', 'h', 'c', 'i')
106#define XHC_FROM_THIS(a) CR(a, USB_XHCI_INSTANCE, Usb2Hc, XHCI_INSTANCE_SIG)
108#define USB_DESC_TYPE_HUB 0x29
109#define USB_DESC_TYPE_HUB_SUPER_SPEED 0x2a
116#define USB_REQUEST_TYPE(Dir, Type, Target) \
117 ((UINT8)((((Dir) == EfiUsbDataIn ? 0x01 : 0) << 7) | (Type) | (Target)))
135 UINT8 HubContrCurrent;
181 VOID *EndpointTransferRing[31];
197 UINT8 ActiveConfiguration;
201 UINT8 *ActiveAlternateSetting;
207 UINT64 OriginalPciAttributes;
232 UINT32 MaxScratchpadBufs;
233 UINT64 *ScratchEntry;
234 UINTN *ScratchEntryMap;
235 UINT32 ExtCapRegBase;
236 UINT32 UsbLegSupOffset;
237 UINT32 DebugCapSupOffset;
238 UINT32 Usb2SupOffset;
239 UINT32 Usb3SupOffset;
263 BOOLEAN Support64BitDma;
352 OUT UINT8 *PortNumber,
353 OUT UINT8 *Is64BitCapable
508 IN UINT8 DeviceAddress,
509 IN UINT8 DeviceSpeed,
517 OUT UINT32 *TransferResult
554 IN UINT8 DeviceAddress,
555 IN UINT8 EndPointAddress,
556 IN UINT8 DeviceSpeed,
558 IN UINT8 DataBuffersNumber,
559 IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],
561 IN OUT UINT8 *DataToggle,
564 OUT UINT32 *TransferResult
600 IN UINT8 DeviceAddress,
601 IN UINT8 EndPointAddress,
602 IN UINT8 DeviceSpeed,
604 IN BOOLEAN IsNewTransfer,
605 IN OUT UINT8 *DataToggle,
610 IN VOID *Context OPTIONAL
644 IN UINT8 DeviceAddress,
645 IN UINT8 EndPointAddress,
646 IN UINT8 DeviceSpeed,
650 IN OUT UINT8 *DataToggle,
653 OUT UINT32 *TransferResult
681 IN UINT8 DeviceAddress,
682 IN UINT8 EndPointAddress,
683 IN UINT8 DeviceSpeed,
685 IN UINT8 DataBuffersNumber,
686 IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
689 OUT UINT32 *TransferResult
719 IN UINT8 DeviceAddress,
720 IN UINT8 EndPointAddress,
721 IN UINT8 DeviceSpeed,
723 IN UINT8 DataBuffersNumber,
724 IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
753 IN OUT UINT64 *PreviousTick
EFI_STATUS(EFIAPI * EFI_ASYNC_USB_TRANSFER_CALLBACK)(IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Status)
EFI_STATUS EFIAPI XhcDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI XhcSetRootHubPortFeature(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, IN EFI_USB_PORT_FEATURE PortFeature)
EFI_STATUS EFIAPI XhcReset(IN EFI_USB2_HC_PROTOCOL *This, IN UINT16 Attributes)
EFI_STATUS EFIAPI XhcAsyncIsochronousTransfer(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN UINT8 DataBuffersNumber, IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM], IN UINTN DataLength, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack, IN VOID *Context)
EFI_STATUS EFIAPI XhcControlTransfer(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN EFI_USB_DEVICE_REQUEST *Request, IN EFI_USB_DATA_DIRECTION TransferDirection, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN UINTN Timeout, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
EFI_STATUS EFIAPI XhcGetRootHubPortStatus(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, OUT EFI_USB_PORT_STATUS *PortStatus)
EFI_STATUS EFIAPI XhcDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
UINT64 XhcGetElapsedTicks(IN OUT UINT64 *PreviousTick)
EFI_STATUS EFIAPI XhcSetState(IN EFI_USB2_HC_PROTOCOL *This, IN EFI_USB_HC_STATE State)
EFI_STATUS EFIAPI XhcClearRootHubPortFeature(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, IN EFI_USB_PORT_FEATURE PortFeature)
EFI_STATUS EFIAPI XhcGetCapability(IN EFI_USB2_HC_PROTOCOL *This, OUT UINT8 *MaxSpeed, OUT UINT8 *PortNumber, OUT UINT8 *Is64BitCapable)
EFI_STATUS EFIAPI XhcIsochronousTransfer(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN UINT8 DataBuffersNumber, IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM], IN UINTN DataLength, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
EFI_STATUS EFIAPI XhcAsyncInterruptTransfer(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN BOOLEAN IsNewTransfer, IN OUT UINT8 *DataToggle, IN UINTN PollingInterval, IN UINTN DataLength, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction, IN VOID *Context OPTIONAL)
UINT64 XhcConvertTimeToTicks(UINT64 Time)
EFI_STATUS EFIAPI XhcGetState(IN EFI_USB2_HC_PROTOCOL *This, OUT EFI_USB_HC_STATE *State)
EFI_STATUS EFIAPI XhcDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS EFIAPI XhcSyncInterruptTransfer(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN OUT UINT8 *DataToggle, IN UINTN Timeout, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
EFI_STATUS EFIAPI XhcBulkTransfer(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN UINT8 DataBuffersNumber, IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM], IN OUT UINTN *DataLength, IN OUT UINT8 *DataToggle, IN UINTN Timeout, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
UINT8 CapLength
Capability Register Length.
XHC_HCSPARAMS2 HcSParams2
Structural Parameters 2.
UINT32 DBOff
Doorbell Offset.
XHC_HCCPARAMS HcCParams
Capability Parameters.
UINT32 RTSOff
Runtime Register Space Offset.
XHC_HCSPARAMS1 HcSParams1
Structural Parameters 1.