]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/XhciDxe: Dynamically calculate the interval value of interrupt endpoint...
authorTian, Feng <feng.tian@intel.com>
Wed, 23 Oct 2013 05:35:07 +0000 (05:35 +0000)
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 23 Oct 2013 05:35:07 +0000 (05:35 +0000)
Signed-off-by: Tian, Feng <feng.tian@intel.com>
reviewed-by: Li, Elvin <elvin.li@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14797 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c

index dea5b1af1884b8426b3bc888c44dd4d790205cf1..bcb419403dd326f0744b08c8bba3a27594b13d5e 100644 (file)
@@ -2633,9 +2633,10 @@ XhcSetConfigCmd (
           if ((DeviceSpeed == EFI_USB_SPEED_FULL) || (DeviceSpeed == EFI_USB_SPEED_LOW)) {\r
             Interval = EpDesc->Interval;\r
             //\r
-            // Hard code the interval to MAX first, need calculate through the bInterval field of Endpoint descriptor.\r
+            // Calculate through the bInterval field of Endpoint descriptor.\r
             //\r
-            InputContext->EP[Dci-1].Interval = 6;\r
+            ASSERT (Interval != 0);\r
+            InputContext->EP[Dci-1].Interval = (UINT32)HighBitSet32((UINT32)Interval) + 3;\r
           } else if ((DeviceSpeed == EFI_USB_SPEED_HIGH) || (DeviceSpeed == EFI_USB_SPEED_SUPER)) {\r
             Interval = EpDesc->Interval;\r
             ASSERT (Interval >= 1 && Interval <= 16);\r
@@ -2830,9 +2831,10 @@ XhcSetConfigCmd64 (
           if ((DeviceSpeed == EFI_USB_SPEED_FULL) || (DeviceSpeed == EFI_USB_SPEED_LOW)) {\r
             Interval = EpDesc->Interval;\r
             //\r
-            // Hard code the interval to MAX first, need calculate through the bInterval field of Endpoint descriptor.\r
+            // Calculate through the bInterval field of Endpoint descriptor.\r
             //\r
-            InputContext->EP[Dci-1].Interval = 6;\r
+            ASSERT (Interval != 0);\r
+            InputContext->EP[Dci-1].Interval = (UINT32)HighBitSet32((UINT32)Interval) + 3;\r
           } else if ((DeviceSpeed == EFI_USB_SPEED_HIGH) || (DeviceSpeed == EFI_USB_SPEED_SUPER)) {\r
             Interval = EpDesc->Interval;\r
             ASSERT (Interval >= 1 && Interval <= 16);\r