From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01b.ixn.mail.zen.net.uk (smarthost01b.ixn.mail.zen.net.uk [212.23.1.21]) by mx.groups.io with SMTP id smtpd.web10.55953.1669926280329009225 for ; Thu, 01 Dec 2022 12:24:40 -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.21, mailfrom: sean@starlabs.systems) Received: from [217.155.46.38] (helo=starbook..) by smarthost01b.ixn.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1p0q6p-0005lx-0i; Thu, 01 Dec 2022 20:24:39 +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: Thu, 1 Dec 2022 20:24:33 +0000 Message-Id: X-Mailer: git-send-email 2.37.2 In-Reply-To: <0bd92ce8c58e964edacdb85a5d7c4f600aecbaa4.1669926273.git.sean@starlabs.systems> References: <0bd92ce8c58e964edacdb85a5d7c4f600aecbaa4.1669926273.git.sean@starlabs.systems> MIME-Version: 1.0 X-Originating-smarthost01b-IP: [217.155.46.38] Feedback-ID: 217.155.46.38 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 51ae57db21..73bfc62512 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