TianoCore EDK2 master
Loading...
Searching...
No Matches
Xhci.h File Reference

Go to the source code of this file.

Data Structures

struct  USB_CLASSC
 
struct  EFI_USB_HUB_DESCRIPTOR
 
struct  _USB_DEV_CONTEXT
 
struct  _USB_XHCI_INSTANCE
 

Macros

#define XHC_MICROSECOND_TO_NANOSECOND(Time)   (MultU64x32((Time), 1000))
 
#define XHC_1_MICROSECOND   (1)
 
#define XHC_1_MILLISECOND   (1000)
 
#define XHC_GENERIC_TIMEOUT   (10 * 1000)
 
#define XHC_RESET_TIMEOUT   (1000)
 
#define XHC_RESET_RECOVERY_DELAY   (10 * 1000)
 
#define XHC_ASYNC_TIMER_INTERVAL   EFI_TIMER_PERIOD_MILLISECONDS(1)
 
#define XHC_TPL   TPL_NOTIFY
 
#define CMD_RING_TRB_NUMBER   0x100
 
#define TR_RING_TRB_NUMBER   0x100
 
#define ERST_NUMBER   0x01
 
#define EVENT_RING_TRB_NUMBER   0x200
 
#define CMD_INTER   0
 
#define CTRL_INTER   1
 
#define BULK_INTER   2
 
#define INT_INTER   3
 
#define INT_INTER_ASYNC   4
 
#define EFI_LIST_CONTAINER(Entry, Type, Field)   BASE_CR(Entry, Type, Field)
 
#define XHC_LOW_32BIT(Addr64)   ((UINT32)(((UINTN)(Addr64)) & 0xFFFFFFFF))
 
#define XHC_HIGH_32BIT(Addr64)   ((UINT32)(RShiftU64((UINT64)(UINTN)(Addr64), 32) & 0xFFFFFFFF))
 
#define XHC_BIT_IS_SET(Data, Bit)   ((BOOLEAN)(((Data) & (Bit)) == (Bit)))
 
#define XHC_REG_BIT_IS_SET(Xhc, Offset, Bit)    (XHC_BIT_IS_SET(XhcReadOpReg ((Xhc), (Offset)), (Bit)))
 
#define XHCI_IS_DATAIN(EndpointAddr)   XHC_BIT_IS_SET((EndpointAddr), 0x80)
 
#define XHCI_INSTANCE_SIG   SIGNATURE_32 ('x', 'h', 'c', 'i')
 
#define XHC_FROM_THIS(a)   CR(a, USB_XHCI_INSTANCE, Usb2Hc, XHCI_INSTANCE_SIG)
 
#define USB_DESC_TYPE_HUB   0x29
 
#define USB_DESC_TYPE_HUB_SUPER_SPEED   0x2a
 
#define USB_REQUEST_TYPE(Dir, Type, Target)    ((UINT8)((((Dir) == EfiUsbDataIn ? 0x01 : 0) << 7) | (Type) | (Target)))
 

Typedefs

typedef struct _USB_XHCI_INSTANCE USB_XHCI_INSTANCE
 
typedef struct _USB_DEV_CONTEXT USB_DEV_CONTEXT
 

Functions

EFI_STATUS EFIAPI XhcDriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI XhcDriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI XhcDriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 
EFI_STATUS EFIAPI XhcGetCapability (IN EFI_USB2_HC_PROTOCOL *This, OUT UINT8 *MaxSpeed, OUT UINT8 *PortNumber, OUT UINT8 *Is64BitCapable)
 
EFI_STATUS EFIAPI XhcReset (IN EFI_USB2_HC_PROTOCOL *This, IN UINT16 Attributes)
 
EFI_STATUS EFIAPI XhcGetState (IN EFI_USB2_HC_PROTOCOL *This, OUT EFI_USB_HC_STATE *State)
 
EFI_STATUS EFIAPI XhcSetState (IN EFI_USB2_HC_PROTOCOL *This, IN EFI_USB_HC_STATE State)
 
