]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.h
MdeModulePkg UsbBusDxe: Fix wrong buffer length used to read hub desc
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusDxe / UsbHub.h
index f63eb5005fd6b972b026eff677985d0b60e86ac0..fe9f1f74c751ccc3649644b4e184b100671cc04f 100644 (file)
@@ -2,8 +2,8 @@
 \r
     The definition for USB hub.\r
 \r
-Copyright (c) 2007 - 2010, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+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
@@ -23,6 +23,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 \r
 #define USB_DESC_TYPE_HUB     0x29\r
+\r
+#define USB_DESC_TYPE_HUB_SUPER_SPEED  0x2a\r
+\r
 //\r
 // Hub class control transfer target\r
 //\r
@@ -40,6 +43,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define USB_HUB_REQ_RESET_TT        9\r
 #define USB_HUB_REQ_GET_TT_STATE    10\r
 #define USB_HUB_REQ_STOP_TT         11\r
+\r
+#define USB_HUB_REQ_SET_DEPTH       12\r
+\r
 //\r
 // USB hub class feature selector\r
 //\r
@@ -50,6 +56,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define USB_HUB_PORT_SUSPEND        2\r
 #define USB_HUB_PORT_OVER_CURRENT   3\r
 #define USB_HUB_PORT_RESET          4\r
+\r
+#define USB_HUB_PORT_LINK_STATE     5\r
+\r
 #define USB_HUB_PORT_POWER          8\r
 #define USB_HUB_PORT_LOW_SPEED      9\r
 #define USB_HUB_C_PORT_CONNECT      16\r
@@ -59,6 +68,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define USB_HUB_C_PORT_RESET        20\r
 #define USB_HUB_PORT_TEST           21\r
 #define USB_HUB_PORT_INDICATOR      22\r
+\r
+#define USB_HUB_C_PORT_LINK_STATE     25\r
+#define USB_HUB_PORT_REMOTE_WAKE_MASK 27\r
+#define USB_HUB_BH_PORT_RESET         28\r
+#define USB_HUB_C_BH_PORT_RESET       29\r
+\r
+//\r
+// Constant value for Port Status & Port Change Status of SuperSpeed port\r
+//\r
+#define USB_SS_PORT_STAT_C_BH_RESET         0x0020\r
+#define USB_SS_PORT_STAT_C_PORT_LINK_STATE  0x0040\r
 //\r
 // USB hub power control method. In gang power control\r
 //\r
@@ -77,9 +97,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 //\r
 // Host software return timeout if port status doesn't change \r
-// after 500ms(LOOP * STALL = 100 * 5ms), set by experience\r
+// after 500ms(LOOP * STALL = 5000 * 0.1ms), set by experience\r
 //\r
-#define USB_WAIT_PORT_STS_CHANGE_LOOP  100\r
+#define USB_WAIT_PORT_STS_CHANGE_LOOP  5000\r
 \r
 #pragma pack(1)\r
 //\r
@@ -94,6 +114,7 @@ typedef struct {
   UINT8           HubContrCurrent;\r
   UINT8           Filler[16];\r
 } EFI_USB_HUB_DESCRIPTOR;\r
+\r
 #pragma pack()\r
 \r
 \r