22#ifndef __USB_FUNCTION_IO_H__
23#define __USB_FUNCTION_IO_H__
27#define EFI_USBFN_IO_PROTOCOL_GUID \
29 0x32d2963a, 0xfe5d, 0x4f30, {0xb6, 0x33, 0x6e, 0x5d, 0xc5, 0x58, 0x3, 0xcc} \
34#define EFI_USBFN_IO_PROTOCOL_REVISION 0x00010001
36typedef enum _EFI_USBFN_PORT_TYPE {
37 EfiUsbUnknownPort = 0,
38 EfiUsbStandardDownstreamPort,
39 EfiUsbChargingDownstreamPort,
40 EfiUsbDedicatedChargingPort,
41 EfiUsbInvalidDedicatedChargingPort
59typedef enum _EFI_USB_ENDPOINT_TYPE {
60 UsbEndpointControl = 0x00,
62 UsbEndpointBulk = 0x02,
64} EFI_USB_ENDPOINT_TYPE;
66typedef enum _EFI_USBFN_DEVICE_INFO_ID {
67 EfiUsbDeviceInfoUnknown = 0,
68 EfiUsbDeviceInfoSerialNumber,
69 EfiUsbDeviceInfoManufacturerName,
70 EfiUsbDeviceInfoProductName
71} EFI_USBFN_DEVICE_INFO_ID;
73typedef enum _EFI_USBFN_ENDPOINT_DIRECTION {
74 EfiUsbEndpointDirectionHostOut = 0,
75 EfiUsbEndpointDirectionHostIn,
76 EfiUsbEndpointDirectionDeviceTx = EfiUsbEndpointDirectionHostIn,
77 EfiUsbEndpointDirectionDeviceRx = EfiUsbEndpointDirectionHostOut
78} EFI_USBFN_ENDPOINT_DIRECTION;
80typedef enum _EFI_USBFN_MESSAGE {
97 EfiUsbMsgEndpointStatusChangedRx,
105 EfiUsbMsgEndpointStatusChangedTx,
109 EfiUsbMsgBusEventDetach,
113 EfiUsbMsgBusEventAttach,
117 EfiUsbMsgBusEventReset,
121 EfiUsbMsgBusEventSuspend,
125 EfiUsbMsgBusEventResume,
130 EfiUsbMsgBusEventSpeed
133typedef enum _EFI_USBFN_TRANSFER_STATUS {
134 UsbTransferStatusUnknown = 0,
135 UsbTransferStatusComplete,
136 UsbTransferStatusAborted,
137 UsbTransferStatusActive,
138 UsbTransferStatusNone
139} EFI_USBFN_TRANSFER_STATUS;
142 UINTN BytesTransferred;
143 EFI_USBFN_TRANSFER_STATUS TransferStatus;
145 EFI_USBFN_ENDPOINT_DIRECTION Direction;
149typedef enum _EFI_USB_BUS_SPEED {
150 UsbBusSpeedUnknown = 0,
155 UsbBusSpeedMaximum = UsbBusSpeedSuper
161 EFI_USB_BUS_SPEED ubs;
164typedef enum _EFI_USBFN_POLICY_TYPE {
165 EfiUsbPolicyUndefined = 0,
166 EfiUsbPolicyMaxTransactionSize,
167 EfiUsbPolicyZeroLengthTerminationSupport,
168 EfiUsbPolicyZeroLengthTermination
169} EFI_USBFN_POLICY_TYPE;
189 OUT EFI_USBFN_PORT_TYPE *PortType
249 IN EFI_USB_ENDPOINT_TYPE EndpointType,
250 IN EFI_USB_BUS_SPEED BusSpeed,
251 OUT UINT16 *MaxPacketSize
286 IN EFI_USBFN_DEVICE_INFO_ID Id,
333 IN UINT8 EndpointIndex,
334 IN EFI_USBFN_ENDPOINT_DIRECTION Direction
360 IN UINT8 EndpointIndex,
361 IN EFI_USBFN_ENDPOINT_DIRECTION Direction,
362 IN OUT BOOLEAN *State
389 IN UINT8 EndpointIndex,
390 IN EFI_USBFN_ENDPOINT_DIRECTION Direction,
391 IN OUT BOOLEAN *State
424 OUT EFI_USBFN_MESSAGE *Message,
472 IN UINT8 EndpointIndex,
473 IN EFI_USBFN_ENDPOINT_DIRECTION Direction,
613 IN UINT8 EndpointIndex,
614 IN EFI_USBFN_ENDPOINT_DIRECTION Direction,
615 IN EFI_USBFN_POLICY_TYPE PolicyType,
649 IN UINT8 EndpointIndex,
650 IN EFI_USBFN_ENDPOINT_DIRECTION Direction,
651 IN EFI_USBFN_POLICY_TYPE PolicyType,
681extern EFI_GUID gEfiUsbFunctionIoProtocolGuid;
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)
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)
EFI_STATUS(EFIAPI * EFI_USBFN_IO_ALLOCATE_TRANSFER_BUFFER)(IN EFI_USBFN_IO_PROTOCOL *This, IN UINTN Size, OUT VOID **Buffer)
EFI_STATUS(EFIAPI * EFI_USBFN_IO_STOP_CONTROLLER)(IN EFI_USBFN_IO_PROTOCOL *This)
EFI_STATUS(EFIAPI * EFI_USBFN_IO_CONFIGURE_ENABLE_ENDPOINTS)(IN EFI_USBFN_IO_PROTOCOL *This, OUT EFI_USB_DEVICE_INFO *DeviceInfo)
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)
EFI_STATUS(EFIAPI * EFI_USBFN_IO_DETECT_PORT)(IN EFI_USBFN_IO_PROTOCOL *This, OUT EFI_USBFN_PORT_TYPE *PortType)
EFI_STATUS(EFIAPI * EFI_USBFN_IO_ABORT_TRANSFER)(IN EFI_USBFN_IO_PROTOCOL *This, IN UINT8 EndpointIndex, IN EFI_USBFN_ENDPOINT_DIRECTION Direction)
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)
EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_VENDOR_ID_PRODUCT_ID)(IN EFI_USBFN_IO_PROTOCOL *This, OUT UINT16 *Vid, OUT UINT16 *Pid)
EFI_STATUS(EFIAPI * EFI_USBFN_IO_FREE_TRANSFER_BUFFER)(IN EFI_USBFN_IO_PROTOCOL *This, IN VOID *Buffer)
EFI_STATUS(EFIAPI * EFI_USBFN_IO_GET_MAXTRANSFER_SIZE)(IN EFI_USBFN_IO_PROTOCOL *This, OUT UINTN *MaxTransferSize)
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)
EFI_STATUS(EFIAPI * EFI_USBFN_IO_START_CONTROLLER)(IN EFI_USBFN_IO_PROTOCOL *This)
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)
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)
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)