TianoCore EDK2 master
Loading...
Searching...
No Matches
UsbFunctionIo.h File Reference
#include <Protocol/UsbIo.h>

Go to the source code of this file.

Data Structures

struct  EFI_USB_INTERFACE_INFO
 
struct  EFI_USB_CONFIG_INFO
 
struct  EFI_USB_DEVICE_INFO
 
struct  _EFI_USBFN_TRANSFER_RESULT
 
union  _EFI_USBFN_MESSAGE_PAYLOAD
 
struct  _EFI_USBFN_IO_PROTOCOL
 

Macros

#define EFI_USBFN_IO_PROTOCOL_GUID
 
#define EFI_USBFN_IO_PROTOCOL_REVISION   0x00010001
 

Typedefs

typedef struct _EFI_USBFN_IO_PROTOCOL EFI_USBFN_IO_PROTOCOL
 
typedef enum _EFI_USBFN_PORT_TYPE EFI_USBFN_PORT_TYPE
 
typedef enum _EFI_USB_ENDPOINT_TYPE EFI_USB_ENDPOINT_TYPE
 
typedef enum _EFI_USBFN_DEVICE_INFO_ID EFI_USBFN_DEVICE_INFO_ID
 
typedef enum _EFI_USBFN_ENDPOINT_DIRECTION EFI_USBFN_ENDPOINT_DIRECTION
 
typedef enum _EFI_USBFN_MESSAGE EFI_USBFN_MESSAGE
 
typedef enum _EFI_USBFN_TRANSFER_STATUS EFI_USBFN_TRANSFER_STATUS
 
typedef struct _EFI_USBFN_TRANSFER_RESULT EFI_USBFN_TRANSFER_RESULT
 
typedef enum _EFI_USB_BUS_SPEED EFI_USB_BUS_SPEED
 
typedef union _EFI_USBFN_MESSAGE_PAYLOAD EFI_USBFN_MESSAGE_PAYLOAD
 
typedef enum _EFI_USBFN_POLICY_TYPE EFI_USBFN_POLICY_TYPE
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_DETECT_PORT) (IN EFI_USBFN_IO_PROTOCOL *This, OUT EFI_USBFN_PORT_TYPE *PortType)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_CONFIGURE_ENABLE_ENDPOINTS) (IN EFI_USBFN_IO_PROTOCOL *This, OUT EFI_USB_DEVICE_INFO *DeviceInfo)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_ENDPOINT_MAXPACKET_SIZE) (IN EFI_USBFN_IO_PROTOCOL *This, IN EFI_USB_ENDPOINT_TYPE EndpointType, IN EFI_USB_BUS_SPEED BusSpeed, OUT UINT16 *MaxPacketSize)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_DEVICE_INFO) (IN EFI_USBFN_IO_PROTOCOL *This, IN EFI_USBFN_DEVICE_INFO_ID Id, IN OUT UINTN *BufferSize, OUT VOID *Buffer OPTIONAL)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_VENDOR_ID_PRODUCT_ID) (IN EFI_USBFN_IO_PROTOCOL *This, OUT UINT16 *Vid, OUT UINT16 *Pid)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_ABORT_TRANSFER) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_ENDPOINT_STALL_STATE) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction, IN OUT BOOLEAN *State)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_SET_ENDPOINT_STALL_STATE) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction, IN OUT BOOLEAN *State)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_EVENTHANDLER) (IN EFI_USBFN_IO_PROTOCOL *This, OUT EFI_USBFN_MESSAGE *Message, IN OUT UINTN *PayloadSize, OUT EFI_USBFN_MESSAGE_PAYLOAD *Payload)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_TRANSFER) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction, IN OUT UINTN *BufferSize, IN OUT VOID *Buffer)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_MAXTRANSFER_SIZE) (IN EFI_USBFN_IO_PROTOCOL *This, OUT UINTN *MaxTransferSize)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_ALLOCATE_TRANSFER_BUFFER) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINTN Size, OUT VOID **Buffer)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_FREE_TRANSFER_BUFFER) (IN EFI_USBFN_IO_PROTOCOL *This, IN VOID *Buffer)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_START_CONTROLLER) (IN EFI_USBFN_IO_PROTOCOL *This)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_STOP_CONTROLLER) (IN EFI_USBFN_IO_PROTOCOL *This)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_SET_ENDPOINT_POLICY) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction, IN EFI_USBFN_POLICY_TYPE PolicyType, IN UINTN BufferSize, IN VOID *Buffer)
 
typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_ENDPOINT_POLICY) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction, IN EFI_USBFN_POLICY_TYPE PolicyType, IN OUT UINTN *BufferSize, IN OUT VOID *Buffer)
 

Enumerations

enum  _EFI_USBFN_PORT_TYPE {
  EfiUsbUnknownPort = 0 , EfiUsbStandardDownstreamPort , EfiUsbChargingDownstreamPort , EfiUsbDedicatedChargingPort ,
  EfiUsbInvalidDedicatedChargingPort
}
 
enum  _EFI_USB_ENDPOINT_TYPE { UsbEndpointControl = 0x00 , UsbEndpointBulk = 0x02 }
 
enum  _EFI_USBFN_DEVICE_INFO_ID { EfiUsbDeviceInfoUnknown = 0 , EfiUsbDeviceInfoSerialNumber , EfiUsbDeviceInfoManufacturerName , EfiUsbDeviceInfoProductName }
 
enum  _EFI_USBFN_ENDPOINT_DIRECTION { EfiUsbEndpointDirectionHostOut = 0 , EfiUsbEndpointDirectionHostIn , EfiUsbEndpointDirectionDeviceTx = EfiUsbEndpointDirectionHostIn , EfiUsbEndpointDirectionDeviceRx = EfiUsbEndpointDirectionHostOut }
 
enum  _EFI_USBFN_MESSAGE {
  EfiUsbMsgNone = 0 , EfiUsbMsgSetupPacket , EfiUsbMsgEndpointStatusChangedRx , EfiUsbMsgEndpointStatusChangedTx ,
  EfiUsbMsgBusEventDetach , EfiUsbMsgBusEventAttach , EfiUsbMsgBusEventReset , EfiUsbMsgBusEventSuspend ,
  EfiUsbMsgBusEventResume , EfiUsbMsgBusEventSpeed
}
 
enum  _EFI_USBFN_TRANSFER_STATUS {
  UsbTransferStatusUnknown = 0 , UsbTransferStatusComplete , UsbTransferStatusAborted , UsbTransferStatusActive ,
  UsbTransferStatusNone
}
 
enum  _EFI_USB_BUS_SPEED {
  UsbBusSpeedUnknown = 0 , UsbBusSpeedLow , UsbBusSpeedFull , UsbBusSpeedHigh ,
  UsbBusSpeedSuper , UsbBusSpeedMaximum = UsbBusSpeedSuper
}
 
enum  _EFI_USBFN_POLICY_TYPE { EfiUsbPolicyUndefined = 0 , EfiUsbPolicyMaxTransactionSize , EfiUsbPolicyZeroLengthTerminationSupport , EfiUsbPolicyZeroLengthTermination }
 

Variables

EFI_GUID gEfiUsbFunctionIoProtocolGuid
 

Detailed Description

The USB Function Protocol provides an I/O abstraction for a USB Controller operating in Function mode (also commonly referred to as Device, Peripheral, or Target mode) and the mechanisms by which the USB Function can communicate with the USB Host. It is used by other UEFI drivers or applications to perform data transactions and basic USB controller management over a USB Function port.

This simple protocol only supports USB 2.0 bulk transfers on systems with a single configuration and a single interface. It does not support isochronous or interrupt transfers, alternate interfaces, or USB 3.0 functionality. Future revisions of this protocol may support these or additional features.

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

