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
;
176 extern EFI_GUID gUSBBusDriverGuid
;
179 // EFI_DRIVER_BINDING_PROTOCOL Protocol Interface
183 UsbBusControllerDriverSupported (
184 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
185 IN EFI_HANDLE Controller
,
186 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
191 UsbBusControllerDriverStart (
192 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
193 IN EFI_HANDLE Controller
,
194 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
199 UsbBusControllerDriverStop (
200 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
201 IN EFI_HANDLE Controller
,
202 IN UINTN NumberOfChildren
,
203 IN EFI_HANDLE
*ChildHandleBuffer
207 // EFI Component Name Functions
211 UsbBusComponentNameGetDriverName (
212 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
214 OUT CHAR16
**DriverName
219 UsbBusComponentNameGetControllerName (
220 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
221 IN EFI_HANDLE ControllerHandle
,
222 IN EFI_HANDLE ChildHandle
, OPTIONAL
224 OUT CHAR16
**ControllerName
228 // Usb Device Configuration functions
232 IN USB_IO_CONTROLLER_DEVICE
*Dev
237 Tell if a usb controller is a hub controller.
240 Dev - UsbIoController device structure.
249 IN USB_IO_DEVICE
*UsbIoDevice
254 Get the string table stored in a usb device.
257 Dev - UsbIoController device structure.
268 UsbGetAllConfigurations (
269 IN USB_IO_DEVICE
*UsbIoDevice
274 This function is to parse all the configuration descriptor.
277 UsbIoDevice - USB_IO_DEVICE device structure.
288 UsbSetConfiguration (
289 IN USB_IO_DEVICE
*Dev
,
290 IN UINTN ConfigurationValue
295 Set the device to a configuration value.
298 UsbIoDev - USB_IO_DEVICE to be set configuration
299 ConfigrationValue - The configuration value to be set to that device
309 UsbSetDefaultConfiguration (
310 IN USB_IO_DEVICE
*Dev
315 Set the device to a default configuration value.
318 UsbIoDev - USB_IO_DEVICE to be set configuration
328 // Device Deconfiguration functions
331 UsbDestroyAllConfiguration (
332 IN USB_IO_DEVICE
*UsbIoDevice
337 Delete all configuration data when device is not used.
340 UsbIoDevice - USB_IO_DEVICE to be set configuration
350 IN USB_IO_CONTROLLER_DEVICE
*HubIoDevice
358 HubController - Indicating the hub controller device that
370 GetDeviceEndPointMaxPacketLength (
371 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
372 IN UINT8 EndpointAddr
,
373 OUT UINTN
*MaxPacketLength
378 Get the Max Packet Length of the speified Endpoint.
381 UsbIo - Given Usb Controller device.
382 EndpointAddr - Given Endpoint address.
383 MaxPacketLength - The max packet length of that endpoint
393 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
394 IN UINT8 EndpointAddr
,
395 OUT UINT8
*DataToggle
400 Get the datatoggle of a specified endpoint.
403 UsbIo - Given Usb Controller device.
404 EndpointAddr - Given Endpoint address.
405 DataToggle - The current data toggle of that endpoint
415 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
416 IN UINT8 EndpointAddr
,
422 Set the datatoggle of a specified endpoint
425 UsbIo - Given Usb Controller device.
426 EndpointAddr - Given Endpoint address.
427 DataToggle - The current data toggle of that endpoint to be set
435 INTERFACE_DESC_LIST_ENTRY
*
436 FindInterfaceListEntry (
437 IN EFI_USB_IO_PROTOCOL
*This
442 Find Interface ListEntry.
445 This - EFI_USB_IO_PROTOCOL
448 INTERFACE_DESC_LIST_ENTRY pointer
453 ENDPOINT_DESC_LIST_ENTRY
*
454 FindEndPointListEntry (
455 IN EFI_USB_IO_PROTOCOL
*This
,
456 IN UINT8 EndPointAddress
461 Find EndPoint ListEntry.
464 This - EFI_USB_IO_PROTOCOL
465 EndpointAddr - Endpoint address.
468 ENDPOINT_DESC_LIST_ENTRY pointer
474 IsDeviceDisconnected (
475 IN USB_IO_CONTROLLER_DEVICE
*UsbIoController
,
476 IN OUT BOOLEAN
*Disconnected
481 Reset if the device is disconencted or not
484 UsbIoController - Indicating the Usb Controller Device.
485 Disconnected - Indicate whether the device is disconencted or not
495 UsbDeviceDeConfiguration (
496 IN USB_IO_DEVICE
*UsbIoDevice
501 Remove Device, Device Handles, Uninstall Protocols.
504 UsbIoDevice - The device to be deconfigured.
515 UsbVirtualHcGetCapability (
516 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
518 OUT UINT8
*PortNumber
,
519 OUT UINT8
*Is64BitCapable
525 Virtual interface to Retrieves the capablility of root hub ports
526 for both Hc2 and Hc protocol.
530 UsbBusDev - A pointer to bus controller of the device.
531 MaxSpeed - A pointer to the number of the host controller.
532 PortNumber - A pointer to the number of the root hub ports.
533 Is64BitCapable - A pointer to the flag for whether controller supports
534 64-bit memory addressing.
539 The host controller capability were retrieved successfully.
540 EFI_INVALID_PARAMETER
541 MaxSpeed or PortNumber or Is64BitCapable is NULL.
543 An error was encountered while attempting to retrieve the capabilities.
551 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
558 Virtual interface to provides software reset for the USB host controller
559 for both Hc2 and Hc protocol.
563 UsbBusDev - A pointer to bus controller of the device.
564 Attributes - A bit mask of the reset operation to perform.
565 See below for a list of the supported bit mask values.
567 #define EFI_USB_HC_RESET_GLOBAL 0x0001 // Hc2 and Hc
568 #define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002 // Hc2 and Hc
569 #define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004 // Hc2
570 #define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008 // Hc2
572 EFI_USB_HC_RESET_GLOBAL
573 If this bit is set, a global reset signal will be sent to the USB bus.
574 This resets all of the USB bus logic, including the USB host
575 controller hardware and all the devices attached on the USB bus.
576 EFI_USB_HC_RESET_HOST_CONTROLLER
577 If this bit is set, the USB host controller hardware will be reset.
578 No reset signal will be sent to the USB bus.
579 EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG
580 If this bit is set, a global reset signal will be sent to the USB bus.
581 This resets all of the USB bus logic, including the USB host
582 controller hardware and all the devices attached on the USB bus.
583 If this is an EHCI controller and the debug port has configured, then
584 this is will still reset the host controller.
585 EFI_USB_HC_RESET_HOST_WITH_DEBUG
586 If this bit is set, the USB host controller hardware will be reset.
587 If this is an EHCI controller and the debug port has been configured,
588 then this will still reset the host controller.
593 The reset operation succeeded.
594 EFI_INVALID_PARAMETER
595 Attributes is not valid.
597 The type of reset specified by Attributes is not currently supported by
598 the host controller hardware.
600 Reset operation is rejected due to the debug port being configured and
601 active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or
602 EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Atrributes can be used to
603 perform reset operation for this host controller.
605 An error was encountered while attempting to perform
613 UsbVirtualHcGetState (
614 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
615 OUT EFI_USB_HC_STATE
*State
621 Virtual interface to retrieves current state of the USB host controller
622 for both Hc2 and Hc protocol.
626 UsbBusDev - A pointer to bus controller of the device.
627 State - A pointer to the EFI_USB_HC_STATE data structure that
628 indicates current state of the USB host controller.
629 Type EFI_USB_HC_STATE is defined below.
633 EfiUsbHcStateOperational,
634 EfiUsbHcStateSuspend,
641 The state information of the host controller was returned in State.
642 EFI_INVALID_PARAMETER
645 An error was encountered while attempting to retrieve the
646 host controller's current state.
653 UsbVirtualHcSetState (
654 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
655 IN EFI_USB_HC_STATE State
661 Virtual interface to sets the USB host controller to a specific state
662 for both Hc2 and Hc protocol.
666 UsbBusDev - A pointer to bus controller of the device.
667 State - Indicates the state of the host controller that will be set.
672 The USB host controller was successfully placed in the state
674 EFI_INVALID_PARAMETER
677 Failed to set the state specified by State due to device error.
684 UsbVirtualHcGetRootHubPortStatus (
685 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
687 OUT EFI_USB_PORT_STATUS
*PortStatus
693 Virtual interface to retrieves the current status of a USB root hub port
694 both for Hc2 and Hc protocol.
698 UsbBusDev - A pointer to bus controller of the device.
699 PortNumber - Specifies the root hub port from which the status
700 is to be retrieved. This value is zero-based. For example,
701 if a root hub has two ports, then the first port is numbered 0,
702 and the second port is numbered 1.
703 PortStatus - A pointer to the current port status bits and
704 port status change bits.
708 EFI_SUCCESS The status of the USB root hub port specified by PortNumber
709 was returned in PortStatus.
710 EFI_INVALID_PARAMETER PortNumber is invalid.
711 EFI_DEVICE_ERROR Can't read register
718 UsbVirtualHcSetRootHubPortFeature (
719 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
721 IN EFI_USB_PORT_FEATURE PortFeature
726 Virual interface to sets a feature for the specified root hub port
727 for both Hc2 and Hc protocol.
731 UsbBusDev - A pointer to bus controller of the device.
732 PortNumber - Specifies the root hub port whose feature
733 is requested to be set.
734 PortFeature - Indicates the feature selector associated
735 with the feature set request.
740 The feature specified by PortFeature was set for the
741 USB root hub port specified by PortNumber.
742 EFI_INVALID_PARAMETER
743 PortNumber is invalid or PortFeature is invalid.
752 UsbVirtualHcClearRootHubPortFeature (
753 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
755 IN EFI_USB_PORT_FEATURE PortFeature
761 Virtual interface to clears a feature for the specified root hub port
762 for both Hc2 and Hc protocol.
766 UsbBusDev - A pointer to bus controller of the device.
767 PortNumber - Specifies the root hub port whose feature
768 is requested to be cleared.
769 PortFeature - Indicates the feature selector associated with the
770 feature clear request.
775 The feature specified by PortFeature was cleared for the
776 USB root hub port specified by PortNumber.
777 EFI_INVALID_PARAMETER
778 PortNumber is invalid or PortFeature is invalid.
787 UsbVirtualHcControlTransfer (
788 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
789 IN UINT8 DeviceAddress
,
790 IN UINT8 DeviceSpeed
,
791 IN UINTN MaximumPacketLength
,
792 IN EFI_USB_DEVICE_REQUEST
*Request
,
793 IN EFI_USB_DATA_DIRECTION TransferDirection
,
795 IN OUT UINTN
*DataLength
,
797 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Translator
,
798 OUT UINT32
*TransferResult
804 Virtual interface to submits control transfer to a target USB device
805 for both Hc2 and Hc protocol.
809 UsbBusDev - A pointer to bus controller of the device.
810 DeviceAddress - Represents the address of the target device on the USB,
811 which is assigned during USB enumeration.
812 DeviceSpeed - Indicates target device speed.
813 MaximumPacketLength - Indicates the maximum packet size that the
814 default control transfer endpoint is capable of
815 sending or receiving.
816 Request - A pointer to the USB device request that will be sent
818 TransferDirection - Specifies the data direction for the transfer.
819 There are three values available, DataIn, DataOut
821 Data - A pointer to the buffer of data that will be transmitted
822 to USB device or received from USB device.
823 DataLength - Indicates the size, in bytes, of the data buffer
825 TimeOut - Indicates the maximum time, in microseconds,
826 which the transfer is allowed to complete.
827 Translator - A pointr to the transaction translator data.
828 TransferResult - A pointer to the detailed result information generated
829 by this control transfer.
834 The control transfer was completed successfully.
836 The control transfer could not be completed due to a lack of resources.
837 EFI_INVALID_PARAMETER
838 Some parameters are invalid.
840 The control transfer failed due to timeout.
842 The control transfer failed due to host controller or device error.
843 Caller should check TranferResult for detailed error information.
850 UsbVirtualHcBulkTransfer (
851 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
852 IN UINT8 DeviceAddress
,
853 IN UINT8 EndPointAddress
,
854 IN UINT8 DeviceSpeed
,
855 IN UINTN MaximumPacketLength
,
856 IN UINT8 DataBuffersNumber
,
857 IN OUT VOID
*Data
[EFI_USB_MAX_BULK_BUFFER_NUM
],
858 IN OUT UINTN
*DataLength
,
859 IN OUT UINT8
*DataToggle
,
861 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Translator
,
862 OUT UINT32
*TransferResult
868 Virtual interface to submits bulk transfer to a bulk endpoint of a USB device
869 both for Hc2 and Hc protocol.
873 UsbBusDev - A pointer to bus controller of the device.
874 DeviceAddress - Represents the address of the target device on the USB,
875 which is assigned during USB enumeration.
876 EndPointAddress - The combination of an endpoint number and an
877 endpoint direction of the target USB device.
878 Each endpoint address supports data transfer in
879 one direction except the control endpoint
880 (whose default endpoint address is 0).
881 It is the caller's responsibility to make sure that
882 the EndPointAddress represents a bulk endpoint.
883 DeviceSpeed - Indicates device speed. The supported values are EFI_USB_SPEED_FULL
884 and EFI_USB_SPEED_HIGH.
885 MaximumPacketLength - Indicates the maximum packet size the target endpoint
886 is capable of sending or receiving.
887 DataBuffersNumber - Number of data buffers prepared for the transfer.
888 Data - Array of pointers to the buffers of data that will be transmitted
889 to USB device or received from USB device.
890 DataLength - When input, indicates the size, in bytes, of the data buffer
891 specified by Data. When output, indicates the actually
892 transferred data size.
893 DataToggle - A pointer to the data toggle value. On input, it indicates
894 the initial data toggle value the bulk transfer should adopt;
895 on output, it is updated to indicate the data toggle value
896 of the subsequent bulk transfer.
897 Translator - A pointr to the transaction translator data.
898 TimeOut - Indicates the maximum time, in microseconds, which the
899 transfer is allowed to complete.
900 TransferResult - A pointer to the detailed result information of the
906 The bulk transfer was completed successfully.
908 The bulk transfer could not be submitted due to lack of resource.
909 EFI_INVALID_PARAMETER
910 Some parameters are invalid.
912 The bulk transfer failed due to timeout.
914 The bulk transfer failed due to host controller or device error.
915 Caller should check TranferResult for detailed error information.
922 UsbVirtualHcAsyncInterruptTransfer (
923 IN USB_BUS_CONTROLLER_DEVICE
* UsbBusDev
,
924 IN UINT8 DeviceAddress
,
925 IN UINT8 EndPointAddress
,
926 IN UINT8 DeviceSpeed
,
927 IN UINTN MaximumPacketLength
,
928 IN BOOLEAN IsNewTransfer
,
929 IN OUT UINT8
*DataToggle
,
930 IN UINTN PollingInterval
,
932 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
* Translator
,
933 IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction
,
934 IN VOID
*Context OPTIONAL
940 Virtual interface to submits an asynchronous interrupt transfer to an
941 interrupt endpoint of a USB device for both Hc2 and Hc protocol.
945 UsbBusDev - A pointer to bus controller of the device.
946 DeviceAddress - Represents the address of the target device on the USB,
947 which is assigned during USB enumeration.
948 EndPointAddress - The combination of an endpoint number and an endpoint
949 direction of the target USB device. Each endpoint address
950 supports data transfer in one direction except the
951 control endpoint (whose default endpoint address is 0).
952 It is the caller's responsibility to make sure that
953 the EndPointAddress represents an interrupt endpoint.
954 DeviceSpeed - Indicates device speed.
955 MaximumPacketLength - Indicates the maximum packet size the target endpoint
956 is capable of sending or receiving.
957 IsNewTransfer - If TRUE, an asynchronous interrupt pipe is built between
958 the host and the target interrupt endpoint.
959 If FALSE, the specified asynchronous interrupt pipe
961 DataToggle - A pointer to the data toggle value. On input, it is valid
962 when IsNewTransfer is TRUE, and it indicates the initial
963 data toggle value the asynchronous interrupt transfer
965 On output, it is valid when IsNewTransfer is FALSE,
966 and it is updated to indicate the data toggle value of
967 the subsequent asynchronous interrupt transfer.
968 PollingInterval - Indicates the interval, in milliseconds, that the
969 asynchronous interrupt transfer is polled.
970 This parameter is required when IsNewTransfer is TRUE.
971 DataLength - Indicates the length of data to be received at the
972 rate specified by PollingInterval from the target
973 asynchronous interrupt endpoint. This parameter
974 is only required when IsNewTransfer is TRUE.
975 Translator - A pointr to the transaction translator data.
976 CallBackFunction - The Callback function.This function is called at the
977 rate specified by PollingInterval.This parameter is
978 only required when IsNewTransfer is TRUE.
979 Context - The context that is passed to the CallBackFunction.
980 - This is an optional parameter and may be NULL.
985 The asynchronous interrupt transfer request has been successfully
986 submitted or canceled.
987 EFI_INVALID_PARAMETER
988 Some parameters are invalid.
990 The request could not be completed due to a lack of resources.
999 UsbVirtualHcSyncInterruptTransfer (
1000 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
1001 IN UINT8 DeviceAddress
,
1002 IN UINT8 EndPointAddress
,
1003 IN UINT8 DeviceSpeed
,
1004 IN UINTN MaximumPacketLength
,
1006 IN OUT UINTN
*DataLength
,
1007 IN OUT UINT8
*DataToggle
,
1009 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Translator
,
1010 OUT UINT32
*TransferResult
1014 Routine Description:
1016 Vitual interface to submits synchronous interrupt transfer to an interrupt endpoint
1017 of a USB device for both Hc2 and Hc protocol.
1021 UsbBusDev - A pointer to bus controller of the device.
1022 DeviceAddress - Represents the address of the target device on the USB,
1023 which is assigned during USB enumeration.
1024 EndPointAddress - The combination of an endpoint number and an endpoint
1025 direction of the target USB device. Each endpoint
1026 address supports data transfer in one direction
1027 except the control endpoint (whose default
1028 endpoint address is 0). It is the caller's responsibility
1029 to make sure that the EndPointAddress represents
1030 an interrupt endpoint.
1031 DeviceSpeed - Indicates device speed.
1032 MaximumPacketLength - Indicates the maximum packet size the target endpoint
1033 is capable of sending or receiving.
1034 Data - A pointer to the buffer of data that will be transmitted
1035 to USB device or received from USB device.
1036 DataLength - On input, the size, in bytes, of the data buffer specified
1037 by Data. On output, the number of bytes transferred.
1038 DataToggle - A pointer to the data toggle value. On input, it indicates
1039 the initial data toggle value the synchronous interrupt
1040 transfer should adopt;
1041 on output, it is updated to indicate the data toggle value
1042 of the subsequent synchronous interrupt transfer.
1043 TimeOut - Indicates the maximum time, in microseconds, which the
1044 transfer is allowed to complete.
1045 Translator - A pointr to the transaction translator data.
1046 TransferResult - A pointer to the detailed result information from
1047 the synchronous interrupt transfer.
1052 The synchronous interrupt transfer was completed successfully.
1053 EFI_OUT_OF_RESOURCES
1054 The synchronous interrupt transfer could not be submitted due
1055 to lack of resource.
1056 EFI_INVALID_PARAMETER
1057 Some parameters are invalid.
1059 The synchronous interrupt transfer failed due to timeout.
1061 The synchronous interrupt transfer failed due to host controller
1062 or device error. Caller should check TranferResult for detailed
1070 UsbVirtualHcIsochronousTransfer (
1071 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
1072 IN UINT8 DeviceAddress
,
1073 IN UINT8 EndPointAddress
,
1074 IN UINT8 DeviceSpeed
,
1075 IN UINTN MaximumPacketLength
,
1076 IN UINT8 DataBuffersNumber
,
1077 IN OUT VOID
*Data
[EFI_USB_MAX_ISO_BUFFER_NUM
],
1078 IN UINTN DataLength
,
1079 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Translator
,
1080 OUT UINT32
*TransferResult
1084 Routine Description:
1086 Virtual interface to submits isochronous transfer to a target USB device
1087 for both Hc2 and Hc protocol.
1091 UsbBusDev - A pointer to bus controller of the device.
1092 DeviceAddress - Represents the address of the target device on the USB,
1093 which is assigned during USB enumeration.
1094 EndPointAddress - End point address
1095 DeviceSpeed - Indicates device speed.
1096 MaximumPacketLength - Indicates the maximum packet size that the
1097 default control transfer endpoint is capable of
1098 sending or receiving.
1099 DataBuffersNumber - Number of data buffers prepared for the transfer.
1100 Data - Array of pointers to the buffers of data that will be
1101 transmitted to USB device or received from USB device.
1102 DataLength - Indicates the size, in bytes, of the data buffer
1104 Translator - A pointr to the transaction translator data.
1105 TransferResult - A pointer to the detailed result information generated
1106 by this control transfer.
1117 UsbVirtualHcAsyncIsochronousTransfer (
1118 IN USB_BUS_CONTROLLER_DEVICE
*UsbBusDev
,
1119 IN UINT8 DeviceAddress
,
1120 IN UINT8 EndPointAddress
,
1121 IN UINT8 DeviceSpeed
,
1122 IN UINTN MaximumPacketLength
,
1123 IN UINT8 DataBuffersNumber
,
1124 IN OUT VOID
*Data
[EFI_USB_MAX_ISO_BUFFER_NUM
],
1125 IN UINTN DataLength
,
1126 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Translator
,
1127 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack
,
1132 Routine Description:
1134 Vitual interface to submits Async isochronous transfer to a target USB device
1135 for both Hc2 and Hc protocol.
1139 UsbBusDev - A pointer to bus controller of the device.
1140 DeviceAddress - Represents the address of the target device on the USB,
1141 which is assigned during USB enumeration.
1142 EndPointAddress - End point address
1143 DeviceSpeed - Indicates device speed.
1144 MaximumPacketLength - Indicates the maximum packet size that the
1145 default control transfer endpoint is capable of
1146 sending or receiving.
1147 DataBuffersNumber - Number of data buffers prepared for the transfer.
1148 Data - Array of pointers to the buffers of data that will be transmitted
1149 to USB device or received from USB device.
1150 DataLength - Indicates the size, in bytes, of the data buffer
1152 Translator - A pointr to the transaction translator data.
1153 IsochronousCallBack - When the transfer complete, the call back function will be called
1154 Context - Pass to the call back function as parameter
1166 IN EFI_USB_IO_PROTOCOL
*This
1170 Routine Description:
1171 Resets and reconfigures the USB controller. This function will
1172 work for all USB devices except USB Hub Controllers.
1175 This - Indicates the calling context.
1179 EFI_INVALID_PARAMETER
1186 InitializeUsbIoInstance (
1187 IN USB_IO_CONTROLLER_DEVICE
*UsbIoController
1191 Routine Description:
1193 Initialize the instance of UsbIo controller
1197 UsbIoController - A pointer to controller structure of UsbIo