From: "Sean Rhodes" <sean@starlabs.systems>
To: devel@edk2.groups.io
Cc: Sean Rhodes <sean@starlabs.systems>,
Hao A Wu <hao.a.wu@intel.com>, Ray Ni <ray.ni@intel.com>
Subject: [PATCH 4/4] MdeModulePkg/UsbBusDxe: Adjust the MaxPacketLength to real world values
Date: Thu, 1 Dec 2022 20:24:33 +0000 [thread overview]
Message-ID: <a9d69b68521fe69565eb0adb500ace1cffd13624.1669926273.git.sean@starlabs.systems> (raw)
In-Reply-To: <0bd92ce8c58e964edacdb85a5d7c4f600aecbaa4.1669926273.git.sean@starlabs.systems>
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 <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
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/XhciDxe/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;
}
- if ((MaximumPacketLength != 8) && (MaximumPacketLength != 16) &&
- (MaximumPacketLength != 32) && (MaximumPacketLength != 64) &&
- (MaximumPacketLength != 512)
- )
- {
+ // Check for valid maximum packet size
+ if ((DeviceSpeed == EFI_USB_SPEED_SUPER) && (MaximumPacketLength > 1024)) {
return EFI_INVALID_PARAMETER;
}
- if ((DeviceSpeed == EFI_USB_SPEED_LOW) && (MaximumPacketLength != 8)) {
+ if ((DeviceSpeed == EFI_USB_SPEED_HIGH) && (MaximumPacketLength > 512)) {
return EFI_INVALID_PARAMETER;
}
- if ((DeviceSpeed == EFI_USB_SPEED_SUPER) && (MaximumPacketLength != 512)) {
+ if ((DeviceSpeed == EFI_USB_SPEED_FULL) && (MaximumPacketLength > 64)) {
return EFI_INVALID_PARAMETER;
}
--
2.37.2
next prev parent reply other threads:[~2022-12-01 20:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 20:24 [PATCH 1/4] MdeModulePkg/XhciDxe/XhciReg: Handle incorrect PSIV indices Sean Rhodes
2022-12-01 20:24 ` [PATCH 2/4] MdeModulePkg/XhciDxe/Xhci: Don't check for invalid PSIV Sean Rhodes
2022-12-01 20:24 ` [PATCH 3/4] MdeModulePkg/BmBoot: Skip removable media if it is not present Sean Rhodes
2022-12-01 20:24 ` Sean Rhodes [this message]
2022-12-02 6:25 ` [edk2-devel] [PATCH 1/4] MdeModulePkg/XhciDxe/XhciReg: Handle incorrect PSIV indices Wu, Hao A
2022-12-02 16:38 ` Sean Rhodes
2022-12-05 1:37 ` Wu, Hao A
-- strict thread matches above, loose matches on Subject: below --
2022-12-05 9:18 Sean Rhodes
2022-12-05 9:18 ` [PATCH 4/4] MdeModulePkg/UsbBusDxe: Adjust the MaxPacketLength to real world values Sean Rhodes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a9d69b68521fe69565eb0adb500ace1cffd13624.1669926273.git.sean@starlabs.systems \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox