/** @file\r
EFI_USB2_HC_PROTOCOL as defined in UEFI 2.0.\r
\r
- Copyright (c) 2006, Intel Corporation \r
- All rights reserved. This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
- Module Name: Usb2HostController.h\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
#ifndef _USB2_HOSTCONTROLLER_H_\r
#define _USB2_HOSTCONTROLLER_H_\r
\r
+#include <IndustryStandard/Usb.h>\r
+#include <Protocol/UsbIo.h>\r
+\r
#define EFI_USB2_HC_PROTOCOL_GUID \\r
{ \\r
0x3e745226, 0x9818, 0x45b6, {0xa2, 0xac, 0xd7, 0xcd, 0xe, 0x8b, 0xa2, 0xbc } \\r
//\r
typedef struct _EFI_USB2_HC_PROTOCOL EFI_USB2_HC_PROTOCOL;\r
\r
+\r
+typedef struct {\r
+ UINT16 PortStatus;\r
+ UINT16 PortChangeStatus;\r
+} EFI_USB_PORT_STATUS;\r
+\r
+//\r
+// Constant value for Port Status & Port Change Status\r
+//\r
+#define USB_PORT_STAT_CONNECTION 0x0001\r
+#define USB_PORT_STAT_ENABLE 0x0002\r
+#define USB_PORT_STAT_SUSPEND 0x0004\r
+#define USB_PORT_STAT_OVERCURRENT 0x0008\r
+#define USB_PORT_STAT_RESET 0x0010\r
+#define USB_PORT_STAT_POWER 0x0100\r
+#define USB_PORT_STAT_LOW_SPEED 0x0200\r
+#define USB_PORT_STAT_HIGH_SPEED 0x0400\r
+#define USB_PORT_STAT_OWNER 0x0800\r
+\r
+#define USB_PORT_STAT_C_CONNECTION 0x0001\r
+#define USB_PORT_STAT_C_ENABLE 0x0002\r
+#define USB_PORT_STAT_C_SUSPEND 0x0004\r
+#define USB_PORT_STAT_C_OVERCURRENT 0x0008\r
+#define USB_PORT_STAT_C_RESET 0x0010\r
+\r
+\r
+//\r
+// Usb port features\r
+//\r
+typedef enum {\r
+ EfiUsbPortEnable = 1,\r
+ EfiUsbPortSuspend = 2,\r
+ EfiUsbPortReset = 4,\r
+ EfiUsbPortPower = 8,\r
+ EfiUsbPortOwner = 13,\r
+ EfiUsbPortConnectChange = 16,\r
+ EfiUsbPortEnableChange = 17,\r
+ EfiUsbPortSuspendChange = 18,\r
+ EfiUsbPortOverCurrentChange = 19,\r
+ EfiUsbPortResetChange = 20\r
+} EFI_USB_PORT_FEATURE;\r
+\r
+\r
#define EFI_USB_SPEED_FULL 0x0000 // 12 Mb/s, USB 1.1 OHCI and UHCI HC.\r
#define EFI_USB_SPEED_LOW 0x0001 // 1 Mb/s, USB 1.1 OHCI and UHCI HC.\r
#define EFI_USB_SPEED_HIGH 0x0002 // 480 Mb/s, USB 2.0 EHCI HC.\r
)\r
;\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
Provides software reset for the USB host controller.\r
\r
)\r
;\r
\r
+/**\r
+\r
+ @param EfiUsbHcStateHalt The host controller is in halt\r
+ state. No USB transactions can occur\r
+ while in this state. The host\r
+ controller can enter this state for\r
+ three reasons: 1) After host\r
+ controller hardware reset. 2)\r
+ Explicitly set by software. 3)\r
+ Triggered by a fatal error such as\r
+ consistency check failure.\r
+\r
+\r
+ @param EfiUsbHcStateOperational The host controller is in an\r
+ operational state. When in\r
+ this state, the host\r
+ controller can execute bus\r
+ traffic. This state must be\r
+ explicitly set to enable the\r
+ USB bus traffic.\r
+\r
+\r
+ @param EfiUsbHcStateSuspend The host controller is in the\r
+ suspend state. No USB\r
+ transactions can occur while in\r
+ this state. The host controller\r
+ enters this state for the\r
+ following reasons: 1) Explicitly\r
+ set by software. 2) Triggered\r
+ when there is no bus traffic for\r
+ 3 microseconds.\r
+\r
+**/\r
+typedef enum {\r
+ EfiUsbHcStateHalt,\r
+ EfiUsbHcStateOperational,\r
+ EfiUsbHcStateSuspend,\r
+ EfiUsbHcStateMaximum\r
+} EFI_USB_HC_STATE;\r
+\r
/**\r
Retrieves current state of the USB host controller.\r
\r
@retval EFI_SUCCESS The state information of the host controller was returned in State.\r
@retval EFI_INVALID_PARAMETER State is NULL.\r
@retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the\r
- host controller¡¯s current state.\r
+ host controller's current state.\r
\r
**/\r
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE) (\r
- IN EFI_USB2_HC_PROTOCOL *This,\r
- OUT EFI_USB_HC_STATE *State\r
- )\r
-; \r
+ IN CONST EFI_USB2_HC_PROTOCOL *This,\r
+ OUT EFI_USB_HC_STATE *State\r
+)\r
+;\r
\r
/**\r
Sets the USB host controller to a specific state.\r
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
OUT UINT32 *TransferResult\r
)\r
-; \r
+;\r
\r
#define EFI_USB_MAX_BULK_BUFFER_NUM 10\r
\r
\r
/**\r
Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r
+ Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.\r
\r
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
@param DeviceAddress Represents the address of the target device on the USB.\r
transfer is polled.\r
@param DataLength Indicates the length of data to be received at the rate specified by\r
PollingInterval from the target asynchronous interrupt endpoint.\r
+ @param Translator A pointr to the transaction translator data.\r
@param CallBackFunction The Callback function. This function is called at the rate specified by\r
PollingInterval.\r
@param Context The context that is passed to the CallBackFunction. This is an\r
IN OUT UINT8 *DataToggle,\r
IN UINTN PollingInterval OPTIONAL,\r
IN UINTN DataLength OPTIONAL,\r
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator OPTIONAL,\r
IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,\r
IN VOID *Context OPTIONAL\r
)\r
\r
/**\r
Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.\r
+ Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.\r
\r
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
@param DeviceAddress Represents the address of the target device on the USB.\r
@param DataToggle A pointer to the data toggle value.\r
@param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r
allowed to complete.\r
+ @param Translator A pointr to the transaction translator data.\r
@param TransferResult A pointer to the detailed result information from the synchronous\r
interrupt transfer.\r
\r
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER) (\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
- OUT UINT32 *TransferResult\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
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS) (\r
- IN EFI_USB2_HC_PROTOCOL *This,\r
- IN UINT8 PortNumber,\r
- OUT EFI_USB_PORT_STATUS *PortStatus\r
+ IN CONST EFI_USB2_HC_PROTOCOL *This,\r
+ IN CONST UINT8 PortNumber,\r
+ OUT EFI_USB_PORT_STATUS *PortStatus\r
)\r
-; \r
+;\r
\r
/**\r
Sets a feature for the specified root hub port.\r
IN UINT8 PortNumber,\r
IN EFI_USB_PORT_FEATURE PortFeature\r
)\r
-; \r
+;\r
\r
/**\r
Clears a feature for the specified root hub port.\r
IN UINT8 PortNumber,\r
IN EFI_USB_PORT_FEATURE PortFeature\r
)\r
-; \r
+;\r
\r
struct _EFI_USB2_HC_PROTOCOL {\r
EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability;\r