Revision Reference:
This Protocol was introduced in UEFI Specification 2.5.

Definition in file UsbFunctionIo.h.

Macro Definition Documentation

◆ EFI_USBFN_IO_PROTOCOL_GUID

#define EFI_USBFN_IO_PROTOCOL_GUID
Value:
{ \
0x32d2963a, 0xfe5d, 0x4f30, {0xb6, 0x33, 0x6e, 0x5d, 0xc5, 0x58, 0x3, 0xcc} \
}

Definition at line 27 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_PROTOCOL_REVISION

#define EFI_USBFN_IO_PROTOCOL_REVISION   0x00010001

Definition at line 34 of file UsbFunctionIo.h.

Typedef Documentation

◆ EFI_USBFN_IO_ABORT_TRANSFER

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_ABORT_TRANSFER) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction)

Aborts the transfer on the specified endpoint.

This function should fail with EFI_INVALID_PARAMETER if the specified direction is incorrect for the endpoint.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in]EndpointIndexIndicates the endpoint on which the ongoing transfer needs to be canceled.
[in]DirectionDirection of the endpoint.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe physical device reported an error.
EFI_NOT_READYThe physical device is busy or not ready to process this request.

Definition at line 330 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_ALLOCATE_TRANSFER_BUFFER

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_ALLOCATE_TRANSFER_BUFFER) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINTN Size, OUT VOID **Buffer)

Allocates a transfer buffer of the specified sizethat satisfies the controller requirements.

The AllocateTransferBuffer() function allocates a memory region of Size bytes and returns the address of the allocated memory that satisfies the underlying controller requirements in the location referenced by Buffer.

The allocated transfer buffer must be freed using a matching call to EFI_USBFN_IO_PROTOCOL.FreeTransferBuffer()function.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in]SizeThe number of bytes to allocate for the transfer buffer.
[out]BufferA pointer to a pointer to the allocated buffer if the call succeeds; undefined otherwise.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_OUT_OF_RESOURCESThe requested transfer buffer could not be allocated.

Definition at line 523 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_CONFIGURE_ENABLE_ENDPOINTS

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_CONFIGURE_ENABLE_ENDPOINTS) (IN EFI_USBFN_IO_PROTOCOL *This, OUT EFI_USB_DEVICE_INFO *DeviceInfo)

Configures endpoints based on supplied device and configuration descriptors.

Assuming that the hardware has already been initialized, this function configures the endpoints using the device information supplied by DeviceInfo, activates the port, and starts receiving USB events.

This function must ignore the bMaxPacketSize0field of the Standard Device Descriptor and the wMaxPacketSize field of the Standard Endpoint Descriptor that are made available through DeviceInfo.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[out]DeviceInfoA pointer to EFI_USBFN_DEVICE_INFO instance.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe physical device reported an error.
EFI_NOT_READYThe physical device is busy or not ready to process this request.
EFI_OUT_OF_RESOURCESThe request could not be completed due to lack of resources.

Definition at line 216 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_DETECT_PORT

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_DETECT_PORT) (IN EFI_USBFN_IO_PROTOCOL *This, OUT EFI_USBFN_PORT_TYPE *PortType)

Returns information about what USB port type was attached.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[out]PortTypeReturns the USB port type.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe physical device reported an error.
EFI_NOT_READYThe physical device is busy or not ready to process this request or there is no USB port attached to the device.

Definition at line 186 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_EVENTHANDLER

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_EVENTHANDLER) (IN EFI_USBFN_IO_PROTOCOL *This, OUT EFI_USBFN_MESSAGE *Message, IN OUT UINTN *PayloadSize, OUT EFI_USBFN_MESSAGE_PAYLOAD *Payload)

This function is called repeatedly to get information on USB bus states, receive-completion and transmit-completion events on the endpoints, and notification on setup packet on endpoint 0.

