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

Go to the source code of this file.

Data Structures

struct  _EFI_USB_BUS_PROTOCOL
 
struct  _USB_DEVICE
 
struct  _USB_INTERFACE
 
struct  _USB_BUS
 
struct  _USB_HUB_API
 
struct  _DEVICE_PATH_LIST_ITEM
 
struct  USB_CLASS_FORMAT_DEVICE_PATH
 

Macros

#define USB_MAX_LANG_ID   16
 
#define USB_MAX_INTERFACE   16
 
#define USB_MAX_DEVICES   128
 
#define USB_BUS_1_MILLISECOND   1000
 
#define USB_ROOTHUB_POLL_INTERVAL   (100 * 10000U)
 
#define USB_HUB_POLL_INTERVAL   64
 
#define USB_WAIT_PORT_STABLE_STALL   (100 * USB_BUS_1_MILLISECOND)
 
#define USB_WAIT_PORT_STS_CHANGE_STALL   (100)
 
#define USB_SET_DEVICE_ADDRESS_STALL   (2 * USB_BUS_1_MILLISECOND)
 
#define USB_RETRY_MAX_PACK_SIZE_STALL   (100 * USB_BUS_1_MILLISECOND)
 
#define USB_SET_PORT_POWER_STALL   (2 * USB_BUS_1_MILLISECOND)
 
#define USB_SET_PORT_RESET_STALL   (20 * USB_BUS_1_MILLISECOND)
 
#define USB_SET_ROOT_PORT_RESET_STALL   (50 * USB_BUS_1_MILLISECOND)
 
#define USB_SET_PORT_RECOVERY_STALL   (10 * USB_BUS_1_MILLISECOND)
 
#define USB_CLR_ROOT_PORT_RESET_STALL   (20 * USB_BUS_1_MILLISECOND)
 
#define USB_SET_ROOT_PORT_ENABLE_STALL   (20 * USB_BUS_1_MILLISECOND)
 
#define USB_GENERAL_DEVICE_REQUEST_TIMEOUT   500
 
#define USB_CLEAR_FEATURE_REQUEST_TIMEOUT   10
 
#define USB_BUS_TPL   TPL_NOTIFY
 
#define USB_INTERFACE_SIGNATURE   SIGNATURE_32 ('U', 'S', 'B', 'I')
 
#define USB_BUS_SIGNATURE   SIGNATURE_32 ('U', 'S', 'B', 'B')
 
#define USB_BIT(a)   ((UINTN)(1 << (a)))
 
#define USB_BIT_IS_SET(Data, Bit)   ((BOOLEAN)(((Data) & (Bit)) == (Bit)))
 
#define USB_INTERFACE_FROM_USBIO(a)    CR(a, USB_INTERFACE, UsbIo, USB_INTERFACE_SIGNATURE)
 
#define USB_BUS_FROM_THIS(a)    CR(a, USB_BUS, BusId, USB_BUS_SIGNATURE)
 
#define USB_US_LAND_ID   0x0409
 
#define DEVICE_PATH_LIST_ITEM_SIGNATURE   SIGNATURE_32('d','p','l','i')
 

Typedefs

typedef struct _USB_DEVICE USB_DEVICE
 
typedef struct _USB_INTERFACE USB_INTERFACE
 
typedef struct _USB_BUS USB_BUS
 
typedef struct _USB_HUB_API USB_HUB_API
 
typedef struct _EFI_USB_BUS_PROTOCOL EFI_USB_BUS_PROTOCOL
 
typedef struct _DEVICE_PATH_LIST_ITEM DEVICE_PATH_LIST_ITEM
 

Functions

EFI_STATUS EFIAPI UsbBusFreeUsbDPList (IN LIST_ENTRY *UsbIoDPList)
 
