From patchwork Fri Oct 23 12:27:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 534957 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 959ED14131D for ; Fri, 23 Oct 2015 23:27:35 +1100 (AEDT) Received: from localhost ([::1]:38122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpbRV-0007rp-Gs for incoming@patchwork.ozlabs.org; Fri, 23 Oct 2015 08:27:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpbRF-0007bP-Vm for qemu-devel@nongnu.org; Fri, 23 Oct 2015 08:27:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpbRB-0003YR-Uf for qemu-devel@nongnu.org; Fri, 23 Oct 2015 08:27:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpbRB-0003YN-P0 for qemu-devel@nongnu.org; Fri, 23 Oct 2015 08:27:13 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 83FE68C1AB for ; Fri, 23 Oct 2015 12:27:13 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-32.ams2.redhat.com [10.36.116.32]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9NCRCqk027890; Fri, 23 Oct 2015 08:27:13 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 0081881B47; Fri, 23 Oct 2015 14:27:11 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 23 Oct 2015 14:27:10 +0200 Message-Id: <1445603230-11840-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH] usb-host: fix usb3ep0quirk test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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;