summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorTian, Feng <feng.tian@intel.com>2013-10-23 05:35:07 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2013-10-23 05:35:07 +0000
commitd62f9aa6e6f575a6350bb2dad89545b2430a6762 (patch)
treefcee4624608d9347a75c001ec8ebb4f92a3f010d /MdeModulePkg
parent6cbbfa06d73277f27deefb1753a7779b483f8414 (diff)
downloadedk2-d62f9aa6e6f575a6350bb2dad89545b2430a6762.zip
edk2-d62f9aa6e6f575a6350bb2dad89545b2430a6762.tar.gz
edk2-d62f9aa6e6f575a6350bb2dad89545b2430a6762.tar.bz2
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 <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
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index dea5b1a..bcb4194 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);