EFI_STATUS EFIAPI UsbBusAddWantedUsbIoDP (IN EFI_USB_BUS_PROTOCOL *UsbBusId, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
BOOLEAN EFIAPI UsbBusIsWantedUsbIO (IN USB_BUS *Bus, IN USB_INTERFACE *UsbIf)
 
EFI_STATUS EFIAPI UsbBusRecursivelyConnectWantedUsbIo (IN EFI_USB_BUS_PROTOCOL *UsbBusId)
 
EFI_STATUS EFIAPI UsbIoControlTransfer (IN EFI_USB_IO_PROTOCOL *This, IN EFI_USB_DEVICE_REQUEST *Request, IN EFI_USB_DATA_DIRECTION Direction, IN UINT32 Timeout, IN OUT VOID *Data OPTIONAL, IN UINTN DataLength OPTIONAL, OUT UINT32 *UsbStatus)
 
EFI_STATUS EFIAPI UsbIoBulkTransfer (IN EFI_USB_IO_PROTOCOL *This, IN UINT8 Endpoint, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN UINTN Timeout, OUT UINT32 *UsbStatus)
 
EFI_STATUS EFIAPI UsbIoSyncInterruptTransfer (IN EFI_USB_IO_PROTOCOL *This, IN UINT8 Endpoint, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN UINTN Timeout, OUT UINT32 *UsbStatus)
 
EFI_STATUS EFIAPI UsbIoAsyncInterruptTransfer (IN EFI_USB_IO_PROTOCOL *This, IN UINT8 Endpoint, IN BOOLEAN IsNewTransfer, IN UINTN PollInterval OPTIONAL, IN UINTN DataLength OPTIONAL, IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback OPTIONAL, IN VOID *Context OPTIONAL)
 
EFI_STATUS EFIAPI UsbIoIsochronousTransfer (IN EFI_USB_IO_PROTOCOL *This, IN UINT8 DeviceEndpoint, IN OUT VOID *Data, IN UINTN DataLength, OUT UINT32 *Status)
 
EFI_STATUS EFIAPI UsbIoAsyncIsochronousTransfer (IN EFI_USB_IO_PROTOCOL *This, IN UINT8 DeviceEndpoint, IN OUT VOID *Data, IN UINTN DataLength, IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack, IN VOID *Context OPTIONAL)
 
EFI_STATUS EFIAPI UsbIoGetDeviceDescriptor (IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_DEVICE_DESCRIPTOR *Descriptor)
 
EFI_STATUS EFIAPI UsbIoGetActiveConfigDescriptor (IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_CONFIG_DESCRIPTOR *Descriptor)
 
EFI_STATUS EFIAPI UsbIoGetInterfaceDescriptor (IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_INTERFACE_DESCRIPTOR *Descriptor)
 
EFI_STATUS EFIAPI UsbIoGetEndpointDescriptor (IN EFI_USB_IO_PROTOCOL *This, IN UINT8 Index, OUT EFI_USB_ENDPOINT_DESCRIPTOR *Descriptor)
 
EFI_STATUS EFIAPI UsbIoGetSupportedLanguages (IN EFI_USB_IO_PROTOCOL *This, OUT UINT16 **LangIDTable, OUT UINT16 *TableSize)
 
EFI_STATUS EFIAPI UsbIoGetStringDescriptor (IN EFI_USB_IO_PROTOCOL *This, IN UINT16 LangID, IN UINT8 StringIndex, OUT CHAR16 **String)
 
EFI_STATUS EFIAPI UsbIoPortReset (IN EFI_USB_IO_PROTOCOL *This)
 
EFI_STATUS EFIAPI UsbBusBuildProtocol (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI UsbBusDriverEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI UsbBusControllerDriverSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI UsbBusControllerDriverStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI UsbBusControllerDriverStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 

Variables

EFI_USB_IO_PROTOCOL mUsbIoProtocol
 
EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding
 
EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName
 
EFI_COMPONENT_NAME2_PROTOCOL mUsbBusComponentName2
 

Detailed Description

Usb Bus Driver Binding and Bus IO Protocol.

Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UsbBus.h.

Macro Definition Documentation

◆ DEVICE_PATH_LIST_ITEM_SIGNATURE

#define DEVICE_PATH_LIST_ITEM_SIGNATURE   SIGNATURE_32('d','p','l','i')

Definition at line 286 of file UsbBus.h.

◆ USB_BIT

#define USB_BIT (   a)    ((UINTN)(1 << (a)))

Definition at line 138 of file UsbBus.h.

◆ USB_BIT_IS_SET

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

Definition at line 139 of file UsbBus.h.

◆ USB_BUS_1_MILLISECOND

#define USB_BUS_1_MILLISECOND   1000

Definition at line 50 of file UsbBus.h.

◆ USB_BUS_FROM_THIS

#define USB_BUS_FROM_THIS (   a)     CR(a, USB_BUS, BusId, USB_BUS_SIGNATURE)

Definition at line 144 of file UsbBus.h.

◆ USB_BUS_SIGNATURE

#define USB_BUS_SIGNATURE   SIGNATURE_32 ('U', 'S', 'B', 'B')

Definition at line 136 of file UsbBus.h.

◆ USB_BUS_TPL

#define USB_BUS_TPL   TPL_NOTIFY

Definition at line 133 of file UsbBus.h.

◆ USB_CLEAR_FEATURE_REQUEST_TIMEOUT

#define USB_CLEAR_FEATURE_REQUEST_TIMEOUT   10

Definition at line 127 of file UsbBus.h.

◆ USB_CLR_ROOT_PORT_RESET_STALL

#define USB_CLR_ROOT_PORT_RESET_STALL   (20 * USB_BUS_1_MILLISECOND)

Definition at line 108 of file UsbBus.h.

◆ USB_GENERAL_DEVICE_REQUEST_TIMEOUT

#define USB_GENERAL_DEVICE_REQUEST_TIMEOUT   500

Definition at line 122 of file UsbBus.h.

◆ USB_HUB_POLL_INTERVAL

#define USB_HUB_POLL_INTERVAL   64

Definition at line 58 of file UsbBus.h.

◆ USB_INTERFACE_FROM_USBIO

#define USB_INTERFACE_FROM_USBIO (   a)     CR(a, USB_INTERFACE, UsbIo, USB_INTERFACE_SIGNATURE)

Definition at line 141 of file UsbBus.h.

◆ USB_INTERFACE_SIGNATURE

#define USB_INTERFACE_SIGNATURE   SIGNATURE_32 ('U', 'S', 'B', 'I')

Definition at line 135 of file UsbBus.h.

◆ USB_MAX_DEVICES

#define USB_MAX_DEVICES   128

Definition at line 48 of file UsbBus.h.

◆ USB_MAX_INTERFACE

#define USB_MAX_INTERFACE   16

Definition at line 47 of file UsbBus.h.

◆ USB_MAX_LANG_ID

#define USB_MAX_LANG_ID   16

Definition at line 46 of file UsbBus.h.

◆ USB_RETRY_MAX_PACK_SIZE_STALL

#define USB_RETRY_MAX_PACK_SIZE_STALL   (100 * USB_BUS_1_MILLISECOND)

Definition at line 80 of file UsbBus.h.

◆ USB_ROOTHUB_POLL_INTERVAL

#define USB_ROOTHUB_POLL_INTERVAL   (100 * 10000U)

Definition at line 57 of file UsbBus.h.

◆ USB_SET_DEVICE_ADDRESS_STALL

#define USB_SET_DEVICE_ADDRESS_STALL   (2 * USB_BUS_1_MILLISECOND)

Definition at line 75 of file UsbBus.h.

◆ USB_SET_PORT_POWER_STALL

#define USB_SET_PORT_POWER_STALL   (2 * USB_BUS_1_MILLISECOND)

Definition at line 86 of file UsbBus.h.

◆ USB_SET_PORT_RECOVERY_STALL

#define USB_SET_PORT_RECOVERY_STALL   (10 * USB_BUS_1_MILLISECOND)

Definition at line 103 of file UsbBus.h.

◆ USB_SET_PORT_RESET_STALL

#define USB_SET_PORT_RESET_STALL   (20 * USB_BUS_1_MILLISECOND)

Definition at line 96 of file UsbBus.h.

◆ USB_SET_ROOT_PORT_ENABLE_STALL

#define USB_SET_ROOT_PORT_ENABLE_STALL   (20 * USB_BUS_1_MILLISECOND)

Definition at line 113 of file UsbBus.h.

◆ USB_SET_ROOT_PORT_RESET_STALL

#define USB_SET_ROOT_PORT_RESET_STALL   (50 * USB_BUS_1_MILLISECOND)

Definition at line 97 of file UsbBus.h.

◆ USB_US_LAND_ID

#define USB_US_LAND_ID   0x0409

Definition at line 284 of file UsbBus.h.

◆ USB_WAIT_PORT_STABLE_STALL

#define USB_WAIT_PORT_STABLE_STALL   (100 * USB_BUS_1_MILLISECOND)

Definition at line 64 of file UsbBus.h.

◆ USB_WAIT_PORT_STS_CHANGE_STALL

#define USB_WAIT_PORT_STS_CHANGE_STALL   (100)

Definition at line 69 of file UsbBus.h.

Typedef Documentation

◆ USB_BUS

typedef struct _USB_BUS USB_BUS

Definition at line 34 of file UsbBus.h.

◆ USB_DEVICE

typedef struct _USB_DEVICE USB_DEVICE

Definition at line 32 of file UsbBus.h.

◆ USB_HUB_API

typedef struct _USB_HUB_API USB_HUB_API

Definition at line 35 of file UsbBus.h.

◆ USB_INTERFACE

typedef struct _USB_INTERFACE USB_INTERFACE

Definition at line 33 of file UsbBus.h.

Function Documentation

◆ UsbBusAddWantedUsbIoDP()

EFI_STATUS EFIAPI UsbBusAddWantedUsbIoDP ( IN EFI_USB_BUS_PROTOCOL UsbBusId,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Store a wanted usb child device info (its Usb part of device path) which is indicated by RemainingDevicePath in a Usb bus which is indicated by UsbBusId.

Parameters
UsbBusIdPoint to EFI_USB_BUS_PROTOCOL interface.
RemainingDevicePathThe remaining device patch.
Return values
EFI_SUCCESSAdd operation is successful.
EFI_INVALID_PARAMETERThe parameters are invalid.

Definition at line 951 of file UsbUtility.c.

◆ UsbBusBuildProtocol()

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

Install Usb Bus Protocol on host controller, and start the Usb bus.

Parameters
ThisThe USB bus driver binding instance.
ControllerThe controller to check.
RemainingDevicePathThe remaining device patch.
Return values
EFI_SUCCESSThe controller is controlled by the usb bus.
EFI_ALREADY_STARTEDThe controller is already controlled by the usb bus.
EFI_OUT_OF_RESOURCESFailed to allocate resources.

Definition at line 941 of file UsbBus.c.

◆ UsbBusControllerDriverStart()

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

Start to process the controller.

Parameters
ThisThe USB bus driver binding instance.
ControllerThe controller to check.
RemainingDevicePathThe remaining device patch.
Return values
EFI_SUCCESSThe controller is controlled by the usb bus.
EFI_ALREADY_STARTEDThe controller is already controlled by the usb bus.
EFI_OUT_OF_RESOURCESFailed to allocate resources.

Definition at line 1315 of file UsbBus.c.

◆ UsbBusControllerDriverStop()

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

Stop handle the controller by this USB bus driver.

Parameters
ThisThe USB bus driver binding protocol.
ControllerThe controller to release.
NumberOfChildrenThe child of USB bus that opened controller BY_CHILD.
ChildHandleBufferThe array of child handle.
Return values
EFI_SUCCESSThe controller or children are stopped.
EFI_DEVICE_ERRORFailed to stop the driver.

Definition at line 1426 of file UsbBus.c.

◆ UsbBusControllerDriverSupported()

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

Check whether USB bus driver support this device.

Parameters
ThisThe USB bus driver binding protocol.
ControllerThe controller handle to check.
RemainingDevicePathThe remaining device path.
Return values
EFI_SUCCESSThe bus supports this controller.
EFI_UNSUPPORTEDThis device isn't supported.

Definition at line 1174 of file UsbBus.c.

◆ UsbBusDriverEntryPoint()

EFI_STATUS EFIAPI UsbBusDriverEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The USB bus driver entry pointer.

Parameters
ImageHandleThe driver image handle.
SystemTableThe system table.
Returns
EFI_SUCCESS The component name protocol is installed.
Others Failed to init the usb driver.

Definition at line 1146 of file UsbBus.c.

◆ UsbBusFreeUsbDPList()

EFI_STATUS EFIAPI UsbBusFreeUsbDPList ( IN LIST_ENTRY UsbIoDPList)

Free a DEVICE_PATH_LIST_ITEM list.

Parameters
UsbIoDPLista DEVICE_PATH_LIST_ITEM list pointer.
Return values
EFI_INVALID_PARAMETERIf parameters are invalid, return this value.
EFI_SUCCESSIf free operation is successful, return this value.

Definition at line 902 of file UsbUtility.c.

◆ UsbBusIsWantedUsbIO()

BOOLEAN EFIAPI UsbBusIsWantedUsbIO ( IN USB_BUS Bus,
IN USB_INTERFACE UsbIf 
)

Check whether a usb child device is the wanted device in a bus.

Parameters
BusThe Usb bus's private data pointer.
UsbIfThe usb child device interface.
Return values
TrueIf a usb child device is the wanted device in a bus.
FalseIf a usb child device is NOT the wanted device in a bus.

Definition at line 1022 of file UsbUtility.c.

◆ UsbBusRecursivelyConnectWantedUsbIo()

EFI_STATUS EFIAPI UsbBusRecursivelyConnectWantedUsbIo ( IN EFI_USB_BUS_PROTOCOL UsbBusId)

Recursively connect every wanted usb child device to ensure they all fully connected. Check all the child Usb IO handles in this bus, recursively connecte if it is wanted usb child device.

Parameters
UsbBusIdPoint to EFI_USB_BUS_PROTOCOL interface.
Return values
EFI_SUCCESSConnect is done successfully.
EFI_INVALID_PARAMETERThe parameter is invalid.

Definition at line 1134 of file UsbUtility.c.

◆ UsbIoAsyncInterruptTransfer()

EFI_STATUS EFIAPI UsbIoAsyncInterruptTransfer ( IN EFI_USB_IO_PROTOCOL This,
IN UINT8  Endpoint,
IN BOOLEAN  IsNewTransfer,
IN UINTN PollInterval  OPTIONAL,
IN UINTN DataLength  OPTIONAL,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback  OPTIONAL,
IN VOID *Context  OPTIONAL 
)

Queue a new asynchronous interrupt transfer, or remove the old request if (IsNewTransfer == FALSE).

Parameters
ThisThe USB_IO instance.
EndpointThe device endpoint.
IsNewTransferWhether this is a new request, if it's old, remove the request.
PollIntervalThe interval to poll the transfer result, (in ms).
DataLengthThe length of perodic data transfer.
CallbackThe function to call periodically when transfer is ready.
ContextThe context to the callback.
Return values
EFI_SUCCESSNew transfer is queued or old request is removed.
EFI_INVALID_PARAMETERSome parameters are invalid.
OthersFailed to queue the new request or remove the old request.

Definition at line 413 of file UsbBus.c.

◆ UsbIoAsyncIsochronousTransfer()

EFI_STATUS EFIAPI UsbIoAsyncIsochronousTransfer ( IN EFI_USB_IO_PROTOCOL This,
IN UINT8  DeviceEndpoint,
IN OUT VOID *  Data,
IN UINTN  DataLength,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK  IsochronousCallBack,
IN VOID *Context  OPTIONAL 
)

Queue an asynchronous isochronous transfer.

Parameters
ThisThe USB_IO instance.
DeviceEndpointThe device endpoint.
DataThe data to transfer.
DataLengthThe length of perodic data transfer.
IsochronousCallBackThe function to call periodically when transfer is ready.
ContextThe context to the callback.
Return values
EFI_UNSUPPORTEDCurrently isochronous transfer isn't supported.

Definition at line 509 of file UsbBus.c.

◆ UsbIoBulkTransfer()

EFI_STATUS EFIAPI UsbIoBulkTransfer ( IN EFI_USB_IO_PROTOCOL This,
IN UINT8  Endpoint,
IN OUT VOID *  Data,
IN OUT UINTN DataLength,
IN UINTN  Timeout,
OUT UINT32 *  UsbStatus 
)

Execute a bulk transfer to the device endpoint.

Parameters
ThisThe USB IO instance.
EndpointThe device endpoint.
DataThe data to transfer.
DataLengthThe length of the data to transfer.
TimeoutTime to wait before timeout.
UsbStatusThe result of USB transfer.
Return values
EFI_SUCCESSThe bulk transfer is OK.
EFI_INVALID_PARAMETERSome parameters are invalid.
OthersFailed to execute transfer, reason returned in UsbStatus.

Definition at line 241 of file UsbBus.c.

◆ UsbIoControlTransfer()

EFI_STATUS EFIAPI UsbIoControlTransfer ( IN EFI_USB_IO_PROTOCOL This,
IN EFI_USB_DEVICE_REQUEST Request,
IN EFI_USB_DATA_DIRECTION  Direction,
IN UINT32  Timeout,
IN OUT VOID *Data  OPTIONAL,
IN UINTN DataLength  OPTIONAL,
OUT UINT32 *  UsbStatus 
)

USB_IO function to execute a control transfer. This function will execute the USB transfer. If transfer successes, it will sync the internal state of USB bus with device state.

Parameters
ThisThe USB_IO instance
RequestThe control transfer request
DirectionDirection for data stage
TimeoutThe time to wait before timeout
DataThe buffer holding the data
DataLengthThen length of the data
UsbStatusUSB result
Return values
EFI_INVALID_PARAMETERThe parameters are invalid
EFI_SUCCESSThe control transfer succeded.
OthersFailed to execute the transfer

USB_IO function to execute a control transfer. This function will execute the USB transfer. If transfer successes, it will sync the internal state of USB bus with device state.

Parameters
ThisThe USB_IO instance
RequestThe control transfer request
DirectionDirection for data stage
TimeoutThe time to wait before timeout
DataThe buffer holding the data
DataLengthThen length of the data
UsbStatusUSB result
Return values
EFI_INVALID_PARAMETERThe parameters are invalid
EFI_SUCCESSThe control transfer succeeded.
OthersFailed to execute the transfer

Definition at line 59 of file UsbBus.c.

◆ UsbIoGetActiveConfigDescriptor()

EFI_STATUS EFIAPI UsbIoGetActiveConfigDescriptor ( IN EFI_USB_IO_PROTOCOL This,
OUT EFI_USB_CONFIG_DESCRIPTOR Descriptor 
)

Return the configuration descriptor of the current active configuration.

Parameters
ThisThe USB IO instance.
DescriptorThe USB configuration descriptor.
Return values
EFI_SUCCESSThe active configuration descriptor is returned.
EFI_INVALID_PARAMETERSome parameter is invalid.
EFI_NOT_FOUNDCurrently no active configuration is selected.

Definition at line 570 of file UsbBus.c.

◆ UsbIoGetDeviceDescriptor()

EFI_STATUS EFIAPI UsbIoGetDeviceDescriptor ( IN EFI_USB_IO_PROTOCOL This,
OUT EFI_USB_DEVICE_DESCRIPTOR Descriptor 
)

Retrieve the device descriptor of the device.

Parameters
ThisThe USB IO instance.
DescriptorThe variable to receive the device descriptor.
Return values
EFI_SUCCESSThe device descriptor is returned.
EFI_INVALID_PARAMETERThe parameter is invalid.

Definition at line 533 of file UsbBus.c.

◆ UsbIoGetEndpointDescriptor()

EFI_STATUS EFIAPI UsbIoGetEndpointDescriptor ( IN EFI_USB_IO_PROTOCOL This,
IN UINT8  Index,
OUT EFI_USB_ENDPOINT_DESCRIPTOR Descriptor 
)

Retrieve the endpoint descriptor from this interface setting.

Parameters
ThisThe USB IO instance.
IndexThe index (start from zero) of the endpoint to retrieve.
DescriptorThe variable to receive the descriptor.
Return values
EFI_SUCCESSThe endpoint descriptor is returned.
EFI_INVALID_PARAMETERSome parameter is invalid.

Definition at line 649 of file UsbBus.c.

◆ UsbIoGetInterfaceDescriptor()

EFI_STATUS EFIAPI UsbIoGetInterfaceDescriptor ( IN EFI_USB_IO_PROTOCOL This,
OUT EFI_USB_INTERFACE_DESCRIPTOR Descriptor 
)

Retrieve the active interface setting descriptor for this USB IO instance.

Parameters
ThisThe USB IO instance.
DescriptorThe variable to receive active interface setting.
Return values
EFI_SUCCESSThe active interface setting is returned.
EFI_INVALID_PARAMETERSome parameter is invalid.

Definition at line 614 of file UsbBus.c.

◆ UsbIoGetStringDescriptor()

EFI_STATUS EFIAPI UsbIoGetStringDescriptor ( IN EFI_USB_IO_PROTOCOL This,
IN UINT16  LangID,
IN UINT8  StringIndex,
OUT CHAR16 **  String 
)

Retrieve an indexed string in the language of LangID.

Parameters
ThisThe USB IO instance.
LangIDThe language ID of the string to retrieve.
StringIndexThe index of the string.
StringThe variable to receive the string.
Return values
EFI_SUCCESSThe string is returned.
EFI_NOT_FOUNDNo such string existed.

Definition at line 730 of file UsbBus.c.

◆ UsbIoGetSupportedLanguages()

EFI_STATUS EFIAPI UsbIoGetSupportedLanguages ( IN EFI_USB_IO_PROTOCOL This,
OUT UINT16 **  LangIDTable,
OUT UINT16 *  TableSize 
)

Retrieve the supported language ID table from the device.

Parameters
ThisThe USB IO instance.
LangIDTableThe table to return the language IDs.
TableSizeThe size, in bytes, of the table LangIDTable.
Return values
EFI_SUCCESSThe language ID is return.

Definition at line 694 of file UsbBus.c.

◆ UsbIoIsochronousTransfer()

EFI_STATUS EFIAPI UsbIoIsochronousTransfer ( IN EFI_USB_IO_PROTOCOL This,
IN UINT8  DeviceEndpoint,
IN OUT VOID *  Data,
IN UINTN  DataLength,
OUT UINT32 *  Status 
)

Execute a synchronous isochronous transfer.

Parameters
ThisThe USB IO instance.
DeviceEndpointThe device endpoint.
DataThe data to transfer.
DataLengthThe length of the data to transfer.
UsbStatusThe result of USB transfer.
Return values
EFI_UNSUPPORTEDCurrently isochronous transfer isn't supported.

Definition at line 482 of file UsbBus.c.

◆ UsbIoPortReset()

EFI_STATUS EFIAPI UsbIoPortReset ( IN EFI_USB_IO_PROTOCOL This)

Reset the device, then if that succeeds, reconfigure the device with its address and current active configuration.

Parameters
ThisThe USB IO instance.
Return values
EFI_SUCCESSThe device is reset and configured.
OthersFailed to reset the device.

Definition at line 815 of file UsbBus.c.

◆ UsbIoSyncInterruptTransfer()

EFI_STATUS EFIAPI UsbIoSyncInterruptTransfer ( IN EFI_USB_IO_PROTOCOL This,
IN UINT8  Endpoint,
IN OUT VOID *  Data,
IN OUT UINTN DataLength,
IN UINTN  Timeout,
OUT UINT32 *  UsbStatus 
)

Execute a synchronous interrupt transfer.

Parameters
ThisThe USB IO instance.
EndpointThe device endpoint.
DataThe data to transfer.
DataLengthThe length of the data to transfer.
TimeoutTime to wait before timeout.
UsbStatusThe result of USB transfer.
Return values
EFI_SUCCESSThe synchronous interrupt transfer is OK.
EFI_INVALID_PARAMETERSome parameters are invalid.
OthersFailed to execute transfer, reason returned in UsbStatus.

Definition at line 335 of file UsbBus.c.

Variable Documentation

◆ mUsbBusComponentName

EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName
extern

Definition at line 142 of file ComponentName.c.

◆ mUsbBusComponentName2

EFI_COMPONENT_NAME2_PROTOCOL mUsbBusComponentName2
extern

Definition at line 151 of file ComponentName.c.

◆ mUsbBusDriverBinding

EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding
extern

Definition at line 29 of file UsbBus.c.

◆ mUsbIoProtocol

EFI_USB_IO_PROTOCOL mUsbIoProtocol
extern

Definition at line 13 of file UsbBus.c.