]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/Usb2HostController.h
Code Scrub for Protocol and Ppi Definition
[mirror_edk2.git] / MdePkg / Include / Protocol / Usb2HostController.h
index 81ad7732a653c260a83257788b5e4b9efc18eb77..5e56a24d2335a2dab3782371e3058441a80a440e 100644 (file)
@@ -1,5 +1,8 @@
 /** @file\r
   EFI_USB2_HC_PROTOCOL as defined in UEFI 2.0.\r
+  The USB Host Controller Protocol is used by code, typically USB bus drivers, \r
+  running in the EFI boot services environment, to perform data transactions over \r
+  a USB bus. In addition, it provides an abstraction for the root hub of the USB bus.\r
 \r
   Copyright (c) 2006, Intel Corporation\r
   All rights reserved. This program and the accompanying materials\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
@@ -58,7 +104,7 @@ typedef struct {
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_CAPABILITY) (\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_CAPABILITY)(\r
   IN  EFI_USB2_HC_PROTOCOL  *This,\r
   OUT UINT8                 *MaxSpeed,\r
   OUT UINT8                 *PortNumber,\r
@@ -90,7 +136,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_RESET) (\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_RESET)(\r
   IN EFI_USB2_HC_PROTOCOL   *This,\r
   IN UINT16                 Attributes\r
   )\r
@@ -98,15 +144,15 @@ EFI_STATUS
 \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
+  @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
@@ -118,15 +164,15 @@ EFI_STATUS
                                     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
+  @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
@@ -151,7 +197,7 @@ typedef enum {
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE) (\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE)(\r
   IN CONST  EFI_USB2_HC_PROTOCOL    *This,\r
   OUT       EFI_USB_HC_STATE        *State\r
 )\r
@@ -171,7 +217,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE) (\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE)(\r
   IN EFI_USB2_HC_PROTOCOL    *This,\r
   IN EFI_USB_HC_STATE        State\r
   )\r
@@ -192,9 +238,9 @@ EFI_STATUS
                               received from USB device.\r
   @param  DataLength          On input, indicates the size, in bytes, of the data buffer specified by Data.\r
                               On output, indicates the amount of data actually transferred.\r
-  @param  Translator          A pointer to the transaction translator data.\r
   @param  TimeOut             Indicates the maximum time, in milliseconds, which the transfer is\r
                               allowed to complete.\r
+  @param  Translator          A pointer to the transaction translator data.\r
   @param  TransferResult      A pointer to the detailed result information generated by this control\r
                               transfer.\r
 \r
@@ -208,7 +254,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER) (\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER)(\r
   IN     EFI_USB2_HC_PROTOCOL               *This,\r
   IN     UINT8                              DeviceAddress,\r
   IN     UINT8                              DeviceSpeed,\r
@@ -241,9 +287,9 @@ EFI_STATUS
   @param  DataLength          When input, indicates the size, in bytes, of the data buffers specified by\r
                               Data. When output, indicates the actually transferred data size.\r
   @param  DataToggle          A pointer to the data toggle value.\r
-  @param  Translator          A pointer to the transaction translator data.\r
   @param  TimeOut             Indicates the maximum time, in milliseconds, which the transfer is\r
                               allowed to complete.\r
+  @param  Translator          A pointer to the transaction translator data.\r
   @param  TransferResult      A pointer to the detailed result information of the bulk transfer.\r
 \r
   @retval EFI_SUCCESS           The bulk transfer was completed successfully.\r
@@ -256,7 +302,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER) (\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER)(\r
   IN     EFI_USB2_HC_PROTOCOL               *This,\r
   IN     UINT8                              DeviceAddress,\r
   IN     UINT8                              EndPointAddress,\r
@@ -306,7 +352,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER) (\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(\r
   IN     EFI_USB2_HC_PROTOCOL                                *This,\r
   IN     UINT8                                               DeviceAddress,\r
   IN     UINT8                                               EndPointAddress,\r
@@ -354,7 +400,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER) (\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
@@ -400,7 +446,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER) (\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(\r
   IN     EFI_USB2_HC_PROTOCOL               *This,\r
   IN     UINT8                              DeviceAddress,\r
   IN     UINT8                              EndPointAddress,\r
@@ -444,7 +490,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER) (\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(\r
   IN     EFI_USB2_HC_PROTOCOL               *This,\r
   IN     UINT8                              DeviceAddress,\r
   IN     UINT8                              EndPointAddress,\r
@@ -474,7 +520,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS) (\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(\r
   IN CONST  EFI_USB2_HC_PROTOCOL    *This,\r
   IN CONST  UINT8                   PortNumber,\r
   OUT       EFI_USB_PORT_STATUS     *PortStatus\r
@@ -496,7 +542,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE) (\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(\r
   IN EFI_USB2_HC_PROTOCOL    *This,\r
   IN UINT8                   PortNumber,\r
   IN EFI_USB_PORT_FEATURE    PortFeature\r
@@ -518,13 +564,71 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE) (\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(\r
   IN EFI_USB2_HC_PROTOCOL    *This,\r
   IN UINT8                   PortNumber,\r
   IN EFI_USB_PORT_FEATURE    PortFeature\r
   )\r
 ;\r
 \r
+/**  \r
+  @par Protocol Description:\r
+  The EFI_USB2_HC_PROTOCOL provides USB host controller management, basic \r
+  data transactions over a USB bus, and USB root hub access. A device driver \r
+  that wishes to manage a USB bus in a system retrieves the EFI_USB2_HC_PROTOCOL \r
+  instance that is associated with the USB bus to be managed. A device handle \r
+  for a USB host controller will minimally contain an EFI_DEVICE_PATH_PROTOCOL \r
+  instance, and an EFI_USB2_HC_PROTOCOL instance.\r
+\r
+  @param GetCapability\r
+  Retrieves the capabilities of the USB host controller. \r
+\r
+  @param Reset\r
+  Software reset of USB. \r
+\r
+  @param GetState\r
+  Retrieves the current state of the USB host controller. \r
+\r
+  @param SetState\r
+  Sets the USB host controller to a specific state. \r
+\r
+  @param ControlTransfer\r
+  Submits a control transfer to a target USB device. \r
+\r
+  @param BulkTransfer\r
+  Submits a bulk transfer to a bulk endpoint of a USB device. \r
+\r
+  @param AsyncInterruptTransfer\r
+  Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device. \r
+\r
+  @param SyncInterruptTransfer\r
+  Submits a synchronous interrupt transfer to an interrupt endpoint of a USB device. \r
+\r
+  @param IsochronousTransfer\r
+  Submits isochronous transfer to an isochronous endpoint of a USB device. \r
+\r
+  @param AsyncIsochronousTransfer\r
+  Submits nonblocking USB isochronous transfer. \r
+\r
+  @param GetRootHubPortStatus\r
+  Retrieves the status of the specified root hub port. \r
+\r
+  @param SetRootHubPortFeature\r
+  Sets the feature for the specified root hub port. \r
+\r
+  @param ClearRootHubPortFeature\r
+  Clears the feature for the specified root hub port. \r
+\r
+  @param MajorRevision\r
+  The major revision number of the USB host controller. The revision information \r
+  indicates the release of the Universal Serial Bus Specification with which the \r
+  host controller is compliant.\r
+\r
+  @param MinorRevision\r
+  The minor revision number of the USB host controller. The revision information \r
+  indicates the release of the Universal Serial Bus Specification with which the \r
+  host controller is compliant.\r
+**/\r
 struct _EFI_USB2_HC_PROTOCOL {\r
   EFI_USB2_HC_PROTOCOL_GET_CAPABILITY              GetCapability;\r
   EFI_USB2_HC_PROTOCOL_RESET                       Reset;\r