MdeModulePkg[all]  0.98
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
UsbIo.h File Reference

Data Structures

struct  _PEI_USB_IO_PPI
 

Macros

#define PEI_USB_IO_PPI_GUID
 

Typedefs

typedef struct _PEI_USB_IO_PPI PEI_USB_IO_PPI
 
typedef EFI_STATUS(EFIAPI * PEI_USB_CONTROL_TRANSFER )(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This, IN EFI_USB_DEVICE_REQUEST *Request, IN EFI_USB_DATA_DIRECTION Direction, IN UINT32 Timeout, IN OUT VOID *Data, IN UINTN DataLength)
 
typedef EFI_STATUS(EFIAPI * PEI_USB_BULK_TRANSFER )(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This, IN UINT8 DeviceEndpoint, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN UINTN Timeout)
 
typedef EFI_STATUS(EFIAPI * PEI_USB_GET_INTERFACE_DESCRIPTOR )(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This, IN EFI_USB_INTERFACE_DESCRIPTOR **InterfaceDescriptor)
 
typedef EFI_STATUS(EFIAPI * PEI_USB_GET_ENDPOINT_DESCRIPTOR )(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This, IN UINT8 EndpointIndex, IN EFI_USB_ENDPOINT_DESCRIPTOR **EndpointDescriptor)
 
typedef EFI_STATUS(EFIAPI * PEI_USB_PORT_RESET )(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This)
 

Variables

EFI_GUID gPeiUsbIoPpiGuid
 

Detailed Description

Defines the PEI_USB_IO_PPI that the USB-related PEIM can use for I/O operations on the USB BUS. This interface enables recovery from a USB-class storage device, such as USB CD/DVD, USB hard drive, or USB FLASH drive. These interfaces are modeled on the UEFI 2.3 specification EFI_USB_IO_PROTOCOL. Refer to section 16.2.4 of the UEFI 2.3 Specification for more information on these interfaces.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Macro Definition Documentation

#define PEI_USB_IO_PPI_GUID
Value:
{ \
0x7c29785c, 0x66b9, 0x49fc, { 0xb7, 0x97, 0x1c, 0xa5, 0x55, 0xe, 0xf2, 0x83} \
}

Global ID for the PEI_USB_IO_PPI.

Typedef Documentation

typedef EFI_STATUS(EFIAPI * PEI_USB_BULK_TRANSFER)(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This, IN UINT8 DeviceEndpoint, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN UINTN Timeout)

Submits bulk transfer to a target USB device.

Parameters
[in]PeiServicesThe pointer to the PEI Services Table.
[in]ThisThe pointer to this instance of the PEI_USB_IO_PPI.
[in]DeviceEndpointThe endpoint address.
[in]DataThe data buffer to be transfered.
[in]DataLengthThe length of data buffer.
[in]TimeoutThe timeout for the transfer, in milliseconds. If Timeout is 0, then the caller must wait for the function to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
Return values
EFI_SUCCESSThe bulk transfer completed successfully.
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_OUT_OF_RESOURCESThe bulk transfer could not be completed due to a lack of resources.
EFI_TIMEOUTThe bulk transfer failed due to timeout.
EFI_DEVICE_ERRORThe bulk transfer failed due to host controller or device error. Caller should check TransferResult for detailed error information.
typedef EFI_STATUS(EFIAPI * PEI_USB_CONTROL_TRANSFER)(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This, IN EFI_USB_DEVICE_REQUEST *Request, IN EFI_USB_DATA_DIRECTION Direction, IN UINT32 Timeout, IN OUT VOID *Data, IN UINTN DataLength)

Submits control transfer to a target USB device.

Parameters
[in]PeiServicesThe pointer to the PEI Services Table.
[in]ThisThe pointer to this instance of the PEI_USB_IO_PPI.
[in]RequestA pointer to the USB device request that will be sent to the USB device.
[in]DirectionSpecifies the data direction for the transfer. There are three values available: EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.
[in]TimeoutIndicates the maximum time, in milliseconds, that the transfer is allowed to complete. If Timeout is 0, then the caller must wait for the function to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
[in,out]DataA pointer to the buffer of data that will be transmitted to or received from the USB device.
[in]DataLengthOn input, indicates the size, in bytes, of the data buffer specified by Data.
Return values
EFI_SUCCESSThe control transfer was completed successfully.
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_OUT_OF_RESOURCESThe control transfer could not be completed due to a lack of resources.
EFI_TIMEOUTThe control transfer failed due to timeout.
EFI_DEVICE_ERRORThe control transfer failed due to host controller or device error. Caller should check TransferResult for detailed error information.
typedef EFI_STATUS(EFIAPI * PEI_USB_GET_ENDPOINT_DESCRIPTOR)(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This, IN UINT8 EndpointIndex, IN EFI_USB_ENDPOINT_DESCRIPTOR **EndpointDescriptor)

Get endpoint descriptor from a USB device.

Parameters
[in]PeiServicesThe pointer to the PEI Services Table.
[in]ThisThe pointer to this instance of the PEI_USB_IO_PPI.
[in]EndPointIndexThe index of the end point.
[in]EndpointDescriptorThe endpoint descriptor.
Return values
EFI_SUCCESSThe endpoint descriptor was returned.
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_DEVICE_ERRORA device error occurred, the function failed to get the endpoint descriptor.
typedef EFI_STATUS(EFIAPI * PEI_USB_GET_INTERFACE_DESCRIPTOR)(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This, IN EFI_USB_INTERFACE_DESCRIPTOR **InterfaceDescriptor)

Get interface descriptor from a USB device.

Parameters
[in]PeiServicesThe pointer to the PEI Services Table.
[in]ThisThe pointer to this instance of the PEI_USB_IO_PPI.
[in]InterfaceDescriptorThe interface descriptor.
Return values
EFI_SUCCESSThe interface descriptor was returned.
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_DEVICE_ERRORA device error occurred, the function failed to get the interface descriptor.

Forward declaration for the PEI_USB_IO_PPI.

typedef EFI_STATUS(EFIAPI * PEI_USB_PORT_RESET)(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *This)

Issue a port reset to the device.

Parameters
[in]PeiServicesThe pointer to the PEI Services Table.
[in]ThisThe pointer to this instance of the PEI_USB_IO_PPI.
Return values
EFI_SUCCESSThe port reset was issued successfully.
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_DEVICE_ERRORDevice error occurred.

Variable Documentation

EFI_GUID gPeiUsbIoPpiGuid