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, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define EFI_USBFN_IO_PROTOCOL_GUID |
Value:
{ \ 0x32d2963a, 0xfe5d, 0x4f30, {0xb6, 0x33, 0x6e, 0x5d, 0xc5, 0x58, 0x3, 0xcc} \ }
#define EFI_USBFN_IO_PROTOCOL_REVISION 0x00010001 |
typedef IN UINT8 IN EFI_USBFN_ENDPOINT_DIRECTION IN EFI_USBFN_POLICY_TYPE IN OUT UINTN IN OUT VOID* Buffer |
typedef IN UINT8 IN EFI_USBFN_ENDPOINT_DIRECTION IN EFI_USBFN_POLICY_TYPE IN OUT UINTN* BufferSize |
typedef IN EFI_USB_ENDPOINT_TYPE IN EFI_USB_BUS_SPEED BusSpeed |
typedef OUT EFI_USB_DEVICE_INFO* DeviceInfo |
typedef IN UINT8 IN EFI_USBFN_ENDPOINT_DIRECTION Direction |
typedef enum _EFI_USB_BUS_SPEED EFI_USB_BUS_SPEED |
typedef enum _EFI_USB_ENDPOINT_TYPE EFI_USB_ENDPOINT_TYPE |
typedef enum _EFI_USBFN_DEVICE_INFO_ID EFI_USBFN_DEVICE_INFO_ID |
typedef struct _EFI_USBFN_IO_PROTOCOL EFI_USBFN_IO_PROTOCOL |
typedef enum _EFI_USBFN_MESSAGE EFI_USBFN_MESSAGE |
typedef union _EFI_USBFN_MESSAGE_PAYLOAD EFI_USBFN_MESSAGE_PAYLOAD |
typedef enum _EFI_USBFN_POLICY_TYPE EFI_USBFN_POLICY_TYPE |
typedef enum _EFI_USBFN_PORT_TYPE EFI_USBFN_PORT_TYPE |
typedef struct _EFI_USBFN_TRANSFER_RESULT EFI_USBFN_TRANSFER_RESULT |
typedef enum _EFI_USBFN_TRANSFER_STATUS EFI_USBFN_TRANSFER_STATUS |
typedef IN UINT8 EndpointIndex |
typedef IN EFI_USB_ENDPOINT_TYPE EndpointType |
typedef IN EFI_USBFN_DEVICE_INFO_ID Id |
typedef IN EFI_USB_ENDPOINT_TYPE IN EFI_USB_BUS_SPEED OUT UINT16* MaxPacketSize |
typedef OUT UINTN* MaxTransferSize |
typedef OUT EFI_USBFN_MESSAGE* Message |
typedef OUT EFI_USBFN_MESSAGE IN OUT UINTN OUT EFI_USBFN_MESSAGE_PAYLOAD* Payload |
typedef OUT EFI_USBFN_MESSAGE IN OUT UINTN* PayloadSize |
typedef IN UINT8 IN EFI_USBFN_ENDPOINT_DIRECTION IN EFI_USBFN_POLICY_TYPE PolicyType |
typedef OUT EFI_USBFN_PORT_TYPE* PortType |
typedef IN UINTN Size |
typedef IN UINT8 IN EFI_USBFN_ENDPOINT_DIRECTION IN OUT BOOLEAN* State |
enum _EFI_USB_BUS_SPEED |
enum _EFI_USBFN_MESSAGE |
enum _EFI_USBFN_PORT_TYPE |
typedef EFI_STATUS | ( | EFIAPI * | EFI_USBFN_IO_GET_ENDPOINT_POLICY | ) |
Returns information about what USB port type was attached.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[out] | PortType | Returns the USB port type. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. | |
EFI_NOT_READY | The physical device is busy or not ready to process this request or there is no USB port attached to the device. |
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.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[out] | DeviceInfo | A pointer to EFI_USBFN_DEVICE_INFO instance. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. | |
EFI_NOT_READY | The physical device is busy or not ready to process this request. | |
EFI_OUT_OF_RESOURCES | The request could not be completed due to lack of resources. |
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.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOLinstance. |
[in] | EndpointType | Endpoint type as defined as EFI_USB_ENDPOINT_TYPE. |
[in] | BusSpeed | Bus speed as defined as EFI_USB_BUS_SPEED. |
[out] | MaxPacketSize | The maximum packet size, in bytes, of the specified endpoint type. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. | |
EFI_NOT_READY | The physical device is busy or not ready to process this request. |
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.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOLinstance. |
[in] | Id | The requested information id. |
[in] | BufferSize | On input, the size of the Buffer in bytes. On output, the amount of data returned in Buffer in bytes. |
[out] | Buffer | A pointer to a buffer to returnthe requested information as a Unicode string. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. | |
EFI_BUFFER_TOO_SMALL | Supplied buffer isn't large enough to hold the request string. |
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[out] | Vid | Returned vendor-id of the device. |
[out] | Pid | Returned product-id of the device. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_NOT_FOUND | Unable to return the vendor-id or the product-id. |
This function should fail with EFI_INVALID_PARAMETER if the specified direction is incorrect for the endpoint.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[in] | EndpointIndex | Indicates the endpoint on which the ongoing transfer needs to be canceled. |
[in] | Direction | Direction of the endpoint. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. | |
EFI_NOT_READY | The physical device is busy or not ready to process this request. |
This function should fail with EFI_INVALID_PARAMETER if the specified direction is incorrect for the endpoint.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[in] | EndpointIndex | Indicates the endpoint. |
[in] | Direction | Direction of the endpoint. |
[in,out] | State | Boolean, true value indicates that the endpoint is in a stalled state, false otherwise. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. | |
EFI_NOT_READY | The physical device is busy or not ready to process this request. |
This function should fail with EFI_INVALID_PARAMETER if the specified direction is incorrect for the endpoint.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[in] | EndpointIndex | Indicates the endpoint. |
[in] | Direction | Direction of the endpoint. |
[in] | State | Requested stall state on the specified endpoint. True value causes the endpoint to stall; false value clears an existing stall. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. | |
EFI_NOT_READY | The physical device is busy or not ready to process this request. |
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.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[out] | Message | Indicates the event that initiated this notification. |
[in,out] | PayloadSize | On input, the size of the memory pointed by Payload. On output, the amount ofdata returned in Payload. |
[out] | Payload | A pointer to EFI_USBFN_MESSAGE_PAYLOAD instance to return additional payload for current message. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. | |
EFI_NOT_READY | The physical device is busy or not ready to process this request. | |
EFI_BUFFER_TOO_SMALL | The Supplied buffer is not large enough to hold the message payload. |
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.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[in] | EndpointIndex | Indicates the endpoint on which TX or RX transfer needs to take place. |
[in] | Direction | Direction of the endpoint. |
[in,out] | BufferSize | If 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] | Buffer | If Direction is EfiUsbEndpointDirectionDeviceRx: The Buffer to return the received data. If Directionis EfiUsbEndpointDirectionDeviceTx: The Buffer that contains the data to be transmitted. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. | |
EFI_NOT_READY | The physical device is busy or not ready to process this request. |
Returns the maximum number of bytes that the underlying controller can accommodate in a single transfer.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[out] | MaxTransferSize | The maximum supported transfer size, in bytes. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. | |
EFI_NOT_READY | The physical device is busy or not ready to process this request. |
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.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[in] | Size | The number of bytes to allocate for the transfer buffer. |
[out] | Buffer | A pointer to a pointer to the allocated buffer if the call succeeds; undefined otherwise. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_OUT_OF_RESOURCES | The requested transfer buffer could not be allocated. |
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().
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[in] | Buffer | A pointer to the transfer buffer to deallocate. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. |
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. |
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. |
This function can only be called before EFI_USBFN_IO_PROTOCOL.StartController() or after EFI_USBFN_IO_PROTOCOL.StopController() has been called.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[in] | EndpointIndex | Indicates the non-control endpoint for which the policy needs to be set. |
[in] | Direction | Direction of the endpoint. |
[in] | PolicyType | Policy type the user is trying to set for the specified non-control endpoint. |
[in] | BufferSize | The size of the Bufferin bytes. |
[in] | Buffer | The new value for the policy parameter that PolicyType specifies. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The physical device reported an error. | |
EFI_UNSUPPORTED | Changing this policy value is not supported. |
This function can only be called before EFI_USBFN_IO_PROTOCOL.StartController() or after EFI_USBFN_IO_PROTOCOL.StopController() has been called.
[in] | This | A pointer to the EFI_USBFN_IO_PROTOCOL instance. |
[in] | EndpointIndex | Indicates the non-control endpoint for which the policy needs to be set. |
[in] | Direction | Direction of the endpoint. |
[in] | PolicyType | Policy type the user is trying to retrieve for the specified non-control endpoint. |
[in,out] | BufferSize | On input, the size of Bufferin bytes. On output, the amount of data returned in Bufferin bytes. |
[in,out] | Buffer | A pointer to a buffer to return requested endpoint policy value. |
EFI_SUCCESS | The function returned successfully. | |
EFI_INVALID_PARAMETER | A parameter is invalid. | |
EFI_DEVICE_ERROR | The specified policy value is not supported. | |
EFI_BUFFER_TOO_SMALL | Supplied buffer is not large enough to hold requested policy value. |