From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtZZJ-0003pW-Sc for qemu-devel@nongnu.org; Tue, 03 Nov 2015 06:16:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtZZG-0007bC-2B for qemu-devel@nongnu.org; Tue, 03 Nov 2015 06:16:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtZZF-0007av-Sj for qemu-devel@nongnu.org; Tue, 03 Nov 2015 06:15:57 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 6299FAA7 for ; Tue, 3 Nov 2015 11:15:57 +0000 (UTC) From: Gerd Hoffmann Date: Tue, 3 Nov 2015 12:15:54 +0100 Message-Id: <1446549354-26147-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1446549354-26147-1-git-send-email-kraxel@redhat.com> References: <1446549354-26147-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 2/2] usb-host: fix usb3ep0quirk test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann 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. Signed-off-by: Gerd Hoffmann Message-id: 1445603230-11840-1-git-send-email-kraxel@redhat.com --- hw/usb/host-libusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 7695a97..3f8e540 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -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; -- 1.8.3.1