+//\r
+// UEFI 2.0 Protocol\r
+//\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2GetCapability(\r
+ IN EFI_USB2_HC_PROTOCOL * This,\r
+ OUT UINT8 *MaxSpeed,\r
+ OUT UINT8 *PortNumber,\r
+ OUT UINT8 *Is64BitCapable\r
+ )\r
+/*++\r
+\r
+ Routine Description:\r
+ Retrieves capabilities of USB host controller according to UEFI 2.0 spec.\r
+\r
+ Arguments:\r
+ This - A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+ \r
+ MaxSpeed - A pointer to the max speed USB host controller supports.\r
+ \r
+ PortNumber - A pointer to the number of root hub ports.\r
+ \r
+ Is64BitCapable - A pointer to an integer to show whether USB host controller\r
+ supports 64-bit memory addressing.\r
+ Returns:\r
+ EFI_SUCCESS \r
+ The host controller capabilities 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
+ USB_HC_DEV *HcDev;\r
+\r
+ HcDev = USB2_HC_DEV_FROM_THIS (This);\r
+ \r
+ if ((NULL == MaxSpeed) \r
+ ||(NULL == PortNumber)\r
+ || (NULL == Is64BitCapable))\r
+ {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+ \r
+ *MaxSpeed = EFI_USB_SPEED_FULL;\r
+ *Is64BitCapable = (UINT8)FALSE;\r
+ return UHCIGetRootHubPortNumber(&HcDev->UsbHc, PortNumber);\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2Reset (\r
+ IN EFI_USB2_HC_PROTOCOL * This,\r
+ IN UINT16 Attributes\r
+ )\r
+/*++\r
+\r
+ Routine Description:\r
+ Provides software reset for the USB host controller according to UEFI 2.0 spec.\r
+\r
+ Arguments:\r
+ This - A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+ \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\r
+ #define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002\r
+ #define EFI_USB_HC_RESET_GLOBAL _WITH_DEBUG 0x0004\r
+ #define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008\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
+ \r
+ Returns:\r
+ EFI_SUCCESS \r
+ The reset operation succeeded.\r
+ EFI_INVALID_PARAMETER \r
+ Attributes is not valid.\r
+ EFI_UNSUPPORTED\r
+ The type of reset specified by Attributes is not currently supported by the host controller hardware.\r
+ EFI_ACCESS_DENIED\r
+ Reset operation is rejected due to the debug port being configured and active.\r
+ EFI_DEVICE_ERROR \r
+ An error was encountered while attempting to perform \r
+ the reset operation.\r
+--*/\r
+{\r
+ USB_HC_DEV *HcDev;\r
+\r
+ HcDev = USB2_HC_DEV_FROM_THIS (This);\r
+ \r
+ if (Attributes==EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG || Attributes==EFI_USB_HC_RESET_HOST_WITH_DEBUG)\r
+ return EFI_UNSUPPORTED;\r
+ \r
+ return UHCIReset(\r
+ &HcDev->UsbHc, \r
+ Attributes\r
+ );\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2GetState (\r
+ IN EFI_USB2_HC_PROTOCOL * This,\r
+ OUT EFI_USB_HC_STATE * State\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ Retrieves current state of the USB host controller according to UEFI 2.0 spec.\r
+ \r
+ Arguments:\r
+ \r
+ This - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+ \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
+ 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
+ USB_HC_DEV *HcDev;\r
+\r
+ HcDev = USB2_HC_DEV_FROM_THIS (This);\r
+ return UHCIGetState(\r
+ &HcDev->UsbHc, \r
+ State\r
+ );\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2SetState (\r
+ IN EFI_USB2_HC_PROTOCOL * This,\r
+ IN EFI_USB_HC_STATE State\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ Sets the USB host controller to a specific state according to UEFI 2.0 spec.\r
+ \r
+ Arguments:\r
+ \r
+ This - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+\r
+ State - Indicates the state of the host controller that will be set.\r
+ \r
+ Returns:\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
+ USB_HC_DEV *HcDev;\r
+\r
+ HcDev = USB2_HC_DEV_FROM_THIS (This);\r
+ return UHCISetState(\r
+ &HcDev->UsbHc, \r
+ State\r
+ );\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2ControlTransfer (\r
+ IN EFI_USB2_HC_PROTOCOL * This,\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
+ Submits control transfer to a target USB device accroding to UEFI 2.0 spec..\r
+ \r
+ Arguments:\r
+ \r
+ This - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+\r
+ DeviceAddress -Represents the address of the target device on the USB,\r
+ which is assigned during USB enumeration.\r
+\r
+ DeviceSpeed - Indicates transfer speed of device.\r
+ \r
+ MaximumPacketLength - Indicates the maximum packet size that the \r
+ default control transfer endpoint is capable of \r
+ sending or receiving.\r
+ \r
+ Request - A pointer to the USB device request that will be sent \r
+ to the USB device. \r
+ \r
+ TransferDirection - Specifies the data direction for the transfer.\r
+ There are three values available, DataIn, DataOut \r
+ and NoData.\r
+ \r
+ Data -A pointer to the buffer of data that will be transmitted \r
+ to USB device or received from USB device.\r
+ \r
+ DataLength - Indicates the size, in bytes, of the data buffer \r
+ specified by Data.\r
+ \r
+ TimeOut - Indicates the maximum time, in microseconds, \r
+ which the transfer is allowed to complete.\r
+ \r
+ TransferResult - A pointer to the detailed result information generated \r
+ by this control transfer.\r
+ \r
+ Returns:\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
+ USB_HC_DEV *HcDev;\r
+ BOOLEAN IsSlowDevice = (EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE;\r
+\r
+ HcDev = USB2_HC_DEV_FROM_THIS (This);\r
+ \r
+ return UHCIControlTransfer(\r
+ &HcDev->UsbHc, \r
+ DeviceAddress, \r
+ IsSlowDevice, \r
+ (UINT8) MaximumPacketLength, \r
+ Request, \r
+ TransferDirection, \r
+ Data, \r
+ DataLength,\r
+ TimeOut,\r
+ TransferResult\r
+ ); \r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2BulkTransfer (\r
+ IN EFI_USB2_HC_PROTOCOL * This,\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
+ Submits bulk transfer to a bulk endpoint of a USB device according to UEFI 2.0 spec.\r
+ \r
+ Arguments:\r
+ \r
+ This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+ \r
+ DeviceAddress Represents the address of the target device on the USB,\r
+ which is assigned during USB enumeration.\r
+ \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
+ \r
+ DeviceSpeed Indicates device speed. The supported values are EFI_USB_SPEED_FULL\r
+ and EFI_USB_SPEED_HIGH.\r
+ \r
+ MaximumPacketLength Indicates the maximum packet size the target endpoint\r
+ is capable of sending or receiving.\r
+ \r
+ DataBuffersNumber Number of data buffers prepared for the transfer.\r
+ \r
+ Data Array of pointers to the buffers of data that will be transmitted \r
+ to USB device or received from USB device.\r
+ \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
+ \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
+ \r
+ Translator A pointr to the transaction translator data.\r
+ \r
+ TimeOut Indicates the maximum time, in microseconds, which the \r
+ transfer is allowed to complete.\r
+ \r
+ TransferResult A pointer to the detailed result information of the \r
+ bulk transfer.\r
+\r
+ Returns:\r
+ EFI_SUCCESS \r
+ The bulk transfer was completed successfully.\r
+ \r
+ EFI_OUT_OF_RESOURCES \r
+ The bulk transfer could not be submitted due to lack of resource.\r
+ \r
+ EFI_INVALID_PARAMETER \r
+ Some parameters are invalid.\r
+ \r
+ EFI_TIMEOUT \r
+ The bulk transfer failed due to timeout.\r
+ \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
+ USB_HC_DEV *HcDev;\r
+\r
+ HcDev = USB2_HC_DEV_FROM_THIS (This);\r
+ \r
+ if( Data == NULL || DeviceSpeed==EFI_USB_SPEED_LOW)\r
+ return EFI_INVALID_PARAMETER;\r
+ /* For full-speed bulk transfers only the data pointed by Data[0] shall be used */\r
+\r
+ return UHCIBulkTransfer (\r
+ &HcDev->UsbHc, \r
+ DeviceAddress, \r
+ EndPointAddress, \r
+ (UINT8) MaximumPacketLength, \r
+ *Data, \r
+ DataLength, \r
+ DataToggle, \r
+ TimeOut, \r
+ TransferResult\r
+ );\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2AsyncInterruptTransfer (\r
+ IN EFI_USB2_HC_PROTOCOL * This,\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\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ Submits an asynchronous interrupt transfer to an \r
+ interrupt endpoint of a USB device according to UEFI 2.0 spec.\r
+ \r
+ Arguments:\r
+ \r
+ This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+ \r
+ DeviceAddress Represents the address of the target device on the USB,\r
+ which is assigned during USB enumeration.\r
+ \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
+ \r
+ DeviceSpeed Indicates device speed.\r
+ \r
+ MaximumPacketLength Indicates the maximum packet size the target endpoint\r
+ is capable of sending or receiving.\r
+ \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
+ \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
+ \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
+ \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
+ \r
+ Translator A pointr to the transaction translator data.\r
+ \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
+ \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
+ \r
+ EFI_INVALID_PARAMETER \r
+ Some parameters are invalid.\r
+ \r
+ EFI_OUT_OF_RESOURCES \r
+ The request could not be completed due to a lack of resources. \r
+ \r
+ EFI_DEVICE_ERROR\r
+ Can't read register\r
+--*/ \r
+{\r
+ USB_HC_DEV *HcDev;\r
+ BOOLEAN IsSlowDevice = (EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE;\r
+ \r
+ HcDev = USB2_HC_DEV_FROM_THIS (This);\r
+ return UHCIAsyncInterruptTransfer(\r
+ &HcDev->UsbHc, \r
+ DeviceAddress, \r
+ EndPointAddress, \r
+ IsSlowDevice, \r
+ (UINT8) MaximumPacketLength, \r
+ IsNewTransfer, \r
+ DataToggle, \r
+ PollingInterval,\r
+ DataLength, \r
+ CallBackFunction,\r
+ Context\r
+ );\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2SyncInterruptTransfer (\r
+ IN EFI_USB2_HC_PROTOCOL * This,\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
+ Submits synchronous interrupt transfer to an interrupt endpoint \r
+ of a USB device according to UEFI 2.0 spec.\r
+ \r
+ Arguments:\r
+ \r
+ This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+ \r
+ DeviceAddress Represents the address of the target device on the USB, \r
+ which is assigned during USB enumeration.\r
+ \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
+ \r
+ DeviceSpeed Indicates device speed.\r
+ \r
+ MaximumPacketLength Indicates the maximum packet size the target endpoint \r
+ is capable of sending or receiving.\r
+ \r
+ Data A pointer to the buffer of data that will be transmitted \r
+ to USB device or received from USB device.\r
+ \r
+ DataLength On input, the size, in bytes, of the data buffer specified \r
+ by Data. On output, the number of bytes transferred.\r
+ \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
+ \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
+ 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
+ USB_HC_DEV *HcDev;\r
+ BOOLEAN IsSlowDevice;\r
+ \r
+ if(DeviceSpeed==EFI_USB_SPEED_HIGH)\r
+ return EFI_INVALID_PARAMETER;\r
+ \r
+ IsSlowDevice = (EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE; \r
+ HcDev = USB2_HC_DEV_FROM_THIS (This);\r
+ \r
+ return UHCISyncInterruptTransfer(\r
+ &HcDev->UsbHc, \r
+ DeviceAddress, \r
+ EndPointAddress, \r
+ IsSlowDevice, \r
+ (UINT8) MaximumPacketLength, \r
+ Data, \r
+ DataLength, \r
+ DataToggle,\r
+ TimeOut,\r
+ TransferResult\r
+ );\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2IsochronousTransfer (\r
+ IN EFI_USB2_HC_PROTOCOL * This,\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
+ Submits isochronous transfer to a target USB device according to UEFI 2.0 spec.\r
+ \r
+ Arguments:\r
+ \r
+ This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+ \r
+ DeviceAddress Represents the address of the target device on the USB,\r
+ which is assigned during USB enumeration.\r
+ \r
+ EndPointAddress End point address\r
+ \r
+ DeviceSpeed Indicates device speed.\r
+ \r
+ MaximumPacketLength Indicates the maximum packet size that the \r
+ default control transfer endpoint is capable of \r
+ sending or receiving.\r
+ \r
+ DataBuffersNumber Number of data buffers prepared for the transfer.\r
+ \r
+ Data Array of pointers to the buffers of data that will be \r
+ transmitted to USB device or received from USB device.\r
+ \r
+ DataLength Indicates the size, in bytes, of the data buffer \r
+ specified by Data.\r
+ \r
+ Translator A pointr to the transaction translator data.\r
+ \r
+ TransferResult A pointer to the detailed result information generated \r
+ by this control transfer. \r
+ Returns:\r
+ \r
+ EFI_UNSUPPORTED \r
+\r
+--*/ \r
+{\r
+ return EFI_UNSUPPORTED;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2AsyncIsochronousTransfer (\r
+ IN EFI_USB2_HC_PROTOCOL * This,\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
+ Submits Async isochronous transfer to a target USB device according to UEFI 2.0 spec.\r
+ \r
+ Arguments:\r
+ \r
+ This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+ \r
+ DeviceAddress Represents the address of the target device on the USB,\r
+ which is assigned during USB enumeration.\r
+\r
+ EndPointAddress End point address\r
+ \r
+ DeviceSpeed Indicates device speed.\r
+ \r
+ MaximumPacketLength Indicates the maximum packet size that the \r
+ default control transfer endpoint is capable of \r
+ sending or receiving.\r
+ \r
+ DataBuffersNumber Number of data buffers prepared for the transfer.\r
+ \r
+ Data Array of pointers to the buffers of data that will be transmitted \r
+ to USB device or received from USB device.\r
+ \r
+ Translator A pointr to the transaction translator data.\r
+ \r
+ IsochronousCallBack When the transfer complete, the call back function will be called\r
+ \r
+ Context Pass to the call back function as parameter\r
+ \r
+ Returns:\r
+ \r
+ EFI_UNSUPPORTED \r
+\r
+--*/ \r
+{\r
+ return EFI_UNSUPPORTED;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2GetRootHubPortStatus (\r
+ IN EFI_USB2_HC_PROTOCOL * This,\r
+ IN UINT8 PortNumber,\r
+ OUT EFI_USB_PORT_STATUS * PortStatus\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ Retrieves the current status of a USB root hub port according to UEFI 2.0 spec.\r
+ \r
+ Arguments:\r
+ \r
+ This A pointer to the EFI_USB2_HC_PROTOCOL.\r
+ \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
+ \r
+ PortStatus A pointer to the current port status bits and \r
+ port status change bits. \r
+ \r
+ Returns:\r
+ EFI_SUCCESS \r
+ The status of the USB root hub port specified by PortNumber \r
+ was returned in PortStatus.\r
+ EFI_INVALID_PARAMETER \r
+ PortNumber is invalid. \r
+ EFI_DEVICE_ERROR - Can't read register \r
+--*/ \r
+{\r
+ USB_HC_DEV *HcDev;\r
+\r
+ HcDev = USB2_HC_DEV_FROM_THIS (This);\r
+ \r
+ return UHCIGetRootHubPortStatus(\r
+ &HcDev->UsbHc, \r
+ PortNumber, \r
+ PortStatus\r
+ );\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2SetRootHubPortFeature (\r
+ IN EFI_USB2_HC_PROTOCOL * This,\r
+ IN UINT8 PortNumber,\r
+ IN EFI_USB_PORT_FEATURE PortFeature\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ Sets a feature for the specified root hub port according to UEFI 2.0 spec.\r
+ \r
+ Arguments:\r
+ \r
+ This A pointer to the EFI_USB2_HC_PROTOCOL.\r
+ \r
+ PortNumber Specifies the root hub port whose feature \r
+ is requested to be set.\r
+ \r
+ PortFeature Indicates the feature selector associated \r
+ with the feature set request. \r
+ \r
+ Returns:\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
+ USB_HC_DEV *HcDev;\r
+\r
+ HcDev = USB2_HC_DEV_FROM_THIS (This);\r
+ return UHCISetRootHubPortFeature(\r
+ &HcDev->UsbHc, \r
+ PortNumber, \r
+ PortFeature\r
+ );\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UHCI2ClearRootHubPortFeature (\r
+ IN EFI_USB2_HC_PROTOCOL * This,\r
+ IN UINT8 PortNumber,\r
+ IN EFI_USB_PORT_FEATURE PortFeature\r
+ )\r
+/*++\r
+ \r
+ Routine Description:\r
+ Clears a feature for the specified root hub port according to Uefi 2.0 spec.\r
+ \r
+ Arguments:\r
+ \r
+ This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+ \r
+ PortNumber Specifies the root hub port whose feature \r
+ is requested to be cleared.\r
+ \r
+ PortFeature Indicates the feature selector associated with the \r
+ feature clear request.\r
+ \r
+ Returns:\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
+ USB_HC_DEV *HcDev;\r
+\r
+ HcDev = USB2_HC_DEV_FROM_THIS (This);\r
+ return UHCIClearRootHubPortFeature(\r
+ &HcDev->UsbHc, \r
+ PortNumber, \r
+ PortFeature\r
+ );\r
+}\r
+\r