From d62f9aa6e6f575a6350bb2dad89545b2430a6762 Mon Sep 17 00:00:00 2001 From: "Tian, Feng" Date: Wed, 23 Oct 2013 05:35:07 +0000 Subject: [PATCH] MdeModulePkg/XhciDxe: Dynamically calculate the interval value of interrupt endpoint context of low/full speed device behind low/full speed hub. Signed-off-by: Tian, Feng reviewed-by: Li, Elvin 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c index dea5b1af18..bcb419403d 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c @@ -2633,9 +2633,10 @@ XhcSetConfigCmd ( if ((DeviceSpeed == EFI_USB_SPEED_FULL) || (DeviceSpeed == EFI_USB_SPEED_LOW)) { Interval = EpDesc->Interval; // - // Hard code the interval to MAX first, need calculate through the bInterval field of Endpoint descriptor. + // Calculate through the bInterval field of Endpoint descriptor. // - InputContext->EP[Dci-1].Interval = 6; + ASSERT (Interval != 0); + InputContext->EP[Dci-1].Interval = (UINT32)HighBitSet32((UINT32)Interval) + 3; } else if ((DeviceSpeed == EFI_USB_SPEED_HIGH) || (DeviceSpeed == EFI_USB_SPEED_SUPER)) { Interval = EpDesc->Interval; ASSERT (Interval >= 1 && Interval <= 16); @@ -2830,9 +2831,10 @@ XhcSetConfigCmd64 ( if ((DeviceSpeed == EFI_USB_SPEED_FULL) || (DeviceSpeed == EFI_USB_SPEED_LOW)) { Interval = EpDesc->Interval; // - // Hard code the interval to MAX first, need calculate through the bInterval field of Endpoint descriptor. + // Calculate through the bInterval field of Endpoint descriptor. // - InputContext->EP[Dci-1].Interval = 6; + ASSERT (Interval != 0); + InputContext->EP[Dci-1].Interval = (UINT32)HighBitSet32((UINT32)Interval) + 3; } else if ((DeviceSpeed == EFI_USB_SPEED_HIGH) || (DeviceSpeed == EFI_USB_SPEED_SUPER)) { Interval = EpDesc->Interval; ASSERT (Interval >= 1 && Interval <= 16); -- 2.39.2