EFI_STATUS EFIAPI XhcGetRootHubPortStatus (IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, OUT EFI_USB_PORT_STATUS *PortStatus)
 
EFI_STATUS EFIAPI XhcSetRootHubPortFeature (IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, IN EFI_USB_PORT_FEATURE PortFeature)
 
EFI_STATUS EFIAPI XhcClearRootHubPortFeature (IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, IN EFI_USB_PORT_FEATURE PortFeature)
 
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 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)
 
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)
 
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 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 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)
 
UINT64 XhcConvertTimeToTicks (UINT64 Time)
 
UINT64 XhcGetElapsedTicks (IN OUT UINT64 *PreviousTick)
 

Variables

EFI_DRIVER_BINDING_PROTOCOL gXhciDriverBinding
 
EFI_COMPONENT_NAME_PROTOCOL gXhciComponentName
 
EFI_COMPONENT_NAME2_PROTOCOL gXhciComponentName2
 

Detailed Description

Provides some data structure definitions used by the XHCI host controller driver.

(C) Copyright 2023 Hewlett Packard Enterprise Development LP
Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Xhci.h.

Macro Definition Documentation

◆ BULK_INTER

#define BULK_INTER   2

Definition at line 90 of file Xhci.h.

◆ CMD_INTER

#define CMD_INTER   0

Definition at line 88 of file Xhci.h.

◆ CMD_RING_TRB_NUMBER

#define CMD_RING_TRB_NUMBER   0x100

Definition at line 83 of file Xhci.h.

◆ CTRL_INTER

#define CTRL_INTER   1

Definition at line 89 of file Xhci.h.

◆ EFI_LIST_CONTAINER

#define EFI_LIST_CONTAINER (   Entry,
  Type,
  Field 
)    BASE_CR(Entry, Type, Field)

Definition at line 94 of file Xhci.h.

◆ ERST_NUMBER

#define ERST_NUMBER   0x01

Definition at line 85 of file Xhci.h.

◆ EVENT_RING_TRB_NUMBER

#define EVENT_RING_TRB_NUMBER   0x200

Definition at line 86 of file Xhci.h.

◆ INT_INTER

#define INT_INTER   3

Definition at line 91 of file Xhci.h.

◆ INT_INTER_ASYNC

#define INT_INTER_ASYNC   4

Definition at line 92 of file Xhci.h.

◆ TR_RING_TRB_NUMBER

#define TR_RING_TRB_NUMBER   0x100

Definition at line 84 of file Xhci.h.

◆ USB_DESC_TYPE_HUB

#define USB_DESC_TYPE_HUB   0x29

Definition at line 108 of file Xhci.h.

◆ USB_DESC_TYPE_HUB_SUPER_SPEED

#define USB_DESC_TYPE_HUB_SUPER_SPEED   0x2a

Definition at line 109 of file Xhci.h.

◆ USB_REQUEST_TYPE

#define USB_REQUEST_TYPE (   Dir,
  Type,
  Target 
)     ((UINT8)((((Dir) == EfiUsbDataIn ? 0x01 : 0) << 7) | (Type) | (Target)))

Definition at line 116 of file Xhci.h.

◆ XHC_1_MICROSECOND

#define XHC_1_MICROSECOND   (1)

Definition at line 51 of file Xhci.h.

◆ XHC_1_MILLISECOND

#define XHC_1_MILLISECOND   (1000)

Definition at line 55 of file Xhci.h.

◆ XHC_ASYNC_TIMER_INTERVAL

#define XHC_ASYNC_TIMER_INTERVAL   EFI_TIMER_PERIOD_MILLISECONDS(1)

Definition at line 75 of file Xhci.h.

◆ XHC_BIT_IS_SET

#define XHC_BIT_IS_SET (   Data,
  Bit 
)    ((BOOLEAN)(((Data) & (Bit)) == (Bit)))

Definition at line 98 of file Xhci.h.