A class driver must call EFI_USBFN_IO_PROTOCOL.EventHandler()repeatedly to receive updates on the transfer status and number of bytes transferred on various endpoints.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[out]MessageIndicates the event that initiated this notification.
[in,out]PayloadSizeOn input, the size of the memory pointed by Payload. On output, the amount ofdata returned in Payload.
[out]PayloadA pointer to EFI_USBFN_MESSAGE_PAYLOAD instance to return additional payload for current message.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe physical device reported an error.
EFI_NOT_READYThe physical device is busy or not ready to process this request.
EFI_BUFFER_TOO_SMALLThe Supplied buffer is not large enough to hold the message payload.

Definition at line 421 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_FREE_TRANSFER_BUFFER

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_FREE_TRANSFER_BUFFER) (IN EFI_USBFN_IO_PROTOCOL *This, IN VOID *Buffer)

Deallocates the memory allocated for the transfer buffer by the EFI_USBFN_IO_PROTOCOL.AllocateTransferBuffer() function.

The EFI_USBFN_IO_PROTOCOL.FreeTransferBuffer() function deallocates the memory specified by Buffer. The Buffer that is freed must have been allocated by EFI_USBFN_IO_PROTOCOL.AllocateTransferBuffer().

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in]BufferA pointer to the transfer buffer to deallocate.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.

Definition at line 546 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_GET_DEVICE_INFO

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_DEVICE_INFO) (IN EFI_USBFN_IO_PROTOCOL *This, IN EFI_USBFN_DEVICE_INFO_ID Id, IN OUT UINTN *BufferSize, OUT VOID *Buffer OPTIONAL)

Returns device specific information based on the supplied identifier as a Unicode string.

If the supplied Buffer isn't large enough, or is NULL, the method fails with EFI_BUFFER_TOO_SMALL and the required size is returned through BufferSize. All returned strings are in Unicode format.

An Id of EfiUsbDeviceInfoUnknown is treated as an invalid parameter.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOLinstance.
[in]IdThe requested information id.
[in]BufferSizeOn input, the size of the Buffer in bytes. On output, the amount of data returned in Buffer in bytes.
[out]BufferA pointer to a buffer to returnthe requested information as a Unicode string.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE: BufferSize is NULL. BufferSize is not 0 and Buffer is NULL. Id in invalid.
EFI_DEVICE_ERRORThe physical device reported an error.
EFI_BUFFER_TOO_SMALLThe buffer is too small to hold the buffer. BufferSize has been updated with the size needed to hold the request string.

Definition at line 283 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_GET_ENDPOINT_MAXPACKET_SIZE

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_ENDPOINT_MAXPACKET_SIZE) (IN EFI_USBFN_IO_PROTOCOL *This, IN EFI_USB_ENDPOINT_TYPE EndpointType, IN EFI_USB_BUS_SPEED BusSpeed, OUT UINT16 *MaxPacketSize)

Returns the maximum packet size of the specified endpoint type for the supplied bus speed.

If the BusSpeed is UsbBusSpeedUnknown, the maximum speed the underlying controller supports is assumed.

This protocol currently does not support isochronous or interrupt transfers. Future revisions of this protocol may eventually support it.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOLinstance.
[in]EndpointTypeEndpoint type as defined as EFI_USB_ENDPOINT_TYPE.
[in]BusSpeedBus speed as defined as EFI_USB_BUS_SPEED.
[out]MaxPacketSizeThe maximum packet size, in bytes, of the specified endpoint type.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe physical device reported an error.
EFI_NOT_READYThe physical device is busy or not ready to process this request.

Definition at line 246 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_GET_ENDPOINT_POLICY

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_ENDPOINT_POLICY) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction, IN EFI_USBFN_POLICY_TYPE PolicyType, IN OUT UINTN *BufferSize, IN OUT VOID *Buffer)

