2 Copyright (c) 2006, Intel Corporation
3 All rights reserved. This program and the accompanying materials
4 are licensed and made available under the terms and conditions of the BSD License
5 which accompanies this distribution. The full text of the license may be found at
6 http://opensource.org/licenses/bsd-license.php
8 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
9 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 Header file for USB bus driver Interface
25 #ifndef _EFI_USB_BUS_H
26 #define _EFI_USB_BUS_H
29 #include <IndustryStandard/Usb.h>
34 extern UINTN gUSBDebugLevel
;
35 extern UINTN gUSBErrorLevel
;
38 #define MICROSECOND 10000
39 #define ONESECOND (1000 * MICROSECOND)
40 #define BUSPOLLING_PERIOD ONESECOND
42 // We define some maximun value here
44 #define USB_MAXCONFIG 8
45 #define USB_MAXALTSETTING 4
46 #define USB_MAXINTERFACES 32
47 #define USB_MAXENDPOINTS 16
48 #define USB_MAXSTRINGS 16
49 #define USB_MAXLANID 16
50 #define USB_MAXCHILDREN 8
51 #define USB_MAXCONTROLLERS 4
53 #define USB_IO_CONTROLLER_SIGNATURE EFI_SIGNATURE_32 ('u', 's', 'b', 'd')
64 EFI_USB_ENDPOINT_DESCRIPTOR EndpointDescriptor
;
65 } ENDPOINT_DESC_LIST_ENTRY
;
69 EFI_USB_INTERFACE_DESCRIPTOR InterfaceDescriptor
;
70 LIST_ENTRY EndpointDescListHead
;
71 } INTERFACE_DESC_LIST_ENTRY
;
75 EFI_USB_CONFIG_DESCRIPTOR CongfigDescriptor
;
76 LIST_ENTRY InterfaceDescListHead
;
77 UINTN ActiveInterface
;
78 } CONFIG_DESC_LIST_ENTRY
;
86 // This is used to form the USB Controller Handle
88 typedef struct usb_io_controller_device
{
91 EFI_USB_IO_PROTOCOL UsbIo
;
92 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
93 EFI_HANDLE HostController
;
94 UINT8 CurrentConfigValue
;
95 UINT8 InterfaceNumber
;
96 struct usb_io_device
*UsbDevice
;
99 BOOLEAN IsManagedByDriver
;
102 // Fields specified for USB Hub
105 UINT8 HubEndpointAddress
;
106 UINT8 StatusChangePort
;
107 UINT8 DownstreamPorts
;
110 struct usb_io_controller_device
*Parent
;
111 struct usb_io_device
*Children
[USB_MAXCHILDREN
];
112 } USB_IO_CONTROLLER_DEVICE
;
114 #define USB_IO_CONTROLLER_DEVICE_FROM_USB_IO_THIS(a) \
115 CR(a, USB_IO_CONTROLLER_DEVICE, UsbIo, USB_IO_CONTROLLER_SIGNATURE)
118 // This is used to keep the topology of USB bus
120 struct _usb_bus_controller_device
;
122 typedef struct usb_io_device
{
124 BOOLEAN IsConfigured
;
125 BOOLEAN IsSlowDevice
;
127 EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Translator
;
128 EFI_USB_DEVICE_DESCRIPTOR DeviceDescriptor
;
129 LIST_ENTRY ConfigDescListHead
;
130 CONFIG_DESC_LIST_ENTRY
*ActiveConfig
;
131 UINT16 LangID
[USB_MAXLANID
];
133 struct _usb_bus_controller_device
*BusController
;
136 // Track the controller handle
138 UINT8 NumOfControllers
;
139 USB_IO_CONTROLLER_DEVICE
*UsbController
[USB_MAXCONTROLLERS
];
144 // Usb Bus Controller device strcuture
146 #define EFI_USB_BUS_PROTOCOL_GUID \
147 { 0x2B2F68CC, 0x0CD2, 0x44cf, { 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } }
149 typedef struct _EFI_USB_BUS_PROTOCOL
{
151 } EFI_USB_BUS_PROTOCOL
;
153 #define USB_BUS_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('u', 'b', 'u', 's')
155 typedef struct _usb_bus_controller_device
{
158 EFI_USB_BUS_PROTOCOL BusIdentify
;
159 EFI_USB2_HC_PROTOCOL
*Usb2HCInterface
;
160 EFI_USB_HC_PROTOCOL
*UsbHCInterface
;
161 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
162 UINT8 AddressPool
[16];
164 BOOLEAN Hc2ProtocolSupported
;
165 } USB_BUS_CONTROLLER_DEVICE
;
167 #define USB_BUS_CONTROLLER_DEVICE_FROM_THIS(a) \
168 CR(a, USB_BUS_CONTROLLER_DEVICE, BusIdentify, USB_BUS_DEVICE_SIGNATURE)
174 extern EFI_DRIVER_BINDING_PROTOCOL gUsbBusDriverBinding
;
175 extern EFI_COMPONENT_NAME_PROTOCOL gUsbBusComponentName
;
178 // EFI_DRIVER_BINDING_PROTOCOL Protocol Interface
182 UsbBusControllerDriverSupported (
183 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
184 IN EFI_HANDLE Controller
,
185 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
190 UsbBusControllerDriverStart (
191 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
192 IN EFI_HANDLE Controller
,
193 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
198 UsbBusControllerDriverStop (
199 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
200 IN EFI_HANDLE Controller
,
201 IN UINTN NumberOfChildren
,
202 IN EFI_HANDLE
*ChildHandleBuffer
206 // EFI Component Name Functions
210 UsbBusComponentNameGetDriverName (
211 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
213 OUT CHAR16
**DriverName
218 UsbBusComponentNameGetControllerName (
219 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
220 IN EFI_HANDLE ControllerHandle
,
221 IN EFI_HANDLE ChildHandle
, OPTIONAL
223 OUT CHAR16
**ControllerName
227 // Usb Device Configuration functions
231 IN USB_IO_CONTROLLER_DEVICE
*Dev
236 Tell if a usb controller is a hub controller.
239 Dev - UsbIoController device structure.
248 IN USB_IO_DEVICE
*UsbIoDevice
253 Get the string table stored in a usb device.
256 Dev - UsbIoController device structure.
267 UsbGetAllConfigurations (
268 IN USB_IO_DEVICE
*UsbIoDevice
273 This function is to parse all the configuration descriptor.
276 UsbIoDevice - USB_IO_DEVICE device structure.
287 UsbSetConfiguration (
288 IN USB_IO_DEVICE
*Dev
,
289 IN UINTN ConfigurationValue
294 Set the device to a configuration value.
297 UsbIoDev - USB_IO_DEVICE to be set configuration
298 ConfigrationValue - The configuration value to be set to that device
308 UsbSetDefaultConfiguration (
309 IN USB_IO_DEVICE
*Dev
314 Set the device to a default configuration value.
317 UsbIoDev - USB_IO_DEVICE to be set configuration
327 // Device Deconfiguration functions
330 UsbDestroyAllConfiguration (
331 IN USB_IO_DEVICE
*UsbIoDevice
336 Delete all configuration data when device is not used.
339 UsbIoDevice - USB_IO_DEVICE to be set configuration
349 IN USB_IO_CONTROLLER_DEVICE
*HubIoDevice
357 HubController - Indicating the hub controller device that
369 GetDeviceEndPointMaxPacketLength (
370 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
371 IN UINT8 EndpointAddr
,
372 OUT UINTN
*MaxPacketLength
377 Get the Max Packet Length of the speified Endpoint.
380 UsbIo - Given Usb Controller device.
381 EndpointAddr - Given Endpoint address.
382 MaxPacketLength - The max packet length of that endpoint
392 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
393 IN UINT8 EndpointAddr
,
394 OUT UINT8
*DataToggle
399 Get the datatoggle of a specified endpoint.
402 UsbIo - Given Usb Controller device.
403 EndpointAddr - Given Endpoint address.
404 DataToggle - The current data toggle of that endpoint
414 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
415 IN UINT8 EndpointAddr
,
421 Set the datatoggle of a specified endpoint
424 UsbIo - Given Usb Controller device.
425 EndpointAddr - Given Endpoint address.
426 DataToggle - The current data toggle of that endpoint to be set
434 INTERFACE_DESC_LIST_ENTRY
*
435 FindInterfaceListEntry (
436 IN EFI_USB_IO_PROTOCOL
*This
441 Find Interface ListEntry.
444 This - EFI_USB_IO_PROTOCOL
447 INTERFACE_DESC_LIST_ENTRY pointer
452 ENDPOINT_DESC_LIST_ENTRY
*
453 FindEndPointListEntry (
454 IN EFI_USB_IO_PROTOCOL
*This
,
455 IN UINT8 EndPointAddress
460 Find EndPoint ListEntry.
463 This - EFI_USB_IO_PROTOCOL
464 EndpointAddr - Endpoint address.
467 ENDPOINT_DESC_LIST_ENTRY pointer
473 IsDeviceDisconnected (
474 IN USB_IO_CONTROLLER_DEVICE
*UsbIoController
,
475 IN OUT BOOLEAN
*Disconnected
480 Reset if the device is disconencted or not
483 UsbIoController - Indicating the Usb Controller Device.
484 Disconnected - Indicate whether the device is disconencted or not
494 UsbDeviceDeConfiguration (
495 IN USB_IO_DEVICE
*UsbIoDevice
500 Remove Device, Device Handles, Uninstall Protocols.
503 UsbIoDevice - The device to be deconfigured.
514 UsbVirtualHcGetCapability (
515 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
517 OUT UINT8
*PortNumber
,
518 OUT UINT8
*Is64BitCapable
524 Virtual interface to Retrieves the capablility of root hub ports
525 for both Hc2 and Hc protocol.
529 UsbBusDev - A pointer to bus controller of the device.
530 MaxSpeed - A pointer to the number of the host controller.
531 PortNumber - A pointer to the number of the root hub ports.
532 Is64BitCapable - A pointer to the flag for whether controller supports
533 64-bit memory addressing.
538 The host controller capability were retrieved successfully.
539 EFI_INVALID_PARAMETER
540 MaxSpeed or PortNumber or Is64BitCapable is NULL.
542 An error was encountered while attempting to retrieve the capabilities.
550 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
557 Virtual interface to provides software reset for the USB host controller
558 for both Hc2 and Hc protocol.
562 UsbBusDev - A pointer to bus controller of the device.
563 Attributes - A bit mask of the reset operation to perform.
564 See below for a list of the supported bit mask values.
566 #define EFI_USB_HC_RESET_GLOBAL 0x0001 // Hc2 and Hc
567 #define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002 // Hc2 and Hc
568 #define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004 // Hc2
569 #define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008 // Hc2
571 EFI_USB_HC_RESET_GLOBAL
572 If this bit is set, a global reset signal will be sent to the USB bus.
573 This resets all of the USB bus logic, including the USB host
574 controller hardware and all the devices attached on the USB bus.
575 EFI_USB_HC_RESET_HOST_CONTROLLER
576 If this bit is set, the USB host controller hardware will be reset.
577 No reset signal will be sent to the USB bus.
578 EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG
579 If this bit is set, a global reset signal will be sent to the USB bus.
580 This resets all of the USB bus logic, including the USB host
581 controller hardware and all the devices attached on the USB bus.
582 If this is an EHCI controller and the debug port has configured, then
583 this is will still reset the host controller.
584 EFI_USB_HC_RESET_HOST_WITH_DEBUG
585 If this bit is set, the USB host controller hardware will be reset.
586 If this is an EHCI controller and the debug port has been configured,
587 then this will still reset the host controller.
592 The reset operation succeeded.
593 EFI_INVALID_PARAMETER
594 Attributes is not valid.
596 The type of reset specified by Attributes is not currently supported by
597 the host controller hardware.
599 Reset operation is rejected due to the debug port being configured and
600 active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or
601 EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Atrributes can be used to
602 perform reset operation for this host controller.
604 An error was encountered while attempting to perform
612 UsbVirtualHcGetState (
613 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
614 OUT EFI_USB_HC_STATE
*State
620 Virtual interface to retrieves current state of the USB host controller
621 for both Hc2 and Hc protocol.
625 UsbBusDev - A pointer to bus controller of the device.
626 State - A pointer to the EFI_USB_HC_STATE data structure that
627 indicates current state of the USB host controller.
628 Type EFI_USB_HC_STATE is defined below.
632 EfiUsbHcStateOperational,
633 EfiUsbHcStateSuspend,
640 The state information of the host controller was returned in State.
641 EFI_INVALID_PARAMETER
644 An error was encountered while attempting to retrieve the
645 host controller's current state.
652 UsbVirtualHcSetState (
653 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
654 IN EFI_USB_HC_STATE State
660 Virtual interface to sets the USB host controller to a specific state
661 for both Hc2 and Hc protocol.
665 UsbBusDev - A pointer to bus controller of the device.
666 State - Indicates the state of the host controller that will be set.
671 The USB host controller was successfully placed in the state
673 EFI_INVALID_PARAMETER
676 Failed to set the state specified by State due to device error.
683 UsbVirtualHcGetRootHubPortStatus (
684 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
686 OUT EFI_USB_PORT_STATUS
*PortStatus
692 Virtual interface to retrieves the current status of a USB root hub port
693 both for Hc2 and Hc protocol.
697 UsbBusDev - A pointer to bus controller of the device.
698 PortNumber - Specifies the root hub port from which the status
699 is to be retrieved. This value is zero-based. For example,
700 if a root hub has two ports, then the first port is numbered 0,
701 and the second port is numbered 1.
702 PortStatus - A pointer to the current port status bits and
703 port status change bits.
707 EFI_SUCCESS The status of the USB root hub port specified by PortNumber
708 was returned in PortStatus.
709 EFI_INVALID_PARAMETER PortNumber is invalid.
710 EFI_DEVICE_ERROR Can't read register
717 UsbVirtualHcSetRootHubPortFeature (
718 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
720 IN EFI_USB_PORT_FEATURE PortFeature
725 Virual interface to sets a feature for the specified root hub port
726 for both Hc2 and Hc protocol.
730 UsbBusDev - A pointer to bus controller of the device.
731 PortNumber - Specifies the root hub port whose feature
732 is requested to be set.
733 PortFeature - Indicates the feature selector associated
734 with the feature set request.
739 The feature specified by PortFeature was set for the
740 USB root hub port specified by PortNumber.
741 EFI_INVALID_PARAMETER
742 PortNumber is invalid or PortFeature is invalid.
751 UsbVirtualHcClearRootHubPortFeature (
752 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
754 IN EFI_USB_PORT_FEATURE PortFeature
760 Virtual interface to clears a feature for the specified root hub port
761 for both Hc2 and Hc protocol.
765 UsbBusDev - A pointer to bus controller of the device.
766 PortNumber - Specifies the root hub port whose feature
767 is requested to be cleared.
768 PortFeature - Indicates the feature selector associated with the
769 feature clear request.
774 The feature specified by PortFeature was cleared for the
775 USB root hub port specified by PortNumber.
776 EFI_INVALID_PARAMETER
777 PortNumber is invalid or PortFeature is invalid.
786 UsbVirtualHcControlTransfer (
787 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
788 IN UINT8 DeviceAddress
,
789 IN UINT8 DeviceSpeed
,
790 IN UINTN MaximumPacketLength
,
791 IN EFI_USB_DEVICE_REQUEST
*Request
,
792 IN EFI_USB_DATA_DIRECTION TransferDirection
,
794 IN OUT UINTN
*DataLength
,
796 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Translator
,
797 OUT UINT32
*TransferResult
803 Virtual interface to submits control transfer to a target USB device
804 for both Hc2 and Hc protocol.
808 UsbBusDev - A pointer to bus controller of the device.
809 DeviceAddress - Represents the address of the target device on the USB,
810 which is assigned during USB enumeration.
811 DeviceSpeed - Indicates target device speed.
812 MaximumPacketLength - Indicates the maximum packet size that the
813 default control transfer endpoint is capable of
814 sending or receiving.
815 Request - A pointer to the USB device request that will be sent
817 TransferDirection - Specifies the data direction for the transfer.
818 There are three values available, DataIn, DataOut
820 Data - A pointer to the buffer of data that will be transmitted
821 to USB device or received from USB device.
822 DataLength - Indicates the size, in bytes, of the data buffer
824 TimeOut - Indicates the maximum time, in microseconds,
825 which the transfer is allowed to complete.
826 Translator - A pointr to the transaction translator data.
827 TransferResult - A pointer to the detailed result information generated
828 by this control transfer.
833 The control transfer was completed successfully.
835 The control transfer could not be completed due to a lack of resources.
836 EFI_INVALID_PARAMETER
837 Some parameters are invalid.
839 The control transfer failed due to timeout.
841 The control transfer failed due to host controller or device error.
842 Caller should check TranferResult for detailed error information.
849 UsbVirtualHcBulkTransfer (
850 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
851 IN UINT8 DeviceAddress
,
852 IN UINT8 EndPointAddress
,
853 IN UINT8 DeviceSpeed
,
854 IN UINTN MaximumPacketLength
,
855 IN UINT8 DataBuffersNumber
,
856 IN OUT VOID
*Data
[EFI_USB_MAX_BULK_BUFFER_NUM
],
857 IN OUT UINTN
*DataLength
,
858 IN OUT UINT8
*DataToggle
,
860 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Translator
,
861 OUT UINT32
*TransferResult
867 Virtual interface to submits bulk transfer to a bulk endpoint of a USB device
868 both for Hc2 and Hc protocol.
872 UsbBusDev - A pointer to bus controller of the device.
873 DeviceAddress - Represents the address of the target device on the USB,
874 which is assigned during USB enumeration.
875 EndPointAddress - The combination of an endpoint number and an
876 endpoint direction of the target USB device.
877 Each endpoint address supports data transfer in
878 one direction except the control endpoint
879 (whose default endpoint address is 0).
880 It is the caller's responsibility to make sure that
881 the EndPointAddress represents a bulk endpoint.
882 DeviceSpeed - Indicates device speed. The supported values are EFI_USB_SPEED_FULL
883 and EFI_USB_SPEED_HIGH.
884 MaximumPacketLength - Indicates the maximum packet size the target endpoint
885 is capable of sending or receiving.
886 DataBuffersNumber - Number of data buffers prepared for the transfer.
887 Data - Array of pointers to the buffers of data that will be transmitted
888 to USB device or received from USB device.
889 DataLength - When input, indicates the size, in bytes, of the data buffer
890 specified by Data. When output, indicates the actually
891 transferred data size.
892 DataToggle - A pointer to the data toggle value. On input, it indicates
893 the initial data toggle value the bulk transfer should adopt;
894 on output, it is updated to indicate the data toggle value
895 of the subsequent bulk transfer.
896 Translator - A pointr to the transaction translator data.
897 TimeOut - Indicates the maximum time, in microseconds, which the
898 transfer is allowed to complete.
899 TransferResult - A pointer to the detailed result information of the
905 The bulk transfer was completed successfully.
907 The bulk transfer could not be submitted due to lack of resource.
908 EFI_INVALID_PARAMETER
909 Some parameters are invalid.
911 The bulk transfer failed due to timeout.
913 The bulk transfer failed due to host controller or device error.
914 Caller should check TranferResult for detailed error information.
921 UsbVirtualHcAsyncInterruptTransfer (
922 IN USB_BUS_CONTROLLER_DEVICE
* UsbBusDev
,
923 IN UINT8 DeviceAddress
,
924 IN UINT8 EndPointAddress
,
925 IN UINT8 DeviceSpeed
,
926 IN UINTN MaximumPacketLength
,
927 IN BOOLEAN IsNewTransfer
,
928 IN OUT UINT8
*DataToggle
,
929 IN UINTN PollingInterval
,
931 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
* Translator
,
932 IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction
,
933 IN VOID
*Context OPTIONAL
939 Virtual interface to submits an asynchronous interrupt transfer to an
940 interrupt endpoint of a USB device for both Hc2 and Hc protocol.
944 UsbBusDev - A pointer to bus controller of the device.
945 DeviceAddress - Represents the address of the target device on the USB,
946 which is assigned during USB enumeration.
947 EndPointAddress - The combination of an endpoint number and an endpoint
948 direction of the target USB device. Each endpoint address
949 supports data transfer in one direction except the
950 control endpoint (whose default endpoint address is 0).
951 It is the caller's responsibility to make sure that
952 the EndPointAddress represents an interrupt endpoint.
953 DeviceSpeed - Indicates device speed.
954 MaximumPacketLength - Indicates the maximum packet size the target endpoint
955 is capable of sending or receiving.
956 IsNewTransfer - If TRUE, an asynchronous interrupt pipe is built between
957 the host and the target interrupt endpoint.
958 If FALSE, the specified asynchronous interrupt pipe
960 DataToggle - A pointer to the data toggle value. On input, it is valid
961 when IsNewTransfer is TRUE, and it indicates the initial
962 data toggle value the asynchronous interrupt transfer
964 On output, it is valid when IsNewTransfer is FALSE,
965 and it is updated to indicate the data toggle value of
966 the subsequent asynchronous interrupt transfer.
967 PollingInterval - Indicates the interval, in milliseconds, that the
968 asynchronous interrupt transfer is polled.
969 This parameter is required when IsNewTransfer is TRUE.
970 DataLength - Indicates the length of data to be received at the
971 rate specified by PollingInterval from the target
972 asynchronous interrupt endpoint. This parameter
973 is only required when IsNewTransfer is TRUE.
974 Translator - A pointr to the transaction translator data.
975 CallBackFunction - The Callback function.This function is called at the
976 rate specified by PollingInterval.This parameter is
977 only required when IsNewTransfer is TRUE.
978 Context - The context that is passed to the CallBackFunction.
979 - This is an optional parameter and may be NULL.
984 The asynchronous interrupt transfer request has been successfully
985 submitted or canceled.
986 EFI_INVALID_PARAMETER
987 Some parameters are invalid.
989 The request could not be completed due to a lack of resources.
998 UsbVirtualHcSyncInterruptTransfer (
999 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
1000 IN UINT8 DeviceAddress
,
1001 IN UINT8 EndPointAddress
,
1002 IN UINT8 DeviceSpeed
,
1003 IN UINTN MaximumPacketLength
,
1005 IN OUT UINTN
*DataLength
,
1006 IN OUT UINT8
*DataToggle
,
1008 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Translator
,
1009 OUT UINT32
*TransferResult
1013 Routine Description:
1015 Vitual interface to submits synchronous interrupt transfer to an interrupt endpoint
1016 of a USB device for both Hc2 and Hc protocol.
1020 UsbBusDev - A pointer to bus controller of the device.
1021 DeviceAddress - Represents the address of the target device on the USB,
1022 which is assigned during USB enumeration.
1023 EndPointAddress - The combination of an endpoint number and an endpoint
1024 direction of the target USB device. Each endpoint
1025 address supports data transfer in one direction
1026 except the control endpoint (whose default
1027 endpoint address is 0). It is the caller's responsibility
1028 to make sure that the EndPointAddress represents
1029 an interrupt endpoint.
1030 DeviceSpeed - Indicates device speed.
1031 MaximumPacketLength - Indicates the maximum packet size the target endpoint
1032 is capable of sending or receiving.
1033 Data - A pointer to the buffer of data that will be transmitted
1034 to USB device or received from USB device.
1035 DataLength - On input, the size, in bytes, of the data buffer specified
1036 by Data. On output, the number of bytes transferred.
1037 DataToggle - A pointer to the data toggle value. On input, it indicates
1038 the initial data toggle value the synchronous interrupt
1039 transfer should adopt;
1040 on output, it is updated to indicate the data toggle value
1041 of the subsequent synchronous interrupt transfer.
1042 TimeOut - Indicates the maximum time, in microseconds, which the
1043 transfer is allowed to complete.
1044 Translator - A pointr to the transaction translator data.
1045 TransferResult - A pointer to the detailed result information from
1046 the synchronous interrupt transfer.
1051 The synchronous interrupt transfer was completed successfully.
1052 EFI_OUT_OF_RESOURCES
1053 The synchronous interrupt transfer could not be submitted due
1054 to lack of resource.
1055 EFI_INVALID_PARAMETER
1056 Some parameters are invalid.
1058 The synchronous interrupt transfer failed due to timeout.
1060 The synchronous interrupt transfer failed due to host controller
1061 or device error. Caller should check TranferResult for detailed
1069 UsbVirtualHcIsochronousTransfer (
1070 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
1071 IN UINT8 DeviceAddress
,
1072 IN UINT8 EndPointAddress
,
1073 IN UINT8 DeviceSpeed
,
1074 IN UINTN MaximumPacketLength
,
1075 IN UINT8 DataBuffersNumber
,
1076 IN OUT VOID
*Data
[EFI_USB_MAX_ISO_BUFFER_NUM
],
1077 IN UINTN DataLength
,
1078 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Translator
,
1079 OUT UINT32
*TransferResult
1083 Routine Description:
1085 Virtual interface to submits isochronous transfer to a target USB device
1086 for both Hc2 and Hc protocol.
1090 UsbBusDev - A pointer to bus controller of the device.
1091 DeviceAddress - Represents the address of the target device on the USB,
1092 which is assigned during USB enumeration.
1093 EndPointAddress - End point address
1094 DeviceSpeed - Indicates device speed.
1095 MaximumPacketLength - Indicates the maximum packet size that the
1096 default control transfer endpoint is capable of
1097 sending or receiving.
1098 DataBuffersNumber - Number of data buffers prepared for the transfer.
1099 Data - Array of pointers to the buffers of data that will be
1100 transmitted to USB device or received from USB device.
1101 DataLength - Indicates the size, in bytes, of the data buffer
1103 Translator - A pointr to the transaction translator data.
1104 TransferResult - A pointer to the detailed result information generated
1105 by this control transfer.
1116 UsbVirtualHcAsyncIsochronousTransfer (
1117 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
1118 IN UINT8 DeviceAddress
,
1119 IN UINT8 EndPointAddress
,
1120 IN UINT8 DeviceSpeed
,
1121 IN UINTN MaximumPacketLength
,
1122 IN UINT8 DataBuffersNumber
,
1123 IN OUT VOID
*Data
[EFI_USB_MAX_ISO_BUFFER_NUM
],
1124 IN UINTN DataLength
,
1125 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Translator
,
1126 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack
,
1131 Routine Description:
1133 Vitual interface to submits Async isochronous transfer to a target USB device
1134 for both Hc2 and Hc protocol.
1138 UsbBusDev - A pointer to bus controller of the device.
1139 DeviceAddress - Represents the address of the target device on the USB,
1140 which is assigned during USB enumeration.
1141 EndPointAddress - End point address
1142 DeviceSpeed - Indicates device speed.
1143 MaximumPacketLength - Indicates the maximum packet size that the
1144 default control transfer endpoint is capable of
1145 sending or receiving.
1146 DataBuffersNumber - Number of data buffers prepared for the transfer.
1147 Data - Array of pointers to the buffers of data that will be transmitted
1148 to USB device or received from USB device.
1149 DataLength - Indicates the size, in bytes, of the data buffer
1151 Translator - A pointr to the transaction translator data.
1152 IsochronousCallBack - When the transfer complete, the call back function will be called
1153 Context - Pass to the call back function as parameter
1165 IN EFI_USB_IO_PROTOCOL
*This
1169 Routine Description:
1170 Resets and reconfigures the USB controller. This function will
1171 work for all USB devices except USB Hub Controllers.
1174 This - Indicates the calling context.
1178 EFI_INVALID_PARAMETER
1185 InitializeUsbIoInstance (
1186 IN USB_IO_CONTROLLER_DEVICE
*UsbIoController
1190 Routine Description:
1192 Initialize the instance of UsbIo controller
1196 UsbIoController - A pointer to controller structure of UsbIo