◆ XHC_FROM_THIS

#define XHC_FROM_THIS (   a)    CR(a, USB_XHCI_INSTANCE, Usb2Hc, XHCI_INSTANCE_SIG)

Definition at line 106 of file Xhci.h.

◆ XHC_GENERIC_TIMEOUT

#define XHC_GENERIC_TIMEOUT   (10 * 1000)

Definition at line 60 of file Xhci.h.

◆ XHC_HIGH_32BIT

#define XHC_HIGH_32BIT (   Addr64)    ((UINT32)(RShiftU64((UINT64)(UINTN)(Addr64), 32) & 0xFFFFFFFF))

Definition at line 97 of file Xhci.h.

◆ XHC_LOW_32BIT

#define XHC_LOW_32BIT (   Addr64)    ((UINT32)(((UINTN)(Addr64)) & 0xFFFFFFFF))

Definition at line 96 of file Xhci.h.

◆ XHC_MICROSECOND_TO_NANOSECOND

#define XHC_MICROSECOND_TO_NANOSECOND (   Time)    (MultU64x32((Time), 1000))

Definition at line 46 of file Xhci.h.

◆ XHC_REG_BIT_IS_SET

#define XHC_REG_BIT_IS_SET (   Xhc,
  Offset,
  Bit 
)     (XHC_BIT_IS_SET(XhcReadOpReg ((Xhc), (Offset)), (Bit)))

Definition at line 100 of file Xhci.h.

◆ XHC_RESET_RECOVERY_DELAY

#define XHC_RESET_RECOVERY_DELAY   (10 * 1000)

Definition at line 70 of file Xhci.h.

◆ XHC_RESET_TIMEOUT

#define XHC_RESET_TIMEOUT   (1000)

Definition at line 65 of file Xhci.h.

◆ XHC_TPL

#define XHC_TPL   TPL_NOTIFY

Definition at line 81 of file Xhci.h.

◆ XHCI_INSTANCE_SIG

#define XHCI_INSTANCE_SIG   SIGNATURE_32 ('x', 'h', 'c', 'i')

Definition at line 105 of file Xhci.h.

◆ XHCI_IS_DATAIN

#define XHCI_IS_DATAIN (   EndpointAddr)    XHC_BIT_IS_SET((EndpointAddr), 0x80)

Definition at line 103 of file Xhci.h.

Typedef Documentation

◆ USB_DEV_CONTEXT

Definition at line 36 of file Xhci.h.

◆ USB_XHCI_INSTANCE

Definition at line 35 of file Xhci.h.

Function Documentation

◆ XhcAsyncInterruptTransfer()

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 
)

Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
DeviceAddressTarget device address.
EndPointAddressEndpoint number and its direction encoded in bit 7
DeviceSpeedIndicates device speed.
MaximumPacketLengthMaximum packet size the target endpoint is capable
IsNewTransferIf TRUE, to submit an new asynchronous interrupt transfer If FALSE, to remove the specified asynchronous interrupt.
DataToggleOn input, the initial data toggle to use; on output, it is updated to indicate the next data toggle.
PollingIntervalThe he interval, in milliseconds, that the transfer is polled.
DataLengthThe length of data to receive at the rate specified by PollingInterval.
TranslatorTransaction translator to use.
CallBackFunctionFunction to call at the rate specified by PollingInterval.
ContextContext to CallBackFunction.
Return values
EFI_SUCCESSThe request has been successfully submitted or canceled.
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_OUT_OF_RESOURCESThe request failed due to a lack of resources.
EFI_DEVICE_ERRORThe transfer failed due to host controller error.

Definition at line 1377 of file Xhci.c.

◆ XhcAsyncIsochronousTransfer()

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 
)

