Files
lbmk/config/grub/xhci/patches/0016-usbtrans-Set-default-maximum-packet-size.patch
T
Leah Rowe 64d3c7b515 grub/xhci: Add xHCI non-root-hub fixes from Nitrokey
See:
https://github.com/Nitrokey/nethsm-grub/commits/nethsm-z790?since=2025-01-13&until=2025-01-13

And more generally, see branch:
https://github.com/Nitrokey/nethsm-grub/commits/nethsm-z790

This brings in a few minor fixes, and also a not-so-minor fix:
Add TT (transaction translation) handling for non-SuperSpeed
devices in xhci.c

More generally, this patchset will improve non-root hub support
in the xHCI code. There is also a patch to work around a quirk
on the MSI Z790-P mainboard, which I'm planning to add to Libreboot
at a later date.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-01-14 20:34:16 +00:00

34 lines
1.1 KiB
Diff

From f7c7c25e274b79a7c8e62250fa9bc49f81bd4456 Mon Sep 17 00:00:00 2001
From: Patrick Rudolph <patrick.rudolph@9elements.com>
Date: Mon, 7 Dec 2020 08:41:23 +0100
Subject: [PATCH 16/26] usbtrans: Set default maximum packet size
Set the maximum packet size to 512 for SuperSpeed devices.
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
---
grub-core/bus/usb/usbtrans.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/grub-core/bus/usb/usbtrans.c b/grub-core/bus/usb/usbtrans.c
index c5680b33a..c1080bb33 100644
--- a/grub-core/bus/usb/usbtrans.c
+++ b/grub-core/bus/usb/usbtrans.c
@@ -128,8 +128,12 @@ grub_usb_control_msg (grub_usb_device_t dev,
setupdata_addr = grub_dma_get_phys (setupdata_chunk);
/* Determine the maximum packet size. */
- if (dev->descdev.maxsize0)
+ if (dev->descdev.maxsize0 && dev->speed != GRUB_USB_SPEED_SUPER)
max = dev->descdev.maxsize0;
+ else if (dev->descdev.maxsize0 && dev->speed == GRUB_USB_SPEED_SUPER)
+ max = 1UL << dev->descdev.maxsize0;
+ else if (dev->speed == GRUB_USB_SPEED_SUPER)
+ max = 512;
else
max = 64;
--
2.39.5