#define _EFI_USB_BUS_H\r
\r
\r
-#include <IndustryStandard/usb.h>\r
-#include "Hub.h"\r
-#include "Usbutil.h"\r
+#include <IndustryStandard/Usb.h>\r
+#include "hub.h"\r
+#include "usbutil.h"\r
+\r
\r
-//#ifdef EFI_DEBUG\r
extern UINTN gUSBDebugLevel;\r
extern UINTN gUSBErrorLevel;\r
-//#endif\r
\r
-#define MICROSECOND 10000\r
-#define ONESECOND (1000 * MICROSECOND)\r
+\r
+#define MICROSECOND 10000\r
+#define ONESECOND (1000 * MICROSECOND)\r
#define BUSPOLLING_PERIOD ONESECOND\r
//\r
// We define some maximun value here\r
struct _usb_bus_controller_device;\r
\r
typedef struct usb_io_device {\r
- UINT8 DeviceAddress;\r
- BOOLEAN IsConfigured;\r
- BOOLEAN IsSlowDevice;\r
- EFI_USB_DEVICE_DESCRIPTOR DeviceDescriptor;\r
- LIST_ENTRY ConfigDescListHead;\r
- CONFIG_DESC_LIST_ENTRY *ActiveConfig;\r
- UINT16 LangID[USB_MAXLANID];\r
+ UINT8 DeviceAddress;\r
+ BOOLEAN IsConfigured;\r
+ BOOLEAN IsSlowDevice;\r
+ UINT8 DeviceSpeed;\r
+ EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator;\r
+ EFI_USB_DEVICE_DESCRIPTOR DeviceDescriptor;\r
+ LIST_ENTRY ConfigDescListHead;\r
+ CONFIG_DESC_LIST_ENTRY *ActiveConfig;\r
+ UINT16 LangID[USB_MAXLANID];\r
\r
- struct _usb_bus_controller_device *BusController;\r
+ struct _usb_bus_controller_device *BusController;\r
\r
//\r
// Track the controller handle\r
//\r
- UINT8 NumOfControllers;\r
- USB_IO_CONTROLLER_DEVICE *UsbController[USB_MAXCONTROLLERS];\r
+ UINT8 NumOfControllers;\r
+ USB_IO_CONTROLLER_DEVICE *UsbController[USB_MAXCONTROLLERS];\r
\r
} USB_IO_DEVICE;\r
\r
UINTN Signature;\r
\r
EFI_USB_BUS_PROTOCOL BusIdentify;\r
+ EFI_USB2_HC_PROTOCOL *Usb2HCInterface;\r
EFI_USB_HC_PROTOCOL *UsbHCInterface;\r
EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
UINT8 AddressPool[16];\r
USB_IO_DEVICE *Root;\r
+ BOOLEAN Hc2ProtocolSupported;\r
} USB_BUS_CONTROLLER_DEVICE;\r
\r
#define USB_BUS_CONTROLLER_DEVICE_FROM_THIS(a) \\r
BOOLEAN\r
IsHub (\r
IN USB_IO_CONTROLLER_DEVICE *Dev\r
- );\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ Tell if a usb controller is a hub controller.\r
+ \r
+ Arguments:\r
+ Dev - UsbIoController device structure.\r
+ \r
+ Returns:\r
+ TRUE/FALSE\r
+--*/\r
+;\r
\r
EFI_STATUS\r
UsbGetStringtable (\r
IN USB_IO_DEVICE *UsbIoDevice\r
- );\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ Get the string table stored in a usb device.\r
+ \r
+ Arguments:\r
+ Dev - UsbIoController device structure.\r
+ \r
+ Returns:\r
+ EFI_SUCCESS\r
+ EFI_UNSUPPORTED\r
+ EFI_OUT_OF_RESOURCES\r
+ \r
+--*/\r
+;\r
\r
EFI_STATUS\r
UsbGetAllConfigurations (\r
IN USB_IO_DEVICE *UsbIoDevice\r
- );\r
+ )\r
+/*++\r
+\r
+ Routine Description:\r
+ This function is to parse all the configuration descriptor.\r
+ \r
+ Arguments:\r
+ UsbIoDevice - USB_IO_DEVICE device structure.\r
+ \r
+ Returns:\r
+ EFI_SUCCESS\r
+ EFI_DEVICE_ERROR\r
+ EFI_OUT_OF_RESOURCES \r
+\r
+--*/\r
+;\r
\r
EFI_STATUS\r
UsbSetConfiguration (\r
IN USB_IO_DEVICE *Dev,\r
IN UINTN ConfigurationValue\r
- );\r
+ )\r
+/*++\r
+\r
+ Routine Description:\r
+ Set the device to a configuration value.\r
+ \r
+ Arguments:\r
+ UsbIoDev - USB_IO_DEVICE to be set configuration\r
+ ConfigrationValue - The configuration value to be set to that device\r
+ \r
+ Returns:\r
+ EFI_SUCCESS\r
+ EFI_DEVICE_ERROR\r
+ \r
+--*/\r
+;\r
\r
EFI_STATUS\r
UsbSetDefaultConfiguration (\r
IN USB_IO_DEVICE *Dev\r
- );\r
+ )\r
+/*++\r
+\r
+ Routine Description:\r
+ Set the device to a default configuration value.\r
+ \r
+ Arguments:\r
+ UsbIoDev - USB_IO_DEVICE to be set configuration\r
+ \r
+ Returns\r
+ EFI_SUCCESS\r
+ EFI_DEVICE_ERROR\r
+ \r
+--*/\r
+;\r
\r
//\r
// Device Deconfiguration functions\r
VOID\r
UsbDestroyAllConfiguration (\r
IN USB_IO_DEVICE *UsbIoDevice\r
- );\r
+ )\r
+/*++\r
+\r
+ Routine Description:\r
+ Delete all configuration data when device is not used.\r
+ \r
+ Arguments:\r
+ UsbIoDevice - USB_IO_DEVICE to be set configuration\r
+ \r
+ Returns:\r
+ VOID\r
+ \r
+--*/\r
+;\r
\r
EFI_STATUS\r
DoHubConfig (\r
IN USB_IO_CONTROLLER_DEVICE *HubIoDevice\r
- );\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ Configure the hub\r
+ \r
+ Arguments:\r
+ HubController - Indicating the hub controller device that\r
+ will be configured\r
+ \r
+ Returns:\r
+ EFI_SUCCESS\r
+ EFI_DEVICE_ERROR\r
+ \r
+--*/\r
+\r
+;\r
\r
VOID\r
GetDeviceEndPointMaxPacketLength (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
IN UINT8 EndpointAddr,\r
- OUT UINT8 *MaxPacketLength\r
- );\r
+ OUT UINTN *MaxPacketLength\r
+ )\r
+/*++\r
+\r
+ Routine Description:\r
+ Get the Max Packet Length of the speified Endpoint.\r
+\r
+ Arguments:\r
+ UsbIo - Given Usb Controller device.\r
+ EndpointAddr - Given Endpoint address.\r
+ MaxPacketLength - The max packet length of that endpoint\r
+\r
+ Returns:\r
+ N/A\r
+\r
+--*/\r
+;\r
\r
VOID\r
GetDataToggleBit (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
IN UINT8 EndpointAddr,\r
OUT UINT8 *DataToggle\r
- );\r
+ )\r
+/*++\r
+\r
+ Routine Description:\r
+ Get the datatoggle of a specified endpoint.\r
+\r
+ Arguments:\r
+ UsbIo - Given Usb Controller device.\r
+ EndpointAddr - Given Endpoint address.\r
+ DataToggle - The current data toggle of that endpoint\r
+\r
+ Returns:\r
+ VOID\r
+ \r
+--*/\r
+;\r
\r
VOID\r
SetDataToggleBit (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
IN UINT8 EndpointAddr,\r
IN UINT8 DataToggle\r
- );\r
+ )\r
+/*++\r
\r
-INTERFACE_DESC_LIST_ENTRY *\r
+ Routine Description:\r
+ Set the datatoggle of a specified endpoint\r
+\r
+ Arguments:\r
+ UsbIo - Given Usb Controller device.\r
+ EndpointAddr - Given Endpoint address.\r
+ DataToggle - The current data toggle of that endpoint to be set\r
+\r
+ Returns:\r
+ VOID\r
+\r
+--*/\r
+;\r
+\r
+INTERFACE_DESC_LIST_ENTRY *\r
FindInterfaceListEntry (\r
IN EFI_USB_IO_PROTOCOL *This\r
- );\r
+ )\r
+/*++\r
+\r
+ Routine Description:\r
+ Find Interface ListEntry.\r
+\r
+ Arguments:\r
+ This - EFI_USB_IO_PROTOCOL \r
+ \r
+ Returns:\r
+ INTERFACE_DESC_LIST_ENTRY pointer\r
\r
-ENDPOINT_DESC_LIST_ENTRY *\r
+--*/\r
+;\r
+\r
+ENDPOINT_DESC_LIST_ENTRY *\r
FindEndPointListEntry (\r
IN EFI_USB_IO_PROTOCOL *This,\r
IN UINT8 EndPointAddress\r
- );\r
+ )\r
+/*++\r
\r
+ Routine Description:\r
+ Find EndPoint ListEntry.\r
+\r
+ Arguments:\r
+ This - EFI_USB_IO_PROTOCOL \r
+ EndpointAddr - Endpoint address.\r
+ \r
+ Returns:\r
+ ENDPOINT_DESC_LIST_ENTRY pointer\r
+\r
+--*/\r
+;\r
\r
EFI_STATUS\r
IsDeviceDisconnected (\r
IN USB_IO_CONTROLLER_DEVICE *UsbIoController,\r
IN OUT BOOLEAN *Disconnected\r
- );\r
+ )\r
+/*++\r
+\r
+ Routine Description:\r
+ Reset if the device is disconencted or not\r
+\r
+ Arguments:\r
+ UsbIoController - Indicating the Usb Controller Device.\r
+ Disconnected - Indicate whether the device is disconencted or not\r
+\r
+ Returns:\r
+ EFI_SUCCESS\r
+ EFI_DEVICE_ERROR\r
+\r
+--*/\r
+;\r
\r
EFI_STATUS\r
UsbDeviceDeConfiguration (\r
IN USB_IO_DEVICE *UsbIoDevice\r
- );\r
+ )\r
+/*++\r
+\r
+ Routine Description:\r
+ Remove Device, Device Handles, Uninstall Protocols.\r
+\r
+ Arguments:\r
+ UsbIoDevice - The device to be deconfigured.\r
+\r
+ Returns: \r
+ EFI_SUCCESS\r
+ EFI_DEVICE_ERROR\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcGetCapability (\r
+ IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,\r
+ OUT UINT8 *MaxSpeed,\r
+ OUT UINT8 *PortNumber,\r
+ OUT UINT8 *Is64BitCapable\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ \r
+ Virtual interface to Retrieves the capablility of root hub ports \r
+ for both Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ MaxSpeed - A pointer to the number of the host controller.\r
+ PortNumber - A pointer to the number of the root hub ports.\r
+ Is64BitCapable - A pointer to the flag for whether controller supports \r
+ 64-bit memory addressing.\r
+ \r
+ Returns:\r
+ \r
+ EFI_SUCCESS \r
+ The host controller capability were retrieved successfully.\r
+ EFI_INVALID_PARAMETER \r
+ MaxSpeed or PortNumber or Is64BitCapable is NULL.\r
+ EFI_DEVICE_ERROR \r
+ An error was encountered while attempting to retrieve the capabilities. \r
+ \r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcReset (\r
+ IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,\r
+ IN UINT16 Attributes\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ \r
+ Virtual interface to provides software reset for the USB host controller\r
+ for both Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ Attributes - A bit mask of the reset operation to perform. \r
+ See below for a list of the supported bit mask values.\r
+ \r
+ #define EFI_USB_HC_RESET_GLOBAL 0x0001 // Hc2 and Hc\r
+ #define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002 // Hc2 and Hc\r
+ #define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004 // Hc2\r
+ #define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008 // Hc2\r
+\r
+ EFI_USB_HC_RESET_GLOBAL \r
+ If this bit is set, a global reset signal will be sent to the USB bus.\r
+ This resets all of the USB bus logic, including the USB host \r
+ controller hardware and all the devices attached on the USB bus.\r
+ EFI_USB_HC_RESET_HOST_CONTROLLER \r
+ If this bit is set, the USB host controller hardware will be reset. \r
+ No reset signal will be sent to the USB bus.\r
+ EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG\r
+ If this bit is set, a global reset signal will be sent to the USB bus.\r
+ This resets all of the USB bus logic, including the USB host \r
+ controller hardware and all the devices attached on the USB bus. \r
+ If this is an EHCI controller and the debug port has configured, then \r
+ this is will still reset the host controller.\r
+ EFI_USB_HC_RESET_HOST_WITH_DEBUG\r
+ If this bit is set, the USB host controller hardware will be reset. \r
+ If this is an EHCI controller and the debug port has been configured,\r
+ then this will still reset the host controller.\r
+ \r
+ Returns:\r
+ \r
+ EFI_SUCCESS \r
+ The reset operation succeeded.\r
+ EFI_INVALID_PARAMETER \r
+ Attributes is not valid.\r
+ EFI_UNSUPPOURTED\r
+ The type of reset specified by Attributes is not currently supported by\r
+ the host controller hardware.\r
+ EFI_ACCESS_DENIED\r
+ Reset operation is rejected due to the debug port being configured and \r
+ active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or \r
+ EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Atrributes can be used to\r
+ perform reset operation for this host controller.\r
+ EFI_DEVICE_ERROR \r
+ An error was encountered while attempting to perform \r
+ the reset operation.\r
+ \r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcGetState (\r
+ IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,\r
+ OUT EFI_USB_HC_STATE *State\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ \r
+ Virtual interface to retrieves current state of the USB host controller\r
+ for both Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ State - A pointer to the EFI_USB_HC_STATE data structure that \r
+ indicates current state of the USB host controller. \r
+ Type EFI_USB_HC_STATE is defined below.\r
+ \r
+ typedef enum {\r
+ EfiUsbHcStateHalt,\r
+ EfiUsbHcStateOperational,\r
+ EfiUsbHcStateSuspend,\r
+ EfiUsbHcStateMaximum\r
+ } EFI_USB_HC_STATE;\r
+ \r
+ Returns:\r
+ \r
+ EFI_SUCCESS \r
+ The state information of the host controller was returned in State.\r
+ EFI_INVALID_PARAMETER \r
+ State is NULL.\r
+ EFI_DEVICE_ERROR \r
+ An error was encountered while attempting to retrieve the \r
+ host controller's current state. \r
+ \r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcSetState (\r
+ IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,\r
+ IN EFI_USB_HC_STATE State\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ \r
+ Virtual interface to sets the USB host controller to a specific state\r
+ for both Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ State - Indicates the state of the host controller that will be set.\r
+ \r
+ Returns:\r
+ \r
+ EFI_SUCCESS \r
+ The USB host controller was successfully placed in the state \r
+ specified by State.\r
+ EFI_INVALID_PARAMETER \r
+ State is invalid.\r
+ EFI_DEVICE_ERROR \r
+ Failed to set the state specified by State due to device error. \r
+ \r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcGetRootHubPortStatus (\r
+ IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,\r
+ IN UINT8 PortNumber,\r
+ OUT EFI_USB_PORT_STATUS *PortStatus\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ \r
+ Virtual interface to retrieves the current status of a USB root hub port\r
+ both for Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ PortNumber - Specifies the root hub port from which the status \r
+ is to be retrieved. This value is zero-based. For example, \r
+ if a root hub has two ports, then the first port is numbered 0,\r
+ and the second port is numbered 1.\r
+ PortStatus - A pointer to the current port status bits and \r
+ port status change bits. \r
+ \r
+ Returns:\r
+ \r
+ EFI_SUCCESS The status of the USB root hub port specified by PortNumber \r
+ was returned in PortStatus.\r
+ EFI_INVALID_PARAMETER PortNumber is invalid. \r
+ EFI_DEVICE_ERROR Can't read register \r
+ \r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcSetRootHubPortFeature (\r
+ IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,\r
+ IN UINT8 PortNumber,\r
+ IN EFI_USB_PORT_FEATURE PortFeature\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ Virual interface to sets a feature for the specified root hub port\r
+ for both Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ PortNumber - Specifies the root hub port whose feature \r
+ is requested to be set.\r
+ PortFeature - Indicates the feature selector associated \r
+ with the feature set request. \r
+ \r
+ Returns:\r
+ \r
+ EFI_SUCCESS \r
+ The feature specified by PortFeature was set for the \r
+ USB root hub port specified by PortNumber.\r
+ EFI_INVALID_PARAMETER \r
+ PortNumber is invalid or PortFeature is invalid.\r
+ EFI_DEVICE_ERROR\r
+ Can't read register\r
+ \r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcClearRootHubPortFeature (\r
+ IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,\r
+ IN UINT8 PortNumber,\r
+ IN EFI_USB_PORT_FEATURE PortFeature\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ \r
+ Virtual interface to clears a feature for the specified root hub port\r
+ for both Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ PortNumber - Specifies the root hub port whose feature \r
+ is requested to be cleared.\r
+ PortFeature - Indicates the feature selector associated with the \r
+ feature clear request.\r
+ \r
+ Returns:\r
+ \r
+ EFI_SUCCESS \r
+ The feature specified by PortFeature was cleared for the \r
+ USB root hub port specified by PortNumber.\r
+ EFI_INVALID_PARAMETER \r
+ PortNumber is invalid or PortFeature is invalid.\r
+ EFI_DEVICE_ERROR\r
+ Can't read register\r
+ \r
+--*/\r
+;\r
\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcControlTransfer (\r
+ IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,\r
+ IN UINT8 DeviceAddress,\r
+ IN UINT8 DeviceSpeed,\r
+ IN UINTN MaximumPacketLength,\r
+ IN EFI_USB_DEVICE_REQUEST *Request,\r
+ IN EFI_USB_DATA_DIRECTION TransferDirection,\r
+ IN OUT VOID *Data,\r
+ IN OUT UINTN *DataLength,\r
+ IN UINTN TimeOut,\r
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
+ OUT UINT32 *TransferResult\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ \r
+ Virtual interface to submits control transfer to a target USB device\r
+ for both Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ DeviceAddress - Represents the address of the target device on the USB,\r
+ which is assigned during USB enumeration.\r
+ DeviceSpeed - Indicates target device speed.\r
+ MaximumPacketLength - Indicates the maximum packet size that the \r
+ default control transfer endpoint is capable of \r
+ sending or receiving.\r
+ Request - A pointer to the USB device request that will be sent \r
+ to the USB device. \r
+ TransferDirection - Specifies the data direction for the transfer.\r
+ There are three values available, DataIn, DataOut \r
+ and NoData.\r
+ Data - A pointer to the buffer of data that will be transmitted \r
+ to USB device or received from USB device.\r
+ DataLength - Indicates the size, in bytes, of the data buffer \r
+ specified by Data.\r
+ TimeOut - Indicates the maximum time, in microseconds, \r
+ which the transfer is allowed to complete.\r
+ Translator - A pointr to the transaction translator data.\r
+ TransferResult - A pointer to the detailed result information generated \r
+ by this control transfer.\r
+ \r
+ Returns:\r
+ \r
+ EFI_SUCCESS \r
+ The control transfer was completed successfully.\r
+ EFI_OUT_OF_RESOURCES \r
+ The control transfer could not be completed due to a lack of resources.\r
+ EFI_INVALID_PARAMETER \r
+ Some parameters are invalid.\r
+ EFI_TIMEOUT \r
+ The control transfer failed due to timeout.\r
+ EFI_DEVICE_ERROR \r
+ The control transfer failed due to host controller or device error. \r
+ Caller should check TranferResult for detailed error information.\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcBulkTransfer (\r
+ IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,\r
+ IN UINT8 DeviceAddress,\r
+ IN UINT8 EndPointAddress,\r
+ IN UINT8 DeviceSpeed,\r
+ IN UINTN MaximumPacketLength,\r
+ IN UINT8 DataBuffersNumber,\r
+ IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],\r
+ IN OUT UINTN *DataLength,\r
+ IN OUT UINT8 *DataToggle,\r
+ IN UINTN TimeOut,\r
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
+ OUT UINT32 *TransferResult\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ \r
+ Virtual interface to submits bulk transfer to a bulk endpoint of a USB device\r
+ both for Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ DeviceAddress - Represents the address of the target device on the USB,\r
+ which is assigned during USB enumeration. \r
+ EndPointAddress - The combination of an endpoint number and an \r
+ endpoint direction of the target USB device. \r
+ Each endpoint address supports data transfer in \r
+ one direction except the control endpoint \r
+ (whose default endpoint address is 0). \r
+ It is the caller's responsibility to make sure that \r
+ the EndPointAddress represents a bulk endpoint. \r
+ DeviceSpeed - Indicates device speed. The supported values are EFI_USB_SPEED_FULL\r
+ and EFI_USB_SPEED_HIGH.\r
+ MaximumPacketLength - Indicates the maximum packet size the target endpoint\r
+ is capable of sending or receiving. \r
+ DataBuffersNumber - Number of data buffers prepared for the transfer.\r
+ Data - Array of pointers to the buffers of data that will be transmitted \r
+ to USB device or received from USB device. \r
+ DataLength - When input, indicates the size, in bytes, of the data buffer\r
+ specified by Data. When output, indicates the actually \r
+ transferred data size. \r
+ DataToggle - A pointer to the data toggle value. On input, it indicates \r
+ the initial data toggle value the bulk transfer should adopt;\r
+ on output, it is updated to indicate the data toggle value \r
+ of the subsequent bulk transfer. \r
+ Translator - A pointr to the transaction translator data. \r
+ TimeOut - Indicates the maximum time, in microseconds, which the \r
+ transfer is allowed to complete. \r
+ TransferResult - A pointer to the detailed result information of the \r
+ bulk transfer.\r
+\r
+ Returns:\r
+ \r
+ EFI_SUCCESS \r
+ The bulk transfer was completed successfully.\r
+ EFI_OUT_OF_RESOURCES \r
+ The bulk transfer could not be submitted due to lack of resource.\r
+ EFI_INVALID_PARAMETER \r
+ Some parameters are invalid.\r
+ EFI_TIMEOUT \r
+ The bulk transfer failed due to timeout.\r
+ EFI_DEVICE_ERROR \r
+ The bulk transfer failed due to host controller or device error.\r
+ Caller should check TranferResult for detailed error information.\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcAsyncInterruptTransfer (\r
+ IN USB_BUS_CONTROLLER_DEVICE * UsbBusDev,\r
+ IN UINT8 DeviceAddress,\r
+ IN UINT8 EndPointAddress,\r
+ IN UINT8 DeviceSpeed,\r
+ IN UINTN MaximumPacketLength,\r
+ IN BOOLEAN IsNewTransfer,\r
+ IN OUT UINT8 *DataToggle,\r
+ IN UINTN PollingInterval,\r
+ IN UINTN DataLength,\r
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR * Translator,\r
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction,\r
+ IN VOID *Context OPTIONAL\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ \r
+ Virtual interface to submits an asynchronous interrupt transfer to an \r
+ interrupt endpoint of a USB device for both Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ DeviceAddress - Represents the address of the target device on the USB,\r
+ which is assigned during USB enumeration. \r
+ EndPointAddress - The combination of an endpoint number and an endpoint \r
+ direction of the target USB device. Each endpoint address \r
+ supports data transfer in one direction except the \r
+ control endpoint (whose default endpoint address is 0). \r
+ It is the caller's responsibility to make sure that \r
+ the EndPointAddress represents an interrupt endpoint. \r
+ DeviceSpeed - Indicates device speed.\r
+ MaximumPacketLength - Indicates the maximum packet size the target endpoint\r
+ is capable of sending or receiving. \r
+ IsNewTransfer - If TRUE, an asynchronous interrupt pipe is built between\r
+ the host and the target interrupt endpoint. \r
+ If FALSE, the specified asynchronous interrupt pipe \r
+ is canceled. \r
+ DataToggle - A pointer to the data toggle value. On input, it is valid \r
+ when IsNewTransfer is TRUE, and it indicates the initial \r
+ data toggle value the asynchronous interrupt transfer \r
+ should adopt. \r
+ On output, it is valid when IsNewTransfer is FALSE, \r
+ and it is updated to indicate the data toggle value of \r
+ the subsequent asynchronous interrupt transfer. \r
+ PollingInterval - Indicates the interval, in milliseconds, that the \r
+ asynchronous interrupt transfer is polled. \r
+ This parameter is required when IsNewTransfer is TRUE. \r
+ DataLength - Indicates the length of data to be received at the \r
+ rate specified by PollingInterval from the target \r
+ asynchronous interrupt endpoint. This parameter \r
+ is only required when IsNewTransfer is TRUE. \r
+ Translator - A pointr to the transaction translator data.\r
+ CallBackFunction - The Callback function.This function is called at the \r
+ rate specified by PollingInterval.This parameter is \r
+ only required when IsNewTransfer is TRUE. \r
+ Context - The context that is passed to the CallBackFunction.\r
+ - This is an optional parameter and may be NULL.\r
+ \r
+ Returns:\r
+ \r
+ EFI_SUCCESS \r
+ The asynchronous interrupt transfer request has been successfully \r
+ submitted or canceled.\r
+ EFI_INVALID_PARAMETER \r
+ Some parameters are invalid.\r
+ EFI_OUT_OF_RESOURCES \r
+ The request could not be completed due to a lack of resources. \r
+ EFI_DEVICE_ERROR\r
+ Can't read register\r
+ \r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcSyncInterruptTransfer (\r
+ IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,\r
+ IN UINT8 DeviceAddress,\r
+ IN UINT8 EndPointAddress,\r
+ IN UINT8 DeviceSpeed,\r
+ IN UINTN MaximumPacketLength,\r
+ IN OUT VOID *Data,\r
+ IN OUT UINTN *DataLength,\r
+ IN OUT UINT8 *DataToggle,\r
+ IN UINTN TimeOut,\r
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
+ OUT UINT32 *TransferResult\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ \r
+ Vitual interface to submits synchronous interrupt transfer to an interrupt endpoint \r
+ of a USB device for both Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ DeviceAddress - Represents the address of the target device on the USB, \r
+ which is assigned during USB enumeration.\r
+ EndPointAddress - The combination of an endpoint number and an endpoint \r
+ direction of the target USB device. Each endpoint \r
+ address supports data transfer in one direction \r
+ except the control endpoint (whose default \r
+ endpoint address is 0). It is the caller's responsibility\r
+ to make sure that the EndPointAddress represents \r
+ an interrupt endpoint. \r
+ DeviceSpeed - Indicates device speed.\r
+ MaximumPacketLength - Indicates the maximum packet size the target endpoint \r
+ is capable of sending or receiving.\r
+ Data - A pointer to the buffer of data that will be transmitted \r
+ to USB device or received from USB device.\r
+ DataLength - On input, the size, in bytes, of the data buffer specified \r
+ by Data. On output, the number of bytes transferred.\r
+ DataToggle - A pointer to the data toggle value. On input, it indicates\r
+ the initial data toggle value the synchronous interrupt \r
+ transfer should adopt; \r
+ on output, it is updated to indicate the data toggle value \r
+ of the subsequent synchronous interrupt transfer. \r
+ TimeOut - Indicates the maximum time, in microseconds, which the \r
+ transfer is allowed to complete.\r
+ Translator - A pointr to the transaction translator data.\r
+ TransferResult - A pointer to the detailed result information from \r
+ the synchronous interrupt transfer. \r
+\r
+ Returns:\r
+ \r
+ EFI_SUCCESS \r
+ The synchronous interrupt transfer was completed successfully.\r
+ EFI_OUT_OF_RESOURCES \r
+ The synchronous interrupt transfer could not be submitted due \r
+ to lack of resource.\r
+ EFI_INVALID_PARAMETER \r
+ Some parameters are invalid.\r
+ EFI_TIMEOUT \r
+ The synchronous interrupt transfer failed due to timeout.\r
+ EFI_DEVICE_ERROR \r
+ The synchronous interrupt transfer failed due to host controller \r
+ or device error. Caller should check TranferResult for detailed \r
+ error information. \r
+ \r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcIsochronousTransfer (\r
+ IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,\r
+ IN UINT8 DeviceAddress,\r
+ IN UINT8 EndPointAddress,\r
+ IN UINT8 DeviceSpeed,\r
+ IN UINTN MaximumPacketLength,\r
+ IN UINT8 DataBuffersNumber,\r
+ IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r
+ IN UINTN DataLength,\r
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
+ OUT UINT32 *TransferResult\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ \r
+ Virtual interface to submits isochronous transfer to a target USB device\r
+ for both Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ DeviceAddress - Represents the address of the target device on the USB,\r
+ which is assigned during USB enumeration.\r
+ EndPointAddress - End point address\r
+ DeviceSpeed - Indicates device speed.\r
+ MaximumPacketLength - Indicates the maximum packet size that the \r
+ default control transfer endpoint is capable of \r
+ sending or receiving.\r
+ DataBuffersNumber - Number of data buffers prepared for the transfer.\r
+ Data - Array of pointers to the buffers of data that will be \r
+ transmitted to USB device or received from USB device.\r
+ DataLength - Indicates the size, in bytes, of the data buffer \r
+ specified by Data.\r
+ Translator - A pointr to the transaction translator data.\r
+ TransferResult - A pointer to the detailed result information generated \r
+ by this control transfer. \r
+ \r
+ Returns:\r
+ \r
+ EFI_UNSUPPORTED \r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UsbVirtualHcAsyncIsochronousTransfer (\r
+ IN USB_BUS_CONTROLLER_DEVICE *UsbBusDev,\r
+ IN UINT8 DeviceAddress,\r
+ IN UINT8 EndPointAddress,\r
+ IN UINT8 DeviceSpeed,\r
+ IN UINTN MaximumPacketLength,\r
+ IN UINT8 DataBuffersNumber,\r
+ IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r
+ IN UINTN DataLength,\r
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,\r
+ IN VOID *Context\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ \r
+ Vitual interface to submits Async isochronous transfer to a target USB device\r
+ for both Hc2 and Hc protocol.\r
+ \r
+ Arguments:\r
+ \r
+ UsbBusDev - A pointer to bus controller of the device.\r
+ DeviceAddress - Represents the address of the target device on the USB,\r
+ which is assigned during USB enumeration.\r
+ EndPointAddress - End point address\r
+ DeviceSpeed - Indicates device speed.\r
+ MaximumPacketLength - Indicates the maximum packet size that the \r
+ default control transfer endpoint is capable of \r
+ sending or receiving.\r
+ DataBuffersNumber - Number of data buffers prepared for the transfer.\r
+ Data - Array of pointers to the buffers of data that will be transmitted \r
+ to USB device or received from USB device.\r
+ DataLength - Indicates the size, in bytes, of the data buffer \r
+ specified by Data.\r
+ Translator - A pointr to the transaction translator data.\r
+ IsochronousCallBack - When the transfer complete, the call back function will be called\r
+ Context - Pass to the call back function as parameter\r
+ \r
+ Returns:\r
+ \r
+ EFI_UNSUPPORTED \r
+\r
+--*/\r
+;\r
\r
#endif\r