Submits Async isochronous transfer to a target USB device.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
DeviceAddressTarget device address.
EndPointAddressEnd point address with its direction.
DeviceSpeedDevice speed, Low speed device doesn't support this type.
MaximumPacketLengthMaximum packet size that the endpoint is capable of sending or receiving.
DataBuffersNumberNumber of data buffers prepared for the transfer.
DataArray of pointers to the buffers of data that will be transmitted to USB device or received from USB device.
DataLengthThe size, in bytes, of the data buffer.
TranslatorTransaction translator to use.
IsochronousCallBackFunction to be called when the transfer complete.
ContextContext passed to the call back function as parameter.
Returns
EFI_UNSUPPORTED Isochronous transfer isn't supported.

Definition at line 1666 of file Xhci.c.

◆ XhcBulkTransfer()

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 
)

Submits bulk transfer to a bulk endpoint of a USB device.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
DeviceAddressTarget device address.
EndPointAddressEndpoint number and its direction in bit 7.
DeviceSpeedDevice speed, Low speed device doesn't support bulk transfer.
MaximumPacketLengthMaximum packet size the endpoint is capable of sending or receiving.
DataBuffersNumberNumber of data buffers prepared for the transfer.
DataArray of pointers to the buffers of data to transmit from or receive into.
DataLengthThe lenght of the data buffer.
DataToggleOn input, the initial data toggle for the transfer; On output, it is updated to to next data toggle to use of the subsequent bulk transfer.
TimeoutIndicates the maximum time, in millisecond, which the transfer is allowed to complete.
TranslatorA pointr to the transaction translator data.
TransferResultA pointer to the detailed result information of the bulk transfer.
Return values
EFI_SUCCESSThe transfer was completed successfully.
EFI_OUT_OF_RESOURCESThe transfer failed due to lack of resource.
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_TIMEOUTThe transfer failed due to timeout.
EFI_DEVICE_ERRORThe transfer failed due to host controller error.

Definition at line 1250 of file Xhci.c.

◆ XhcClearRootHubPortFeature()

EFI_STATUS EFIAPI XhcClearRootHubPortFeature ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT8  PortNumber,
IN EFI_USB_PORT_FEATURE  PortFeature 
)

Clears a feature for the specified root hub port.

Parameters
ThisA pointer to the EFI_USB2_HC_PROTOCOL instance.
PortNumberSpecifies the root hub port whose feature is requested to be cleared.
PortFeatureIndicates the feature selector associated with the feature clear request.
Return values
EFI_SUCCESSThe feature specified by PortFeature was cleared for the USB root hub port specified by PortNumber.
EFI_INVALID_PARAMETERPortNumber is invalid or PortFeature is invalid.
EFI_DEVICE_ERRORCan't read register.

Definition at line 626 of file Xhci.c.

◆ XhcControlTransfer()

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 
)

Submits control transfer to a target USB device.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
DeviceAddressThe target device address.
DeviceSpeedTarget device speed.
MaximumPacketLengthMaximum packet size the default control transfer endpoint is capable of sending or receiving.
RequestUSB device request to send.
TransferDirectionSpecifies the data direction for the data stage
DataData buffer to be transmitted or received from USB device.
DataLengthThe size (in bytes) of the data buffer.
TimeoutIndicates the maximum timeout, in millisecond.
TranslatorTransaction translator to be used by this device.
TransferResultReturn the result of this control transfer.
Return values
EFI_SUCCESSTransfer was completed successfully.
EFI_OUT_OF_RESOURCESThe transfer failed due to lack of resources.
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_TIMEOUTTransfer failed due to timeout.
EFI_DEVICE_ERRORTransfer failed due to host controller or device error.

Definition at line 870 of file Xhci.c.

◆ XhcConvertTimeToTicks()

UINT64 XhcConvertTimeToTicks ( UINT64  Time)

Converts a time in nanoseconds to a performance counter tick count.

Parameters
TimeThe time in nanoseconds to be converted to performance counter ticks.
Returns
Time in nanoseconds converted to ticks.

◆ XhcDriverBindingStart()

EFI_STATUS EFIAPI XhcDriverBindingStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Starting the Usb XHCI Driver.

