]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Xhci: Fill the 'interval' field for ISO endpoint context
authorHao Wu <hao.a.wu@intel.com>
Wed, 31 May 2017 01:22:27 +0000 (09:22 +0800)
committerHao Wu <hao.a.wu@intel.com>
Thu, 1 Jun 2017 00:54:03 +0000 (08:54 +0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=510

The commit fills the 'Interval' field of the Endpoint Context data for
isochronous endpoints. It will resolve the error when a Configure
Endpoint Command is sent to an isochronous endpoint.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c

index 4bec76a85ffbc7bac8e81fe4ccba810bde3503f6..58a2f984a9450a127e065f95fa8ec35580ef15c7 100644 (file)
@@ -2,7 +2,7 @@
 \r
   XHCI transfer scheduling routines.\r
 \r
-Copyright (c) 2011 - 2016, 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
@@ -2660,6 +2660,20 @@ XhcInitializeEndpointContext (
           InputContext->EP[Dci-1].CErr   = 0;\r
           InputContext->EP[Dci-1].EPType = ED_ISOCH_OUT;\r
         }\r
+        //\r
+        // Get the bInterval from descriptor and init the the interval field of endpoint context.\r
+        // Refer to XHCI 1.1 spec section 6.2.3.6.\r
+        //\r
+        if (DeviceSpeed == EFI_USB_SPEED_FULL) {\r
+          Interval = EpDesc->Interval;\r
+          ASSERT (Interval >= 1 && Interval <= 16);\r
+          InputContext->EP[Dci-1].Interval = Interval + 2;\r
+        } else if ((DeviceSpeed == EFI_USB_SPEED_HIGH) || (DeviceSpeed == EFI_USB_SPEED_SUPER)) {\r
+          Interval = EpDesc->Interval;\r
+          ASSERT (Interval >= 1 && Interval <= 16);\r
+          InputContext->EP[Dci-1].Interval = Interval - 1;\r
+        }\r
+\r
         //\r
         // Do not support isochronous transfer now.\r
         //\r
@@ -2828,6 +2842,20 @@ XhcInitializeEndpointContext64 (
           InputContext->EP[Dci-1].CErr   = 0;\r
           InputContext->EP[Dci-1].EPType = ED_ISOCH_OUT;\r
         }\r
+        //\r
+        // Get the bInterval from descriptor and init the the interval field of endpoint context.\r
+        // Refer to XHCI 1.1 spec section 6.2.3.6.\r
+        //\r
+        if (DeviceSpeed == EFI_USB_SPEED_FULL) {\r
+          Interval = EpDesc->Interval;\r
+          ASSERT (Interval >= 1 && Interval <= 16);\r
+          InputContext->EP[Dci-1].Interval = Interval + 2;\r
+        } else if ((DeviceSpeed == EFI_USB_SPEED_HIGH) || (DeviceSpeed == EFI_USB_SPEED_SUPER)) {\r
+          Interval = EpDesc->Interval;\r
+          ASSERT (Interval >= 1 && Interval <= 16);\r
+          InputContext->EP[Dci-1].Interval = Interval - 1;\r
+        }\r
+\r
         //\r
         // Do not support isochronous transfer now.\r
         //\r
index 7a63dabd8c1d978d1bab5d6249ff592dfa086b86..3dd2b8909787180ec94bc19af05c382a838d7ca1 100644 (file)
@@ -2,7 +2,7 @@
 PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid\r
 which is used to enable recovery function from USB Drivers.\r
 \r
-Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -1749,6 +1749,20 @@ XhcPeiSetConfigCmd (
             InputContext->EP[Dci-1].CErr   = 0;\r
             InputContext->EP[Dci-1].EPType = ED_ISOCH_OUT;\r
           }\r
+          //\r
+          // Get the bInterval from descriptor and init the the interval field of endpoint context.\r
+          // Refer to XHCI 1.1 spec section 6.2.3.6.\r
+          //\r
+          if (DeviceSpeed == EFI_USB_SPEED_FULL) {\r
+            Interval = EpDesc->Interval;\r
+            ASSERT (Interval >= 1 && Interval <= 16);\r
+            InputContext->EP[Dci-1].Interval = Interval + 2;\r
+          } else if ((DeviceSpeed == EFI_USB_SPEED_HIGH) || (DeviceSpeed == EFI_USB_SPEED_SUPER)) {\r
+            Interval = EpDesc->Interval;\r
+            ASSERT (Interval >= 1 && Interval <= 16);\r
+            InputContext->EP[Dci-1].Interval = Interval - 1;\r
+          }\r
+\r
           //\r
           // Do not support isochronous transfer now.\r
           //\r
@@ -1952,6 +1966,20 @@ XhcPeiSetConfigCmd64 (
             InputContext->EP[Dci-1].CErr   = 0;\r
             InputContext->EP[Dci-1].EPType = ED_ISOCH_OUT;\r
           }\r
+          //\r
+          // Get the bInterval from descriptor and init the the interval field of endpoint context.\r
+          // Refer to XHCI 1.1 spec section 6.2.3.6.\r
+          //\r
+          if (DeviceSpeed == EFI_USB_SPEED_FULL) {\r
+            Interval = EpDesc->Interval;\r
+            ASSERT (Interval >= 1 && Interval <= 16);\r
+            InputContext->EP[Dci-1].Interval = Interval + 2;\r
+          } else if ((DeviceSpeed == EFI_USB_SPEED_HIGH) || (DeviceSpeed == EFI_USB_SPEED_SUPER)) {\r
+            Interval = EpDesc->Interval;\r
+            ASSERT (Interval >= 1 && Interval <= 16);\r
+            InputContext->EP[Dci-1].Interval = Interval - 1;\r
+          }\r
+\r
           //\r
           // Do not support isochronous transfer now.\r
           //\r