]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.h
modify coding style to pass ecc tool and provide comments that complied with Doxgen.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusDxe / UsbHub.h
index e31ba27586b6de7b75ff8904eab84eb04abde155..af4897a74b5dd61b6cb3e9be82c7d56eb6abc6cf 100644 (file)
@@ -1,5 +1,7 @@
 /** @file\r
 \r
+    The definition for USB hub.\r
+\r
 Copyright (c) 2007, 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
@@ -9,17 +11,6 @@ http://opensource.org/licenses/bsd-license.php
 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:\r
-\r
-    UsbHub.h\r
-\r
-  Abstract:\r
-\r
-    The definition for USB hub\r
-\r
-  Revision History\r
-\r
-\r
 **/\r
 \r
 #ifndef _USB_HUB_H_\r
@@ -30,7 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define USB_ENDPOINT_ADDR(EpAddr) ((EpAddr) & 0x7F)\r
 #define USB_ENDPOINT_TYPE(Desc)   ((Desc)->Attributes & USB_ENDPOINT_TYPE_MASK)\r
 \r
-enum {\r
+typedef enum {\r
   USB_DESC_TYPE_HUB           = 0x29,\r
 \r
   //\r
@@ -95,7 +86,7 @@ enum {
   // after 500ms(LOOP * STALL = 100 * 5ms), set by experience\r
   //\r
   USB_WAIT_PORT_STS_CHANGE_LOOP   = 100\r
-};\r
+}USB_HUB_FLAGS_VALUE;\r
 \r
 #pragma pack(1)\r
 //\r
@@ -119,6 +110,23 @@ typedef struct {
 } USB_CHANGE_FEATURE_MAP;\r
 \r
 \r
+/**\r
+  Clear the transaction translate buffer if full/low\r
+  speed control/bulk transfer failed and the transfer\r
+  uses this hub as translator.Remember to clear the TT\r
+  buffer of transaction translator, not that of the\r
+  parent.\r
+\r
+  @param  UsbDev                The Usb device.\r
+  @param  Port                  The port of the hub.\r
+  @param  DevAddr               Address of the failed transaction.\r
+  @param  EpNum                 The endpoint number of the failed transaction.\r
+  @param  EpType                The type of failed transaction.\r
+\r
+  @retval EFI_SUCCESS           The TT buffer is cleared.\r
+  @retval Others                Failed to clear the TT buffer.\r
+\r
+**/\r
 EFI_STATUS\r
 UsbHubCtrlClearTTBuffer (\r
   IN USB_DEVICE           *UsbDev,\r
@@ -129,11 +137,31 @@ UsbHubCtrlClearTTBuffer (
   );\r
 \r
 \r
+/**\r
+  Test whether the interface is a hub interface.\r
+\r
+  @param  UsbIf                 The interface to test.\r
+\r
+  @retval TRUE                  The interface is a hub interface.\r
+  @retval FALSE                 The interface isn't a hub interface.\r
+\r
+**/\r
 BOOLEAN\r
 UsbIsHubInterface (\r
   IN USB_INTERFACE        *UsbIf\r
   );\r
 \r
+\r
+/**\r
+  Ack the hub change bits. If these bits are not ACKed, Hub will\r
+  always return changed bit map from its interrupt endpoint.\r
+\r
+  @param  UsbDev                The Usb device.\r
+\r
+  @retval EFI_SUCCESS           The hub change status is ACKed.\r
+  @retval Others                Failed to ACK the hub status.\r
+\r
+**/\r
 EFI_STATUS\r
 UsbHubAckHubStatus (\r
   IN  USB_DEVICE         *UsbDev\r