Parameters
ThisProtocol instance pointer.
ControllerHandle of device to test.
RemainingDevicePathNot used.
Returns
EFI_SUCCESS supports this device.
EFI_UNSUPPORTED do not support this device.
EFI_DEVICE_ERROR cannot be started due to device Error.
EFI_OUT_OF_RESOURCES cannot allocate resources.

Definition at line 1963 of file Xhci.c.

◆ XhcDriverBindingStop()

EFI_STATUS EFIAPI XhcDriverBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Stop this driver on ControllerHandle. Support stopping any child handles created by this driver.

Parameters
ThisProtocol instance pointer.
ControllerHandle of device to stop driver on.
NumberOfChildrenNumber of Children in the ChildHandleBuffer.
ChildHandleBufferList of handles for the children we need to stop.
Returns
EFI_SUCCESS Success.
EFI_DEVICE_ERROR Fail.

Definition at line 2205 of file Xhci.c.

◆ XhcDriverBindingSupported()

EFI_STATUS EFIAPI XhcDriverBindingSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Test to see if this driver supports ControllerHandle. Any ControllerHandle that has Usb2HcProtocol installed will be supported.

Parameters
ThisProtocol instance pointer.
ControllerHandle of device to test.
RemainingDevicePathNot used.
Returns
EFI_SUCCESS This driver supports this device.
EFI_UNSUPPORTED This driver does not support this device.

Definition at line 1725 of file Xhci.c.

◆ XhcGetCapability()

EFI_STATUS EFIAPI XhcGetCapability ( IN EFI_USB2_HC_PROTOCOL This,
OUT UINT8 *  MaxSpeed,
OUT UINT8 *  PortNumber,
OUT UINT8 *  Is64BitCapable 
)

Retrieves the capability of root hub ports.

Parameters
ThisThe EFI_USB2_HC_PROTOCOL instance.
MaxSpeedMax speed supported by the controller.
PortNumberNumber of the root hub ports.
Is64BitCapableWhether the controller supports 64-bit memory addressing.
Return values
EFI_SUCCESSHost controller capability were retrieved successfully.
EFI_INVALID_PARAMETEREither of the three capability pointer is NULL.

Definition at line 109 of file Xhci.c.

◆ XhcGetElapsedTicks()

UINT64 XhcGetElapsedTicks ( IN OUT UINT64 *  PreviousTick)

Computes and returns the elapsed ticks since PreviousTick. The value of PreviousTick is overwritten with the current performance counter value.

Parameters
PreviousTickPointer to PreviousTick count.
Returns
The elapsed ticks since PreviousCount. PreviousCount is overwritten with the current performance counter value.

Definition at line 2383 of file Xhci.c.

◆ XhcGetRootHubPortStatus()

EFI_STATUS EFIAPI XhcGetRootHubPortStatus ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT8  PortNumber,
OUT EFI_USB_PORT_STATUS PortStatus 
)

Retrieves the current status of a USB root hub port.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
PortNumberThe root hub port to retrieve the state from. This value is zero-based.
PortStatusVariable to receive the port state.
Return values
EFI_SUCCESSThe status of the USB root hub port specified. by PortNumber was returned in PortStatus.
EFI_INVALID_PARAMETERPortNumber is invalid.
EFI_DEVICE_ERRORCan't read register.

Definition at line 368 of file Xhci.c.

◆ XhcGetState()

EFI_STATUS EFIAPI XhcGetState ( IN EFI_USB2_HC_PROTOCOL This,
OUT EFI_USB_HC_STATE State 
)

Retrieve the current state of the USB host controller.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
StateVariable to return the current host controller state.
Return values
EFI_SUCCESSHost controller state was returned in State.
EFI_INVALID_PARAMETERState is NULL.
EFI_DEVICE_ERRORAn error was encountered while attempting to retrieve the host controller's current state.

Definition at line 248 of file Xhci.c.

◆ XhcIsochronousTransfer()

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 
)

