summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Pci/XhciPei
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2017-05-31 09:22:27 +0800
committerHao Wu <hao.a.wu@intel.com>2017-06-01 08:54:03 +0800
commit3719c2aa879bcbcf3f0ab1f710e81fe2dbc19d9a (patch)
tree58e76f3dca8fe2c0b620a3fb95c1de60949e400f /MdeModulePkg/Bus/Pci/XhciPei
parent213da0b540891ba614753673ce3ed54940434497 (diff)
downloadedk2-3719c2aa879bcbcf3f0ab1f710e81fe2dbc19d9a.tar.gz
edk2-3719c2aa879bcbcf3f0ab1f710e81fe2dbc19d9a.tar.bz2
edk2-3719c2aa879bcbcf3f0ab1f710e81fe2dbc19d9a.zip
MdeModulePkg/Xhci: Fill the 'interval' field for ISO endpoint context
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>
Diffstat (limited to 'MdeModulePkg/Bus/Pci/XhciPei')
-rw-r--r--MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
index 7a63dabd8c..3dd2b89097 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
@@ -2,7 +2,7 @@
PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
which is used to enable recovery function from USB Drivers.
-Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -1750,6 +1750,20 @@ XhcPeiSetConfigCmd (
InputContext->EP[Dci-1].EPType = ED_ISOCH_OUT;
}
//
+ // Get the bInterval from descriptor and init the the interval field of endpoint context.
+ // Refer to XHCI 1.1 spec section 6.2.3.6.
+ //
+ if (DeviceSpeed == EFI_USB_SPEED_FULL) {
+ Interval = EpDesc->Interval;
+ ASSERT (Interval >= 1 && Interval <= 16);
+ InputContext->EP[Dci-1].Interval = Interval + 2;
+ } else if ((DeviceSpeed == EFI_USB_SPEED_HIGH) || (DeviceSpeed == EFI_USB_SPEED_SUPER)) {
+ Interval = EpDesc->Interval;
+ ASSERT (Interval >= 1 && Interval <= 16);
+ InputContext->EP[Dci-1].Interval = Interval - 1;
+ }
+
+ //
// Do not support isochronous transfer now.
//
DEBUG ((EFI_D_INFO, "XhcPeiSetConfigCmd: Unsupport ISO EP found, Transfer ring is not allocated.\n"));
@@ -1953,6 +1967,20 @@ XhcPeiSetConfigCmd64 (
InputContext->EP[Dci-1].EPType = ED_ISOCH_OUT;
}
//
+ // Get the bInterval from descriptor and init the the interval field of endpoint context.
+ // Refer to XHCI 1.1 spec section 6.2.3.6.
+ //
+ if (DeviceSpeed == EFI_USB_SPEED_FULL) {
+ Interval = EpDesc->Interval;
+ ASSERT (Interval >= 1 && Interval <= 16);
+ InputContext->EP[Dci-1].Interval = Interval + 2;
+ } else if ((DeviceSpeed == EFI_USB_SPEED_HIGH) || (DeviceSpeed == EFI_USB_SPEED_SUPER)) {
+ Interval = EpDesc->Interval;
+ ASSERT (Interval >= 1 && Interval <= 16);
+ InputContext->EP[Dci-1].Interval = Interval - 1;
+ }
+
+ //
// Do not support isochronous transfer now.
//
DEBUG ((EFI_D_INFO, "XhcPeiSetConfigCmd64: Unsupport ISO EP found, Transfer ring is not allocated.\n"));