From 04910ceb352b54fe8edac4c20d9a6515cd5fdad5 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Mon, 15 Sep 2014 09:33:16 +0000 Subject: MdeModulePkg XhciPei/UsbBusPei: Enhance code for better device compatibility. 1. Add delay after set device address and get configuration descriptor. 2. Sync the change at R15876 in XhciDxe to do not access transfer ring when endpoint is isochronous type or control type. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Feng Tian git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16105 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'MdeModulePkg/Bus/Pci') diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c index dde31e0f1a..8e768bc470 100644 --- a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c @@ -1706,7 +1706,12 @@ XhcPeiSetConfigCmd ( InputContext->EP[Dci-1].CErr = 0; InputContext->EP[Dci-1].EPType = ED_ISOCH_OUT; } - break; + // + // Do not support isochronous transfer now. + // + DEBUG ((EFI_D_INFO, "XhcPeiSetConfigCmd: Unsupport ISO EP found, Transfer ring is not allocated.\n")); + EpDesc = (USB_ENDPOINT_DESCRIPTOR *)((UINTN)EpDesc + EpDesc->Length); + continue; case USB_ENDPOINT_INTERRUPT: if (Direction == EfiUsbDataIn) { InputContext->EP[Dci-1].CErr = 3; @@ -1744,9 +1749,14 @@ XhcPeiSetConfigCmd ( break; case USB_ENDPOINT_CONTROL: + // + // Do not support control transfer now. + // + DEBUG ((EFI_D_INFO, "XhcPeiSetConfigCmd: Unsupport Control EP found, Transfer ring is not allocated.\n")); default: - ASSERT (FALSE); - break; + DEBUG ((EFI_D_INFO, "XhcPeiSetConfigCmd: Unknown EP found, Transfer ring is not allocated.\n")); + EpDesc = (USB_ENDPOINT_DESCRIPTOR *)((UINTN)EpDesc + EpDesc->Length); + continue; } PhyAddr = UsbHcGetPciAddrForHostAddr ( @@ -1899,7 +1909,12 @@ XhcPeiSetConfigCmd64 ( InputContext->EP[Dci-1].CErr = 0; InputContext->EP[Dci-1].EPType = ED_ISOCH_OUT; } - break; + // + // Do not support isochronous transfer now. + // + DEBUG ((EFI_D_INFO, "XhcPeiSetConfigCmd64: Unsupport ISO EP found, Transfer ring is not allocated.\n")); + EpDesc = (USB_ENDPOINT_DESCRIPTOR *)((UINTN)EpDesc + EpDesc->Length); + continue; case USB_ENDPOINT_INTERRUPT: if (Direction == EfiUsbDataIn) { InputContext->EP[Dci-1].CErr = 3; @@ -1937,9 +1952,14 @@ XhcPeiSetConfigCmd64 ( break; case USB_ENDPOINT_CONTROL: + // + // Do not support control transfer now. + // + DEBUG ((EFI_D_INFO, "XhcPeiSetConfigCmd64: Unsupport Control EP found, Transfer ring is not allocated.\n")); default: - ASSERT (0); - break; + DEBUG ((EFI_D_INFO, "XhcPeiSetConfigCmd64: Unknown EP found, Transfer ring is not allocated.\n")); + EpDesc = (USB_ENDPOINT_DESCRIPTOR *)((UINTN)EpDesc + EpDesc->Length); + continue; } PhyAddr = UsbHcGetPciAddrForHostAddr ( -- cgit v1.2.3