This function sets the configuration policy for the specified non-control endpoint.

This function can only be called before EFI_USBFN_IO_PROTOCOL.StartController() or after EFI_USBFN_IO_PROTOCOL.StopController() has been called.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in]EndpointIndexIndicates the non-control endpoint for which the policy needs to be set.
[in]DirectionDirection of the endpoint.
[in]PolicyTypePolicy type the user is trying to retrieve for the specified non-control endpoint.
[in,out]BufferSizeOn input, the size of Bufferin bytes. On output, the amount of data returned in Bufferin bytes.
[in,out]BufferA pointer to a buffer to return requested endpoint policy value.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe specified policy value is not supported.
EFI_BUFFER_TOO_SMALLSupplied buffer is not large enough to hold requested policy value.

Definition at line 646 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_GET_ENDPOINT_STALL_STATE

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_ENDPOINT_STALL_STATE) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction, IN OUT BOOLEAN *State)

Returns the stall state on the specified endpoint.

This function should fail with EFI_INVALID_PARAMETER if the specified direction is incorrect for the endpoint.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in]EndpointIndexIndicates the endpoint.
[in]DirectionDirection of the endpoint.
[in,out]StateBoolean, true value indicates that the endpoint is in a stalled state, false otherwise.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe physical device reported an error.
EFI_NOT_READYThe physical device is busy or not ready to process this request.

Definition at line 357 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_GET_MAXTRANSFER_SIZE

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_MAXTRANSFER_SIZE) (IN EFI_USBFN_IO_PROTOCOL *This, OUT UINTN *MaxTransferSize)

Returns the maximum supported transfer size.

Returns the maximum number of bytes that the underlying controller can accommodate in a single transfer.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[out]MaxTransferSizeThe maximum supported transfer size, in bytes.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe physical device reported an error.
EFI_NOT_READYThe physical device is busy or not ready to process this request.

Definition at line 495 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_GET_VENDOR_ID_PRODUCT_ID

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_VENDOR_ID_PRODUCT_ID) (IN EFI_USBFN_IO_PROTOCOL *This, OUT UINT16 *Vid, OUT UINT16 *Pid)

Returns the vendor-id and product-id of the device.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[out]VidReturned vendor-id of the device.
[out]PidReturned product-id of the device.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDUnable to return the vendor-id or the product-id.

Definition at line 304 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_PROTOCOL

Definition at line 32 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_SET_ENDPOINT_POLICY

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_SET_ENDPOINT_POLICY) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction, IN EFI_USBFN_POLICY_TYPE PolicyType, IN UINTN BufferSize, IN VOID *Buffer)

This function sets the configuration policy for the specified non-control endpoint.

This function can only be called before EFI_USBFN_IO_PROTOCOL.StartController() or after EFI_USBFN_IO_PROTOCOL.StopController() has been called.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in]EndpointIndexIndicates the non-control endpoint for which the policy needs to be set.
[in]DirectionDirection of the endpoint.
[in]PolicyTypePolicy type the user is trying to set for the specified non-control endpoint.
[in]BufferSizeThe size of the Bufferin bytes.
[in]BufferThe new value for the policy parameter that PolicyType specifies.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe physical device reported an error.
EFI_UNSUPPORTEDChanging this policy value is not supported.

Definition at line 610 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_SET_ENDPOINT_STALL_STATE

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_SET_ENDPOINT_STALL_STATE) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction, IN OUT BOOLEAN *State)

Sets or clears the stall state on the specified endpoint.

This function should fail with EFI_INVALID_PARAMETER if the specified direction is incorrect for the endpoint.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in]EndpointIndexIndicates the endpoint.
[in]DirectionDirection of the endpoint.
[in]StateRequested stall state on the specified endpoint. True value causes the endpoint to stall; false value clears an existing stall.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe physical device reported an error.
EFI_NOT_READYThe physical device is busy or not ready to process this request.

