0016-usbtrans-Set-default-maximum-packet-size.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. From ba7ce6daec155bc3deac4e0c48d470afa024ab94 Mon Sep 17 00:00:00 2001
  2. From: Patrick Rudolph <patrick.rudolph@9elements.com>
  3. Date: Sun, 15 Nov 2020 19:48:03 +0100
  4. Subject: [PATCH 16/22] usbtrans: Set default maximum packet size
  5. Set the maximum packet size to 512 for SuperSpeed devices.
  6. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
  7. ---
  8. grub-core/bus/usb/usbtrans.c | 6 +++++-
  9. 1 file changed, 5 insertions(+), 1 deletion(-)
  10. diff --git a/grub-core/bus/usb/usbtrans.c b/grub-core/bus/usb/usbtrans.c
  11. index c5680b33a..c1080bb33 100644
  12. --- a/grub-core/bus/usb/usbtrans.c
  13. +++ b/grub-core/bus/usb/usbtrans.c
  14. @@ -128,8 +128,12 @@ grub_usb_control_msg (grub_usb_device_t dev,
  15. setupdata_addr = grub_dma_get_phys (setupdata_chunk);
  16. /* Determine the maximum packet size. */
  17. - if (dev->descdev.maxsize0)
  18. + if (dev->descdev.maxsize0 && dev->speed != GRUB_USB_SPEED_SUPER)
  19. max = dev->descdev.maxsize0;
  20. + else if (dev->descdev.maxsize0 && dev->speed == GRUB_USB_SPEED_SUPER)
  21. + max = 1UL << dev->descdev.maxsize0;
  22. + else if (dev->speed == GRUB_USB_SPEED_SUPER)
  23. + max = 512;
  24. else
  25. max = 64;
  26. --
  27. 2.39.2