Skip to contentSkip to conversation

usb-host: fix usb3ep0quirk test

PATCH New Gerd Hoffmann 1 participant 1 message Oct 23, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb-host: fix usb3ep0quirk test

usb->speed is the usb speed the device is actually running on in the qemu emulation (i.e. from the guests point of view). So when plugging usb3 devices into ehci hostadapter this is HIGH not SUPER.

To figure whenever the host talks to the device with superspeed we have to check speedmask instead and see whenever the superspeed bit is set there.

---
 hw/usb/host-libusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/host-libusb.c +1 -1
index 7695a97..3f8e540 100644
@@ -1240,7 +1240,7 @@ static void usb_host_handle_control(USBDevice *udev, USBPacket *p,
 
     /* Fix up USB-3 ep0 maxpacket size to allow superspeed connected devices
      * to work redirected to a not superspeed capable hcd */
-    if (udev->speed == USB_SPEED_SUPER &&
+    if ((udev->speedmask & USB_SPEED_MASK_SUPER) &&
         !(udev->port->speedmask & USB_SPEED_MASK_SUPER) &&
         request == 0x8006 && value == 0x100 && index == 0) {
         r->usb3ep0quirk = true;
Signature · 1 line
1.8.3.1