2 The USB Function Protocol provides an I/O abstraction for a USB Controller
3 operating in Function mode (also commonly referred to as Device, Peripheral,
4 or Target mode) and the mechanisms by which the USB Function can communicate
5 with the USB Host. It is used by other UEFI drivers or applications to
6 perform data transactions and basic USB controller management over a USB
9 This simple protocol only supports USB 2.0 bulk transfers on systems with a
10 single configuration and a single interface. It does not support isochronous
11 or interrupt transfers, alternate interfaces, or USB 3.0 functionality.
12 Future revisions of this protocol may support these or additional features.
14 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
15 SPDX-License-Identifier: BSD-2-Clause-Patent
17 @par Revision Reference:
18 This Protocol was introduced in UEFI Specification 2.5.
22 #ifndef __USB_FUNCTION_IO_H__
23 #define __USB_FUNCTION_IO_H__
25 #include <Protocol/UsbIo.h>
27 #define EFI_USBFN_IO_PROTOCOL_GUID \
29 0x32d2963a, 0xfe5d, 0x4f30, {0xb6, 0x33, 0x6e, 0x5d, 0xc5, 0x58, 0x3, 0xcc} \
32 typedef struct _EFI_USBFN_IO_PROTOCOL EFI_USBFN_IO_PROTOCOL
;
34 #define EFI_USBFN_IO_PROTOCOL_REVISION 0x00010001
36 typedef enum _EFI_USBFN_PORT_TYPE
{
37 EfiUsbUnknownPort
= 0,
38 EfiUsbStandardDownstreamPort
,
39 EfiUsbChargingDownstreamPort
,
40 EfiUsbDedicatedChargingPort
,
41 EfiUsbInvalidDedicatedChargingPort
42 } EFI_USBFN_PORT_TYPE
;
45 EFI_USB_INTERFACE_DESCRIPTOR
*InterfaceDescriptor
;
46 EFI_USB_ENDPOINT_DESCRIPTOR
**EndpointDescriptorTable
;
47 } EFI_USB_INTERFACE_INFO
;
50 EFI_USB_CONFIG_DESCRIPTOR
*ConfigDescriptor
;
51 EFI_USB_INTERFACE_INFO
**InterfaceInfoTable
;
52 } EFI_USB_CONFIG_INFO
;
55 EFI_USB_DEVICE_DESCRIPTOR
*DeviceDescriptor
;
56 EFI_USB_CONFIG_INFO
**ConfigInfoTable
;
57 } EFI_USB_DEVICE_INFO
;
59 typedef enum _EFI_USB_ENDPOINT_TYPE
{
60 UsbEndpointControl
= 0x00,
61 //UsbEndpointIsochronous = 0x01,
62 UsbEndpointBulk
= 0x02,
63 //UsbEndpointInterrupt = 0x03
64 } EFI_USB_ENDPOINT_TYPE
;
66 typedef enum _EFI_USBFN_DEVICE_INFO_ID
{
67 EfiUsbDeviceInfoUnknown
= 0,
68 EfiUsbDeviceInfoSerialNumber
,
69 EfiUsbDeviceInfoManufacturerName
,
70 EfiUsbDeviceInfoProductName
71 } EFI_USBFN_DEVICE_INFO_ID
;
73 typedef enum _EFI_USBFN_ENDPOINT_DIRECTION
{
74 EfiUsbEndpointDirectionHostOut
= 0,
75 EfiUsbEndpointDirectionHostIn
,
76 EfiUsbEndpointDirectionDeviceTx
= EfiUsbEndpointDirectionHostIn
,
77 EfiUsbEndpointDirectionDeviceRx
= EfiUsbEndpointDirectionHostOut
78 } EFI_USBFN_ENDPOINT_DIRECTION
;
80 typedef enum _EFI_USBFN_MESSAGE
{
86 // SETUP packet is received, returned Buffer contains
87 // EFI_USB_DEVICE_REQUEST struct
91 // Indicates that some of the requested data has been received from the
92 // host. It is the responsibility of the class driver to determine if it
93 // needs to wait for any remaining data. Returned Buffer contains
94 // EFI_USBFN_TRANSFER_RESULT struct containing endpoint number, transfer
95 // status and count of bytes received.
97 EfiUsbMsgEndpointStatusChangedRx
,
99 // Indicates that some of the requested data has been transmitted to the
100 // host. It is the responsibility of the class driver to determine if any
101 // remaining data needs to be resent. Returned Buffer contains
102 // EFI_USBFN_TRANSFER_RESULT struct containing endpoint number, transfer
103 // status and count of bytes sent.
105 EfiUsbMsgEndpointStatusChangedTx
,
107 // DETACH bus event signaled
109 EfiUsbMsgBusEventDetach
,
111 // ATTACH bus event signaled
113 EfiUsbMsgBusEventAttach
,
115 // RESET bus event signaled
117 EfiUsbMsgBusEventReset
,
119 // SUSPEND bus event signaled
121 EfiUsbMsgBusEventSuspend
,
123 // RESUME bus event signaled
125 EfiUsbMsgBusEventResume
,
127 // Bus speed updated, returned buffer indicated bus speed using
128 // following enumeration named EFI_USB_BUS_SPEED
130 EfiUsbMsgBusEventSpeed
133 typedef enum _EFI_USBFN_TRANSFER_STATUS
{
134 UsbTransferStatusUnknown
= 0,
135 UsbTransferStatusComplete
,
136 UsbTransferStatusAborted
,
137 UsbTransferStatusActive
,
138 UsbTransferStatusNone
139 } EFI_USBFN_TRANSFER_STATUS
;
141 typedef struct _EFI_USBFN_TRANSFER_RESULT
{
142 UINTN BytesTransferred
;
143 EFI_USBFN_TRANSFER_STATUS TransferStatus
;
145 EFI_USBFN_ENDPOINT_DIRECTION Direction
;
147 } EFI_USBFN_TRANSFER_RESULT
;
149 typedef enum _EFI_USB_BUS_SPEED
{
150 UsbBusSpeedUnknown
= 0,
155 UsbBusSpeedMaximum
= UsbBusSpeedSuper
158 typedef union _EFI_USBFN_MESSAGE_PAYLOAD
{
159 EFI_USB_DEVICE_REQUEST udr
;
160 EFI_USBFN_TRANSFER_RESULT utr
;
161 EFI_USB_BUS_SPEED ubs
;
162 } EFI_USBFN_MESSAGE_PAYLOAD
;
164 typedef enum _EFI_USBFN_POLICY_TYPE
{
165 EfiUsbPolicyUndefined
= 0,
166 EfiUsbPolicyMaxTransactionSize
,
167 EfiUsbPolicyZeroLengthTerminationSupport
,
168 EfiUsbPolicyZeroLengthTermination
169 } EFI_USBFN_POLICY_TYPE
;
172 Returns information about what USB port type was attached.
174 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
175 @param[out] PortType Returns the USB port type.
177 @retval EFI_SUCCESS The function returned successfully.
178 @retval EFI_INVALID_PARAMETER A parameter is invalid.
179 @retval EFI_DEVICE_ERROR The physical device reported an error.
180 @retval EFI_NOT_READY The physical device is busy or not ready to
181 process this request or there is no USB port
182 attached to the device.
187 (EFIAPI
*EFI_USBFN_IO_DETECT_PORT
) (
188 IN EFI_USBFN_IO_PROTOCOL
*This
,
189 OUT EFI_USBFN_PORT_TYPE
*PortType
193 Configures endpoints based on supplied device and configuration descriptors.
195 Assuming that the hardware has already been initialized, this function configures
196 the endpoints using the device information supplied by DeviceInfo, activates the
197 port, and starts receiving USB events.
199 This function must ignore the bMaxPacketSize0field of the Standard Device Descriptor
200 and the wMaxPacketSize field of the Standard Endpoint Descriptor that are made
201 available through DeviceInfo.
203 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
204 @param[out] DeviceInfo A pointer to EFI_USBFN_DEVICE_INFO instance.
206 @retval EFI_SUCCESS The function returned successfully.
207 @retval EFI_INVALID_PARAMETER A parameter is invalid.
208 @retval EFI_DEVICE_ERROR The physical device reported an error.
209 @retval EFI_NOT_READY The physical device is busy or not ready to process
211 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to lack of
217 (EFIAPI
*EFI_USBFN_IO_CONFIGURE_ENABLE_ENDPOINTS
) (
218 IN EFI_USBFN_IO_PROTOCOL
*This
,
219 OUT EFI_USB_DEVICE_INFO
*DeviceInfo
223 Returns the maximum packet size of the specified endpoint type for the supplied
226 If the BusSpeed is UsbBusSpeedUnknown, the maximum speed the underlying controller
229 This protocol currently does not support isochronous or interrupt transfers. Future
230 revisions of this protocol may eventually support it.
232 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOLinstance.
233 @param[in] EndpointType Endpoint type as defined as EFI_USB_ENDPOINT_TYPE.
234 @param[in] BusSpeed Bus speed as defined as EFI_USB_BUS_SPEED.
235 @param[out] MaxPacketSize The maximum packet size, in bytes, of the specified
238 @retval EFI_SUCCESS The function returned successfully.
239 @retval EFI_INVALID_PARAMETER A parameter is invalid.
240 @retval EFI_DEVICE_ERROR The physical device reported an error.
241 @retval EFI_NOT_READY The physical device is busy or not ready to process
247 (EFIAPI
*EFI_USBFN_IO_GET_ENDPOINT_MAXPACKET_SIZE
) (
248 IN EFI_USBFN_IO_PROTOCOL
*This
,
249 IN EFI_USB_ENDPOINT_TYPE EndpointType
,
250 IN EFI_USB_BUS_SPEED BusSpeed
,
251 OUT UINT16
*MaxPacketSize
255 Returns device specific information based on the supplied identifier as a Unicode string.
257 If the supplied Buffer isn't large enough, or is NULL, the method fails with
258 EFI_BUFFER_TOO_SMALL and the required size is returned through BufferSize. All returned
259 strings are in Unicode format.
261 An Id of EfiUsbDeviceInfoUnknown is treated as an invalid parameter.
263 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOLinstance.
264 @param[in] Id The requested information id.
267 @param[in] BufferSize On input, the size of the Buffer in bytes. On output, the
268 amount of data returned in Buffer in bytes.
269 @param[out] Buffer A pointer to a buffer to returnthe requested information
272 @retval EFI_SUCCESS The function returned successfully.
273 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
275 *BufferSize is not 0 and Buffer is NULL.
277 @retval EFI_DEVICE_ERROR The physical device reported an error.
278 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
279 *BufferSize has been updated with the size needed to hold the request string.
284 (EFIAPI
*EFI_USBFN_IO_GET_DEVICE_INFO
) (
285 IN EFI_USBFN_IO_PROTOCOL
*This
,
286 IN EFI_USBFN_DEVICE_INFO_ID Id
,
287 IN OUT UINTN
*BufferSize
,
288 OUT VOID
*Buffer OPTIONAL
292 Returns the vendor-id and product-id of the device.
294 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
295 @param[out] Vid Returned vendor-id of the device.
296 @param[out] Pid Returned product-id of the device.
298 @retval EFI_SUCCESS The function returned successfully.
299 @retval EFI_INVALID_PARAMETER A parameter is invalid.
300 @retval EFI_NOT_FOUND Unable to return the vendor-id or the product-id.
305 (EFIAPI
*EFI_USBFN_IO_GET_VENDOR_ID_PRODUCT_ID
) (
306 IN EFI_USBFN_IO_PROTOCOL
*This
,
312 Aborts the transfer on the specified endpoint.
314 This function should fail with EFI_INVALID_PARAMETER if the specified direction
315 is incorrect for the endpoint.
317 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
318 @param[in] EndpointIndex Indicates the endpoint on which the ongoing transfer
319 needs to be canceled.
320 @param[in] Direction Direction of the endpoint.
322 @retval EFI_SUCCESS The function returned successfully.
323 @retval EFI_INVALID_PARAMETER A parameter is invalid.
324 @retval EFI_DEVICE_ERROR The physical device reported an error.
325 @retval EFI_NOT_READY The physical device is busy or not ready to process
331 (EFIAPI
*EFI_USBFN_IO_ABORT_TRANSFER
) (
332 IN EFI_USBFN_IO_PROTOCOL
*This
,
333 IN UINT8 EndpointIndex
,
334 IN EFI_USBFN_ENDPOINT_DIRECTION Direction
338 Returns the stall state on the specified endpoint.
340 This function should fail with EFI_INVALID_PARAMETER if the specified direction
341 is incorrect for the endpoint.
343 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
344 @param[in] EndpointIndex Indicates the endpoint.
345 @param[in] Direction Direction of the endpoint.
346 @param[in, out] State Boolean, true value indicates that the endpoint
347 is in a stalled state, false otherwise.
349 @retval EFI_SUCCESS The function returned successfully.
350 @retval EFI_INVALID_PARAMETER A parameter is invalid.
351 @retval EFI_DEVICE_ERROR The physical device reported an error.
352 @retval EFI_NOT_READY The physical device is busy or not ready to process
358 (EFIAPI
*EFI_USBFN_IO_GET_ENDPOINT_STALL_STATE
) (
359 IN EFI_USBFN_IO_PROTOCOL
*This
,
360 IN UINT8 EndpointIndex
,
361 IN EFI_USBFN_ENDPOINT_DIRECTION Direction
,
362 IN OUT BOOLEAN
*State
366 Sets or clears the stall state on the specified endpoint.
368 This function should fail with EFI_INVALID_PARAMETER if the specified direction
369 is incorrect for the endpoint.
371 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
372 @param[in] EndpointIndex Indicates the endpoint.
373 @param[in] Direction Direction of the endpoint.
374 @param[in] State Requested stall state on the specified endpoint.
375 True value causes the endpoint to stall; false
376 value clears an existing stall.
378 @retval EFI_SUCCESS The function returned successfully.
379 @retval EFI_INVALID_PARAMETER A parameter is invalid.
380 @retval EFI_DEVICE_ERROR The physical device reported an error.
381 @retval EFI_NOT_READY The physical device is busy or not ready to process
387 (EFIAPI
*EFI_USBFN_IO_SET_ENDPOINT_STALL_STATE
) (
388 IN EFI_USBFN_IO_PROTOCOL
*This
,
389 IN UINT8 EndpointIndex
,
390 IN EFI_USBFN_ENDPOINT_DIRECTION Direction
,
391 IN OUT BOOLEAN
*State
395 This function is called repeatedly to get information on USB bus states,
396 receive-completion and transmit-completion events on the endpoints, and
397 notification on setup packet on endpoint 0.
399 A class driver must call EFI_USBFN_IO_PROTOCOL.EventHandler()repeatedly
400 to receive updates on the transfer status and number of bytes transferred
401 on various endpoints.
403 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
404 @param[out] Message Indicates the event that initiated this notification.
405 @param[in, out] PayloadSize On input, the size of the memory pointed by
406 Payload. On output, the amount ofdata returned
408 @param[out] Payload A pointer to EFI_USBFN_MESSAGE_PAYLOAD instance
409 to return additional payload for current message.
411 @retval EFI_SUCCESS The function returned successfully.
412 @retval EFI_INVALID_PARAMETER A parameter is invalid.
413 @retval EFI_DEVICE_ERROR The physical device reported an error.
414 @retval EFI_NOT_READY The physical device is busy or not ready to process
416 @retval EFI_BUFFER_TOO_SMALL The Supplied buffer is not large enough to hold
422 (EFIAPI
*EFI_USBFN_IO_EVENTHANDLER
) (
423 IN EFI_USBFN_IO_PROTOCOL
*This
,
424 OUT EFI_USBFN_MESSAGE
*Message
,
425 IN OUT UINTN
*PayloadSize
,
426 OUT EFI_USBFN_MESSAGE_PAYLOAD
*Payload
430 This function handles transferring data to or from the host on the specified
431 endpoint, depending on the direction specified.
433 A class driver must call EFI_USBFN_IO_PROTOCOL.EventHandler() repeatedly to
434 receive updates on the transfer status and the number of bytes transferred on
435 various endpoints. Upon an update of the transfer status, the Buffer field of
436 the EFI_USBFN_TRANSFER_RESULT structure (as described in the function description
437 for EFI_USBFN_IO_PROTOCOL.EventHandler()) must be initialized with the Buffer
438 pointer that was supplied to this method.
440 The overview of the call sequence is illustrated in the Figure 54.
442 This function should fail with EFI_INVALID_PARAMETER if the specified direction
443 is incorrect for the endpoint.
445 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
446 @param[in] EndpointIndex Indicates the endpoint on which TX or RX transfer
448 @param[in] Direction Direction of the endpoint.
449 @param[in, out] BufferSize If Direction is EfiUsbEndpointDirectionDeviceRx:
450 On input, the size of the Bufferin bytes.
451 On output, the amount of data returned in Buffer
453 If Direction is EfiUsbEndpointDirectionDeviceTx:
454 On input, the size of the Bufferin bytes.
455 On output, the amount of data transmitted in bytes.
456 @param[in, out] Buffer If Direction is EfiUsbEndpointDirectionDeviceRx:
457 The Buffer to return the received data.
458 If Directionis EfiUsbEndpointDirectionDeviceTx:
459 The Buffer that contains the data to be transmitted.
461 @retval EFI_SUCCESS The function returned successfully.
462 @retval EFI_INVALID_PARAMETER A parameter is invalid.
463 @retval EFI_DEVICE_ERROR The physical device reported an error.
464 @retval EFI_NOT_READY The physical device is busy or not ready to process
470 (EFIAPI
*EFI_USBFN_IO_TRANSFER
) (
471 IN EFI_USBFN_IO_PROTOCOL
*This
,
472 IN UINT8 EndpointIndex
,
473 IN EFI_USBFN_ENDPOINT_DIRECTION Direction
,
474 IN OUT UINTN
*BufferSize
,
479 Returns the maximum supported transfer size.
481 Returns the maximum number of bytes that the underlying controller can accommodate
482 in a single transfer.
484 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
485 @param[out] MaxTransferSize The maximum supported transfer size, in bytes.
487 @retval EFI_SUCCESS The function returned successfully.
488 @retval EFI_INVALID_PARAMETER A parameter is invalid.
489 @retval EFI_DEVICE_ERROR The physical device reported an error.
490 @retval EFI_NOT_READY The physical device is busy or not ready to process
496 (EFIAPI
*EFI_USBFN_IO_GET_MAXTRANSFER_SIZE
) (
497 IN EFI_USBFN_IO_PROTOCOL
*This
,
498 OUT UINTN
*MaxTransferSize
502 Allocates a transfer buffer of the specified sizethat satisfies the controller
505 The AllocateTransferBuffer() function allocates a memory region of Size bytes and
506 returns the address of the allocated memory that satisfies the underlying controller
507 requirements in the location referenced by Buffer.
509 The allocated transfer buffer must be freed using a matching call to
510 EFI_USBFN_IO_PROTOCOL.FreeTransferBuffer()function.
512 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
513 @param[in] Size The number of bytes to allocate for the transfer buffer.
514 @param[out] Buffer A pointer to a pointer to the allocated buffer if the
515 call succeeds; undefined otherwise.
517 @retval EFI_SUCCESS The function returned successfully.
518 @retval EFI_INVALID_PARAMETER A parameter is invalid.
519 @retval EFI_OUT_OF_RESOURCES The requested transfer buffer could not be allocated.
524 (EFIAPI
*EFI_USBFN_IO_ALLOCATE_TRANSFER_BUFFER
) (
525 IN EFI_USBFN_IO_PROTOCOL
*This
,
531 Deallocates the memory allocated for the transfer buffer by the
532 EFI_USBFN_IO_PROTOCOL.AllocateTransferBuffer() function.
534 The EFI_USBFN_IO_PROTOCOL.FreeTransferBuffer() function deallocates the
535 memory specified by Buffer. The Buffer that is freed must have been allocated
536 by EFI_USBFN_IO_PROTOCOL.AllocateTransferBuffer().
538 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
539 @param[in] Buffer A pointer to the transfer buffer to deallocate.
541 @retval EFI_SUCCESS The function returned successfully.
542 @retval EFI_INVALID_PARAMETER A parameter is invalid.
547 (EFIAPI
*EFI_USBFN_IO_FREE_TRANSFER_BUFFER
) (
548 IN EFI_USBFN_IO_PROTOCOL
*This
,
553 This function supplies power to the USB controller if needed and initializes
554 the hardware and the internal data structures. The port must not be activated
557 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
559 @retval EFI_SUCCESS The function returned successfully.
560 @retval EFI_INVALID_PARAMETER A parameter is invalid.
561 @retval EFI_DEVICE_ERROR The physical device reported an error.
566 (EFIAPI
*EFI_USBFN_IO_START_CONTROLLER
) (
567 IN EFI_USBFN_IO_PROTOCOL
*This
571 This function stops the USB hardware device.
573 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
575 @retval EFI_SUCCESS The function returned successfully.
576 @retval EFI_INVALID_PARAMETER A parameter is invalid.
577 @retval EFI_DEVICE_ERROR The physical device reported an error.
582 (EFIAPI
*EFI_USBFN_IO_STOP_CONTROLLER
) (
583 IN EFI_USBFN_IO_PROTOCOL
*This
587 This function sets the configuration policy for the specified non-control
590 This function can only be called before EFI_USBFN_IO_PROTOCOL.StartController()
591 or after EFI_USBFN_IO_PROTOCOL.StopController() has been called.
593 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
594 @param[in] EndpointIndex Indicates the non-control endpoint for which the
595 policy needs to be set.
596 @param[in] Direction Direction of the endpoint.
597 @param[in] PolicyType Policy type the user is trying to set for the
598 specified non-control endpoint.
599 @param[in] BufferSize The size of the Bufferin bytes.
600 @param[in] Buffer The new value for the policy parameter that
601 PolicyType specifies.
603 @retval EFI_SUCCESS The function returned successfully.
604 @retval EFI_INVALID_PARAMETER A parameter is invalid.
605 @retval EFI_DEVICE_ERROR The physical device reported an error.
606 @retval EFI_UNSUPPORTED Changing this policy value is not supported.
611 (EFIAPI
*EFI_USBFN_IO_SET_ENDPOINT_POLICY
) (
612 IN EFI_USBFN_IO_PROTOCOL
*This
,
613 IN UINT8 EndpointIndex
,
614 IN EFI_USBFN_ENDPOINT_DIRECTION Direction
,
615 IN EFI_USBFN_POLICY_TYPE PolicyType
,
621 This function sets the configuration policy for the specified non-control
624 This function can only be called before EFI_USBFN_IO_PROTOCOL.StartController()
625 or after EFI_USBFN_IO_PROTOCOL.StopController() has been called.
627 @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
628 @param[in] EndpointIndex Indicates the non-control endpoint for which the
629 policy needs to be set.
630 @param[in] Direction Direction of the endpoint.
631 @param[in] PolicyType Policy type the user is trying to retrieve for
632 the specified non-control endpoint.
633 @param[in, out] BufferSize On input, the size of Bufferin bytes. On output,
634 the amount of data returned in Bufferin bytes.
635 @param[in, out] Buffer A pointer to a buffer to return requested endpoint
638 @retval EFI_SUCCESS The function returned successfully.
639 @retval EFI_INVALID_PARAMETER A parameter is invalid.
640 @retval EFI_DEVICE_ERROR The specified policy value is not supported.
641 @retval EFI_BUFFER_TOO_SMALL Supplied buffer is not large enough to hold requested
647 (EFIAPI
*EFI_USBFN_IO_GET_ENDPOINT_POLICY
) (
648 IN EFI_USBFN_IO_PROTOCOL
*This
,
649 IN UINT8 EndpointIndex
,
650 IN EFI_USBFN_ENDPOINT_DIRECTION Direction
,
651 IN EFI_USBFN_POLICY_TYPE PolicyType
,
652 IN OUT UINTN
*BufferSize
,
657 /// The EFI_USBFN_IO_PROTOCOL provides basic data transactions and basic USB
658 /// controller management for a USB Function port.
660 struct _EFI_USBFN_IO_PROTOCOL
{
662 EFI_USBFN_IO_DETECT_PORT DetectPort
;
663 EFI_USBFN_IO_CONFIGURE_ENABLE_ENDPOINTS ConfigureEnableEndpoints
;
664 EFI_USBFN_IO_GET_ENDPOINT_MAXPACKET_SIZE GetEndpointMaxPacketSize
;
665 EFI_USBFN_IO_GET_DEVICE_INFO GetDeviceInfo
;
666 EFI_USBFN_IO_GET_VENDOR_ID_PRODUCT_ID GetVendorIdProductId
;
667 EFI_USBFN_IO_ABORT_TRANSFER AbortTransfer
;
668 EFI_USBFN_IO_GET_ENDPOINT_STALL_STATE GetEndpointStallState
;
669 EFI_USBFN_IO_SET_ENDPOINT_STALL_STATE SetEndpointStallState
;
670 EFI_USBFN_IO_EVENTHANDLER EventHandler
;
671 EFI_USBFN_IO_TRANSFER Transfer
;
672 EFI_USBFN_IO_GET_MAXTRANSFER_SIZE GetMaxTransferSize
;
673 EFI_USBFN_IO_ALLOCATE_TRANSFER_BUFFER AllocateTransferBuffer
;
674 EFI_USBFN_IO_FREE_TRANSFER_BUFFER FreeTransferBuffer
;
675 EFI_USBFN_IO_START_CONTROLLER StartController
;
676 EFI_USBFN_IO_STOP_CONTROLLER StopController
;
677 EFI_USBFN_IO_SET_ENDPOINT_POLICY SetEndpointPolicy
;
678 EFI_USBFN_IO_GET_ENDPOINT_POLICY GetEndpointPolicy
;
681 extern EFI_GUID gEfiUsbFunctionIoProtocolGuid
;