Definition at line 386 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_START_CONTROLLER

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_START_CONTROLLER) (IN EFI_USBFN_IO_PROTOCOL *This)

This function supplies power to the USB controller if needed and initializes the hardware and the internal data structures. The port must not be activated by this function.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe physical device reported an error.

Definition at line 565 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_STOP_CONTROLLER

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_STOP_CONTROLLER) (IN EFI_USBFN_IO_PROTOCOL *This)

This function stops the USB hardware device.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe physical device reported an error.

Definition at line 581 of file UsbFunctionIo.h.

◆ EFI_USBFN_IO_TRANSFER

typedef EFI_STATUS(EFIAPI * EFI_USBFN_IO_TRANSFER) (IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction, IN OUT UINTN *BufferSize, IN OUT VOID *Buffer)

This function handles transferring data to or from the host on the specified endpoint, depending on the direction specified.

A class driver must call EFI_USBFN_IO_PROTOCOL.EventHandler() repeatedly to receive updates on the transfer status and the number of bytes transferred on various endpoints. Upon an update of the transfer status, the Buffer field of the EFI_USBFN_TRANSFER_RESULT structure (as described in the function description for EFI_USBFN_IO_PROTOCOL.EventHandler()) must be initialized with the Buffer pointer that was supplied to this method.

The overview of the call sequence is illustrated in the Figure 54.

This function should fail with EFI_INVALID_PARAMETER if the specified direction is incorrect for the endpoint.

Parameters
[in]ThisA pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in]EndpointIndexIndicates the endpoint on which TX or RX transfer needs to take place.
[in]DirectionDirection of the endpoint.
[in,out]BufferSizeIf Direction is EfiUsbEndpointDirectionDeviceRx: On input, the size of the Bufferin bytes. On output, the amount of data returned in Buffer in bytes. If Direction is EfiUsbEndpointDirectionDeviceTx: On input, the size of the Bufferin bytes. On output, the amount of data transmitted in bytes.
[in,out]BufferIf Direction is EfiUsbEndpointDirectionDeviceRx: The Buffer to return the received data. If Directionis EfiUsbEndpointDirectionDeviceTx: The Buffer that contains the data to be transmitted.
Return values
EFI_SUCCESSThe function returned successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_DEVICE_ERRORThe physical device reported an error.
EFI_NOT_READYThe physical device is busy or not ready to process this request.

Definition at line 469 of file UsbFunctionIo.h.

Enumeration Type Documentation

◆ _EFI_USB_BUS_SPEED

enum _EFI_USB_BUS_SPEED

Definition at line 149 of file UsbFunctionIo.h.

◆ _EFI_USB_ENDPOINT_TYPE

enum _EFI_USB_ENDPOINT_TYPE

Definition at line 59 of file UsbFunctionIo.h.

◆ _EFI_USBFN_DEVICE_INFO_ID

enum _EFI_USBFN_DEVICE_INFO_ID

Definition at line 66 of file UsbFunctionIo.h.

◆ _EFI_USBFN_ENDPOINT_DIRECTION

enum _EFI_USBFN_ENDPOINT_DIRECTION

Definition at line 73 of file UsbFunctionIo.h.

◆ _EFI_USBFN_MESSAGE

enum _EFI_USBFN_MESSAGE

Definition at line 80 of file UsbFunctionIo.h.

◆ _EFI_USBFN_POLICY_TYPE

enum _EFI_USBFN_POLICY_TYPE

Definition at line 164 of file UsbFunctionIo.h.

◆ _EFI_USBFN_PORT_TYPE

enum _EFI_USBFN_PORT_TYPE

Definition at line 36 of file UsbFunctionIo.h.

◆ _EFI_USBFN_TRANSFER_STATUS

enum _EFI_USBFN_TRANSFER_STATUS

Definition at line 133 of file UsbFunctionIo.h.