Submits isochronous transfer to a target USB device.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
DeviceAddressTarget device address.
EndPointAddressEnd point address with its direction.
DeviceSpeedDevice speed, Low speed device doesn't support this type.
MaximumPacketLengthMaximum packet size that the endpoint is capable of sending or receiving.
DataBuffersNumberNumber of data buffers prepared for the transfer.
DataArray of pointers to the buffers of data that will be transmitted to USB device or received from USB device.
DataLengthThe size, in bytes, of the data buffer.
TranslatorTransaction translator to use.
TransferResultVariable to receive the transfer result.
Returns
EFI_UNSUPPORTED Isochronous transfer is unsupported.

Definition at line 1625 of file Xhci.c.

◆ XhcReset()

EFI_STATUS EFIAPI XhcReset ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT16  Attributes 
)

Provides software reset for the USB host controller.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
AttributesA bit mask of the reset operation to perform.
Return values
EFI_SUCCESSThe reset operation succeeded.
EFI_INVALID_PARAMETERAttributes is not valid.
EFI_UNSUPPOURTEDThe type of reset specified by Attributes is not currently supported by the host controller.
EFI_DEVICE_ERRORHost controller isn't halted to reset.

Definition at line 151 of file Xhci.c.

◆ XhcSetRootHubPortFeature()

EFI_STATUS EFIAPI XhcSetRootHubPortFeature ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT8  PortNumber,
IN EFI_USB_PORT_FEATURE  PortFeature 
)

Sets a feature for the specified root hub port.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
PortNumberRoot hub port to set.
PortFeatureFeature to set.
Return values
EFI_SUCCESSThe feature specified by PortFeature was set.
EFI_INVALID_PARAMETERPortNumber is invalid or PortFeature is invalid.
EFI_DEVICE_ERRORCan't read register.

Definition at line 510 of file Xhci.c.

◆ XhcSetState()

EFI_STATUS EFIAPI XhcSetState ( IN EFI_USB2_HC_PROTOCOL This,
IN EFI_USB_HC_STATE  State 
)

Sets the USB host controller to a specific state.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
StateThe state of the host controller that will be set.
Return values
EFI_SUCCESSThe USB host controller was successfully placed in the state specified by State.
EFI_INVALID_PARAMETERState is invalid.
EFI_DEVICE_ERRORFailed to set the state due to device error.

Definition at line 290 of file Xhci.c.

◆ XhcSyncInterruptTransfer()

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 
)

Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
DeviceAddressTarget device address.
EndPointAddressEndpoint number and its direction encoded in bit 7
DeviceSpeedIndicates device speed.
MaximumPacketLengthMaximum packet size the target endpoint is capable of sending or receiving.
DataBuffer of data that will be transmitted to USB device or received from USB device.
DataLengthOn input, the size, in bytes, of the data buffer; On output, the number of bytes transferred.
DataToggleOn input, the initial data toggle to use; on output, it is updated to indicate the next data toggle.
TimeoutMaximum time, in second, to complete.
TranslatorTransaction translator to use.
TransferResultVariable to receive the transfer result.
Returns
EFI_SUCCESS The transfer was completed successfully.
EFI_OUT_OF_RESOURCES The transfer failed due to lack of resource.
EFI_INVALID_PARAMETER Some parameters are invalid.
EFI_TIMEOUT The transfer failed due to timeout.
EFI_DEVICE_ERROR The failed due to host controller or device error

Definition at line 1519 of file Xhci.c.

Variable Documentation

◆ gXhciComponentName

EFI_COMPONENT_NAME_PROTOCOL gXhciComponentName
extern

Definition at line 15 of file ComponentName.c.

◆ gXhciComponentName2

EFI_COMPONENT_NAME2_PROTOCOL gXhciComponentName2
extern

Definition at line 24 of file ComponentName.c.

◆ gXhciDriverBinding

EFI_DRIVER_BINDING_PROTOCOL gXhciDriverBinding
extern

Definition at line 59 of file Xhci.c.