From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01b.sbp.mail.zen.net.uk (smarthost01b.sbp.mail.zen.net.uk [212.23.1.3]) by mx.groups.io with SMTP id smtpd.web11.11179.1670231914814651792 for ; Mon, 05 Dec 2022 01:18:35 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 sdn.klaviyomail.com}: permanent DNS error (domain: starlabs.systems, ip: 212.23.1.3, mailfrom: sean@starlabs.systems) Received: from [51.148.147.4] (helo=starbook..) by smarthost01b.sbp.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1p27cP-0004m4-EI; Mon, 05 Dec 2022 09:18:33 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: Sean Rhodes , Hao A Wu , Ray Ni Subject: [PATCH 4/4] MdeModulePkg/UsbBusDxe: Adjust the MaxPacketLength to real world values Date: Mon, 5 Dec 2022 09:18:27 +0000 Message-Id: <04f0fa8e36a7ff57ed6ab14ebe284bce35680262.1670231907.git.sean@starlabs.systems> X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 X-Originating-smarthost01b-IP: [51.148.147.4] Feedback-ID: 51.148.147.4 Content-Transfer-Encoding: quoted-printable Adjusts the requirements for the MaxPacketLength to match what is seen on real world devices that do not follow the USB specification. This fixes enumeration on the multiple USB 3 devices made by SanDisk, Integral, Kingston and other generic brands. Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Sean Rhodes --- MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/Xhc= iDxe/Xhci.c index 62535cad54..043b7d4cea 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c @@ -906,19 +906,16 @@ XhcControlTransfer ( return EFI_INVALID_PARAMETER;=0D }=0D =0D - if ((MaximumPacketLength !=3D 8) && (MaximumPacketLength !=3D 16) &&=0D - (MaximumPacketLength !=3D 32) && (MaximumPacketLength !=3D 64) &&=0D - (MaximumPacketLength !=3D 512)=0D - )=0D - {=0D + // Check for valid maximum packet size=0D + if ((DeviceSpeed =3D=3D EFI_USB_SPEED_SUPER) && (MaximumPacketLength > 1= 024)) {=0D return EFI_INVALID_PARAMETER;=0D }=0D =0D - if ((DeviceSpeed =3D=3D EFI_USB_SPEED_LOW) && (MaximumPacketLength !=3D = 8)) {=0D + if ((DeviceSpeed =3D=3D EFI_USB_SPEED_HIGH) && (MaximumPacketLength > 51= 2)) {=0D return EFI_INVALID_PARAMETER;=0D }=0D =0D - if ((DeviceSpeed =3D=3D EFI_USB_SPEED_SUPER) && (MaximumPacketLength != =3D 512)) {=0D + if ((DeviceSpeed =3D=3D EFI_USB_SPEED_FULL) && (MaximumPacketLength > 64= )) {=0D return EFI_INVALID_PARAMETER;=0D }=0D =0D --=20 2.37.2