]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h
MdeModulePkg/XhciDxe: Check timeout URB again after stopping endpoint
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / XhciDxe / Xhci.h
index ae56b1e6fe49c06ff2ab5d7cd8bd99f20eb6bd97..76daaff4a4e57668bcd048b6cb1f9917a2f041e6 100644 (file)
@@ -2,7 +2,7 @@
 \r
   Provides some data structure definitions used by the XHCI host controller driver.\r
 \r
-Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2011 - 2017, 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
@@ -40,31 +40,36 @@ typedef struct _USB_DEV_CONTEXT      USB_DEV_CONTEXT;
 #include "XhciReg.h"\r
 #include "XhciSched.h"\r
 #include "ComponentName.h"\r
+#include "UsbHcMem.h"\r
 \r
 //\r
-// Convert millisecond to microsecond.\r
+// The unit is microsecond, setting it as 1us.\r
+//\r
+#define XHC_1_MICROSECOND            (1)\r
+//\r
+// The unit is microsecond, setting it as 1ms.\r
 //\r
 #define XHC_1_MILLISECOND            (1000)\r
 //\r
 // XHC generic timeout experience values.\r
-// The unit is microsecond, setting it as 10ms.\r
+// The unit is millisecond, setting it as 10s.\r
 //\r
 #define XHC_GENERIC_TIMEOUT          (10 * 1000)\r
 //\r
 // XHC reset timeout experience values.\r
-// The unit is microsecond, setting it as 1s.\r
+// The unit is millisecond, setting it as 1s.\r
 //\r
-#define XHC_RESET_TIMEOUT            (1000 * 1000)\r
+#define XHC_RESET_TIMEOUT            (1000)\r
 //\r
-// XHC delay experience value for polling operation.\r
-// The unit is microsecond, set it as 1ms.\r
+// TRSTRCY delay requirement in usb 2.0 spec chapter 7.1.7.5.\r
+// The unit is microsecond, setting it as 10ms.\r
 //\r
-#define XHC_POLL_DELAY               (1000)\r
+#define XHC_RESET_RECOVERY_DELAY     (10 * 1000)\r
 //\r
 // XHC async transfer timer interval, set by experience.\r
-// The unit is 100us, takes 50ms as interval.\r
+// The unit is 100us, takes 1ms as interval.\r
 //\r
-#define XHC_ASYNC_TIMER_INTERVAL     EFI_TIMER_PERIOD_MILLISECONDS(50)\r
+#define XHC_ASYNC_TIMER_INTERVAL     EFI_TIMER_PERIOD_MILLISECONDS(1)\r
 \r
 //\r
 // XHC raises TPL to TPL_NOTIFY to serialize all its operations\r
@@ -84,7 +89,7 @@ typedef struct _USB_DEV_CONTEXT      USB_DEV_CONTEXT;
 #define INT_INTER_ASYNC              4\r
 \r
 //\r
-// Iterate through the doule linked list. This is delete-safe.\r
+// Iterate through the double linked list. This is delete-safe.\r
 // Don't touch NextEntry\r
 //\r
 #define EFI_LIST_FOR_EACH_SAFE(Entry, NextEntry, ListHead) \\r
@@ -191,12 +196,21 @@ struct _USB_DEV_CONTEXT {
   // These information is used to support XHCI's Config_Endpoint cmd.\r
   //\r
   EFI_USB_CONFIG_DESCRIPTOR **ConfDesc;\r
+  //\r
+  // A device has an active Configuration.\r
+  //\r
+  UINT8                     ActiveConfiguration;\r
+  //\r
+  // Every interface has an active AlternateSetting.\r
+  //\r
+  UINT8                     *ActiveAlternateSetting;\r
 };\r
 \r
 struct _USB_XHCI_INSTANCE {\r
   UINT32                    Signature;\r
   EFI_PCI_IO_PROTOCOL       *PciIo;\r
   UINT64                    OriginalPciAttributes;\r
+  USBHC_MEM_POOL            *MemPool;\r
 \r
   EFI_USB2_HC_PROTOCOL      Usb2Hc;\r
 \r
@@ -219,11 +233,17 @@ struct _USB_XHCI_INSTANCE {
   UINT16                    MaxInterrupt;\r
   UINT32                    PageSize;\r
   UINT64                    *ScratchBuf;\r
+  VOID                      *ScratchMap;\r
   UINT32                    MaxScratchpadBufs;\r
+  UINT64                    *ScratchEntry;\r
+  UINTN                     *ScratchEntryMap;\r
   UINT32                    ExtCapRegBase;\r
   UINT32                    UsbLegSupOffset;\r
+  UINT32                    DebugCapSupOffset;\r
   UINT64                    *DCBAA;\r
+  VOID                      *DCBAAMap;\r
   UINT32                    MaxSlotsEn;\r
+  URB                       *PendingUrb;\r
   //\r
   // Cmd Transfer Ring\r
   //\r
@@ -242,6 +262,8 @@ struct _USB_XHCI_INSTANCE {
   // The array supports up to 255 devices, entry 0 is reserved and should not be used.\r
   //\r
   USB_DEV_CONTEXT           UsbDevContext[256];\r
+\r
+  BOOLEAN                   Support64BitDma; // Whether 64 bit DMA may be used with this device\r
 };\r
 \r
 \r
@@ -292,7 +314,7 @@ XhcDriverBindingStart (
   );\r
 \r
 /**\r
-  Stop this driver on ControllerHandle. Support stoping any child handles\r
+  Stop this driver on ControllerHandle. Support stopping any child handles\r
   created by this driver.\r
 \r
   @param  This                 Protocol instance pointer.\r