From nobody Sat May 4 12:55:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559111452; cv=none; d=zoho.com; s=zohoarc; b=nSEIjPwFoJgOX+m6k4ZErW0zvbH84th+fWtPRvvVERbJrDIyS0xFyBtQeM33fwVsTd0Wh9w8/OmJ4vEcSuyrEYKISmwF1/fCojKxy/DxQc8oTUx6GP+hlXWp3sYpeJ+BtCms8KMAG4nFgndsfQ/Y135D+/VpLYz6WMFLO6x50c8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559111452; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=MxEmSzNLLX7sepx14kvVgylGVGVId5errKgCGo3TCzo=; b=O4yPCtYEHsFS974nFBaMm5Gas2CW7p3Hqea47xXDbeJGiUWN0PUx33abJAAPvDU1wbjOEfOZRzTJvfgxFJ43b+xIpbkPIkroVM7cAsMSip6UzvGDfMQ7EIl/JwTkTv/vmZzNLYnmGbKUfWYbgKmgEZufnX0lSSEq7U5Alml657k= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559111452222421.6332770365651; Tue, 28 May 2019 23:30:52 -0700 (PDT) Received: from localhost ([127.0.0.1]:48020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs6S-0001So-Go for importer@patchew.org; Wed, 29 May 2019 02:30:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs4m-0000aI-8R for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVs4l-0004eD-51 for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52058) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVs4k-0004dY-Ck for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:38 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8CC66307E051; Wed, 29 May 2019 06:28:37 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id C3FEB619BC; Wed, 29 May 2019 06:28:33 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 08B1C17446; Wed, 29 May 2019 08:28:33 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 08:28:24 +0200 Message-Id: <20190529062832.26483-2-kraxel@redhat.com> In-Reply-To: <20190529062832.26483-1-kraxel@redhat.com> References: <20190529062832.26483-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 29 May 2019 06:28:37 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/9] usb: call reset handler before updating state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" That way the device reset handler can see what the before-reset state of the device is. Signed-off-by: Gerd Hoffmann Message-id: 20190522094702.17619-2-kraxel@redhat.com --- hw/usb/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/core.c b/hw/usb/core.c index 8fbd9c7d573b..3ab48a16074b 100644 --- a/hw/usb/core.c +++ b/hw/usb/core.c @@ -87,10 +87,10 @@ void usb_device_reset(USBDevice *dev) if (dev =3D=3D NULL || !dev->attached) { return; } + usb_device_handle_reset(dev); dev->remote_wakeup =3D 0; dev->addr =3D 0; dev->state =3D USB_STATE_DEFAULT; - usb_device_handle_reset(dev); } =20 void usb_wakeup(USBEndpoint *ep, unsigned int stream) --=20 2.18.1 From nobody Sat May 4 12:55:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559111457; cv=none; d=zoho.com; s=zohoarc; b=Qr7uUA2aPJjVVtni0mNKQdLazumoE0Ymp+Ypolj6RlzzUykWYdKLuo6wgztZz1BK8Htss0N06wltHPAyY2sHTqJPoRFxcEhnb0WTz6UwCzX6sQa3pwQcWJEkVGl159kLxcv9vEdLQQhtiCkZh81hFx/ivMU5x5oEcXBTwF5BsXk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559111457; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=YeKWJvyMthw2xJU61QCsdlrEMYaLFsFKJZhrEqgQlxc=; b=DbQADUVia+XE09b34aCFPSt0zsD86n8azkSLM1BFKVrkhpGsL3ZSf/vf0KQDSHVBaZd52Xf75An9xm3SosDSDnezfn0Ti2AwrxwP6du+3dcDt7QOoyv3Z1mUGan86KexdvE4T+AQ4yurR6pApKOuNXUinyMeX+kbUAQVRjml0Nc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 155911145730370.92414954509013; Tue, 28 May 2019 23:30:57 -0700 (PDT) Received: from localhost ([127.0.0.1]:48018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs6R-0001SC-J6 for importer@patchew.org; Wed, 29 May 2019 02:30:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs4m-0000aH-8E for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVs4l-0004e1-2l for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33452) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVs4k-0004dQ-An for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:38 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1B0D33082E25; Wed, 29 May 2019 06:28:37 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id C60071972C; Wed, 29 May 2019 06:28:33 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 10B3B17472; Wed, 29 May 2019 08:28:33 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 08:28:25 +0200 Message-Id: <20190529062832.26483-3-kraxel@redhat.com> In-Reply-To: <20190529062832.26483-1-kraxel@redhat.com> References: <20190529062832.26483-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 29 May 2019 06:28:37 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/9] usb-host: skip reset for untouched devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" If the guest didn't talk to the device yet, skip the reset. Without this usb-host devices get resetted a number of times at boot time for no good reason. Signed-off-by: Gerd Hoffmann Message-id: 20190522094702.17619-3-kraxel@redhat.com --- hw/usb/host-libusb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 67b7465915f5..4e9a45a5d26f 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -1459,6 +1459,9 @@ static void usb_host_handle_reset(USBDevice *udev) if (!s->allow_guest_reset) { return; } + if (udev->addr =3D=3D 0) { + return; + } =20 trace_usb_host_reset(s->bus_num, s->addr); =20 --=20 2.18.1 From nobody Sat May 4 12:55:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559112429; cv=none; d=zoho.com; s=zohoarc; b=YE/Z7oLXYS09u0ZGj6ENyBuySnm+8rQaxp2OzqyykMecuWopq7dPWuGsdHlQfV4SgpEO6QVjissi0wFL1p+qucJlAfwqFnN6TSXmwb46SX7CcmlqpKMzOjWnZyazM+URcTFvERzMaOeLiQHKHnHzfCi9/RaVwjYGx52jsYVE2tA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559112429; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=haUPkBaCdXSgFukT0WUcoTmDAe92eqv6F1Pyr9yPE04=; b=iUFi2tyKHF/WxH0rSstFqfH00UDl4Jpmbbn4YPIU+G569QFaZBoXZcpbdCaiBJ4Z8DRkkJAhB4sI6JQaxmBi0pBFReUncNXf3Os045kcqctUxxiapSdiFK0NKi2lQnWuSk+uYlcssHP5IAai1ILfCSxyRJ+XYffl0yvtk2CIAWc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559112429009594.8584784326014; Tue, 28 May 2019 23:47:09 -0700 (PDT) Received: from localhost ([127.0.0.1]:48022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs6U-0001UO-F9 for importer@patchew.org; Wed, 29 May 2019 02:30:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs4m-0000aK-EH for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVs4l-0004eR-EW for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48360) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVs4k-0004dg-S5 for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:39 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD9963082B5A; Wed, 29 May 2019 06:28:37 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8D4064028; Wed, 29 May 2019 06:28:33 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 18A8417512; Wed, 29 May 2019 08:28:33 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 08:28:26 +0200 Message-Id: <20190529062832.26483-4-kraxel@redhat.com> In-Reply-To: <20190529062832.26483-1-kraxel@redhat.com> References: <20190529062832.26483-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 29 May 2019 06:28:37 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/9] usb-host: avoid libusb_set_configuration calls X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Seems some devices become confused when we call libusb_set_configuration(). So before calling the function check whenever the device has multiple configurations in the first place, and in case it hasn't (which is the case for the majority of devices) simply skip the call as it will have no effect anyway. Signed-off-by: Gerd Hoffmann Message-id: 20190522094702.17619-4-kraxel@redhat.com --- hw/usb/host-libusb.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 4e9a45a5d26f..4f765d7f9a2f 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -1225,19 +1225,21 @@ static void usb_host_set_address(USBHostDevice *s, = int addr) =20 static void usb_host_set_config(USBHostDevice *s, int config, USBPacket *p) { - int rc; + int rc =3D 0; =20 trace_usb_host_set_config(s->bus_num, s->addr, config); =20 usb_host_release_interfaces(s); - rc =3D libusb_set_configuration(s->dh, config); - if (rc !=3D 0) { - usb_host_libusb_error("libusb_set_configuration", rc); - p->status =3D USB_RET_STALL; - if (rc =3D=3D LIBUSB_ERROR_NO_DEVICE) { - usb_host_nodev(s); + if (s->ddesc.bNumConfigurations !=3D 1) { + rc =3D libusb_set_configuration(s->dh, config); + if (rc !=3D 0) { + usb_host_libusb_error("libusb_set_configuration", rc); + p->status =3D USB_RET_STALL; + if (rc =3D=3D LIBUSB_ERROR_NO_DEVICE) { + usb_host_nodev(s); + } + return; } - return; } p->status =3D usb_host_claim_interfaces(s, config); if (p->status !=3D USB_RET_SUCCESS) { --=20 2.18.1 From nobody Sat May 4 12:55:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559111619; cv=none; d=zoho.com; s=zohoarc; b=mDk2e16XoV1MqSFBKQdWFXSIQAN+0Hv1wIiwS9P7Yf6umI82/1UAkPgTlPFr1Q/AN2hbMZkzZefEp7jNVQ3+mjSzjytKh0BODD6BpmcNmvh7aX2dHiNpogq6jg+hZTzUcczjBgBjSpIDewXzViov0ZOqc6J1P1itagKZA1OHPsI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559111619; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=zZfibv/hsP1Zty1zU8pqW+hOsB5x9uJbgXqk+4b3pW8=; b=c1OXvZkl5TsARNCMTx2h5OFnGTFWMrLgFJ1z7lzPaa19nmKS/5/WO3jhvZMI9sDfSlZ9w5UFHRpy9PYkqsPn25acA+X/O5lDRsP4mtXlHbWzLislZ0pCktxF5hLOuf4syK/M4TtzJe4wSmKOjMaYcvH+Ylsv9Lv4wdAZABRMhtw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155911161956128.233263078269033; Tue, 28 May 2019 23:33:39 -0700 (PDT) Received: from localhost ([127.0.0.1]:48072 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs9X-0003OZ-JV for importer@patchew.org; Wed, 29 May 2019 02:33:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs4m-0000aJ-8H for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVs4l-0004eA-4t for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46424) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVs4k-0004dU-Cj for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:38 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 708753D37; Wed, 29 May 2019 06:28:37 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0A9C1001DDD; Wed, 29 May 2019 06:28:33 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 20EF017524; Wed, 29 May 2019 08:28:33 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 08:28:27 +0200 Message-Id: <20190529062832.26483-5-kraxel@redhat.com> In-Reply-To: <20190529062832.26483-1-kraxel@redhat.com> References: <20190529062832.26483-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 29 May 2019 06:28:37 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/9] usb-hub: tweak feature names X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Add dashes, so they don't look like two separate things when printed. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20190524070310.4952-2-kraxel@redhat.com --- hw/usb/dev-hub.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 7e9339b8a83d..9b04b6a6ec2d 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -287,11 +287,11 @@ static const char *feature_name(int feature) [PORT_POWER] =3D "power", [PORT_LOWSPEED] =3D "lowspeed", [PORT_HIGHSPEED] =3D "highspeed", - [PORT_C_CONNECTION] =3D "change connection", - [PORT_C_ENABLE] =3D "change enable", - [PORT_C_SUSPEND] =3D "change suspend", - [PORT_C_OVERCURRENT] =3D "change overcurrent", - [PORT_C_RESET] =3D "change reset", + [PORT_C_CONNECTION] =3D "change-connection", + [PORT_C_ENABLE] =3D "change-enable", + [PORT_C_SUSPEND] =3D "change-suspend", + [PORT_C_OVERCURRENT] =3D "change-overcurrent", + [PORT_C_RESET] =3D "change-reset", [PORT_TEST] =3D "test", [PORT_INDICATOR] =3D "indicator", }; --=20 2.18.1 From nobody Sat May 4 12:55:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559111930; cv=none; d=zoho.com; s=zohoarc; b=C+vP3Vd2JzmBy5/ik8JGTOAZigzdo/233+Za2aNJ8cPAKKo0wEw4kvFWALjbYf30DzEtt8pfifuZcu4+4qjdqScrk1G5pqqZREzkMvNVwipY/dCKdaCP/s3qc+OVY7enDzvRLWGXLUdGtgfmgW63KoJuP64wzf9JWOyB/F4A+Y8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559111930; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=w002kDnb6IhIq2RlLAORj0k6Ck0En8tS6KWIuMYYS90=; b=QP0rF2Du/YZHwhIs1THamg3gav1nV28sPGut2DvmUJ3XaMuKChUBTKyswyXq6+oLOn1+YAoAN45DQcWkYftAk8ur5IRiFZ/7/5hxG9eQiv42sTYTBWZealQgd10uttSUgs6Agh+6cr6KiKoF/Flwc59xWmRf7zZMZppPOccscI8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559111930296143.68861289430356; Tue, 28 May 2019 23:38:50 -0700 (PDT) Received: from localhost ([127.0.0.1]:48150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsEb-0007Tx-AI for importer@patchew.org; Wed, 29 May 2019 02:38:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs4q-0000cg-HU for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVs4o-0004gm-H9 for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60338) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVs4o-0004ft-AS for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:42 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 09D425857F; Wed, 29 May 2019 06:28:41 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8DB561B65; Wed, 29 May 2019 06:28:37 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 294591752B; Wed, 29 May 2019 08:28:33 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 08:28:28 +0200 Message-Id: <20190529062832.26483-6-kraxel@redhat.com> In-Reply-To: <20190529062832.26483-1-kraxel@redhat.com> References: <20190529062832.26483-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 29 May 2019 06:28:41 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/9] usb-hub: make number of ports runtime-configurable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add num_ports property which allows configure the number of downstream ports. Valid range is 1-8, default is 8. Signed-off-by: Gerd Hoffmann Message-id: 20190524070310.4952-3-kraxel@redhat.com --- hw/usb/dev-hub.c | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 9b04b6a6ec2d..4f700c8f92b5 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -29,7 +29,7 @@ #include "desc.h" #include "qemu/error-report.h" =20 -#define NUM_PORTS 8 +#define MAX_PORTS 8 =20 typedef struct USBHubPort { USBPort port; @@ -40,7 +40,8 @@ typedef struct USBHubPort { typedef struct USBHubState { USBDevice dev; USBEndpoint *intr; - USBHubPort ports[NUM_PORTS]; + uint32_t num_ports; + USBHubPort ports[MAX_PORTS]; } USBHubState; =20 #define TYPE_USB_HUB "usb-hub" @@ -109,7 +110,7 @@ static const USBDescIface desc_iface_hub =3D { { .bEndpointAddress =3D USB_DIR_IN | 0x01, .bmAttributes =3D USB_ENDPOINT_XFER_INT, - .wMaxPacketSize =3D 1 + DIV_ROUND_UP(NUM_PORTS, 8), + .wMaxPacketSize =3D 1 + DIV_ROUND_UP(MAX_PORTS, 8), .bInterval =3D 0xff, }, } @@ -242,7 +243,7 @@ static USBDevice *usb_hub_find_device(USBDevice *dev, u= int8_t addr) USBDevice *downstream; int i; =20 - for (i =3D 0; i < NUM_PORTS; i++) { + for (i =3D 0; i < s->num_ports; i++) { port =3D &s->ports[i]; if (!(port->wPortStatus & PORT_STAT_ENABLE)) { continue; @@ -262,7 +263,7 @@ static void usb_hub_handle_reset(USBDevice *dev) int i; =20 trace_usb_hub_reset(s->dev.addr); - for (i =3D 0; i < NUM_PORTS; i++) { + for (i =3D 0; i < s->num_ports; i++) { port =3D s->ports + i; port->wPortStatus =3D PORT_STAT_POWER; port->wPortChange =3D 0; @@ -332,7 +333,7 @@ static void usb_hub_handle_control(USBDevice *dev, USBP= acket *p, { unsigned int n =3D index - 1; USBHubPort *port; - if (n >=3D NUM_PORTS) { + if (n >=3D s->num_ports) { goto fail; } port =3D &s->ports[n]; @@ -361,7 +362,7 @@ static void usb_hub_handle_control(USBDevice *dev, USBP= acket *p, trace_usb_hub_set_port_feature(s->dev.addr, index, feature_name(value)); =20 - if (n >=3D NUM_PORTS) { + if (n >=3D s->num_ports) { goto fail; } port =3D &s->ports[n]; @@ -394,7 +395,7 @@ static void usb_hub_handle_control(USBDevice *dev, USBP= acket *p, trace_usb_hub_clear_port_feature(s->dev.addr, index, feature_name(value)); =20 - if (n >=3D NUM_PORTS) { + if (n >=3D s->num_ports) { goto fail; } port =3D &s->ports[n]; @@ -443,17 +444,17 @@ static void usb_hub_handle_control(USBDevice *dev, US= BPacket *p, unsigned int n, limit, var_hub_size =3D 0; memcpy(data, qemu_hub_hub_descriptor, sizeof(qemu_hub_hub_descriptor)); - data[2] =3D NUM_PORTS; + data[2] =3D s->num_ports; =20 /* fill DeviceRemovable bits */ - limit =3D DIV_ROUND_UP(NUM_PORTS + 1, 8) + 7; + limit =3D DIV_ROUND_UP(s->num_ports + 1, 8) + 7; for (n =3D 7; n < limit; n++) { data[n] =3D 0x00; var_hub_size++; } =20 /* fill PortPwrCtrlMask bits */ - limit =3D limit + DIV_ROUND_UP(NUM_PORTS, 8); + limit =3D limit + DIV_ROUND_UP(s->num_ports, 8); for (;n < limit; n++) { data[n] =3D 0xff; var_hub_size++; @@ -481,7 +482,7 @@ static void usb_hub_handle_data(USBDevice *dev, USBPack= et *p) unsigned int status; uint8_t buf[4]; int i, n; - n =3D DIV_ROUND_UP(NUM_PORTS + 1, 8); + n =3D DIV_ROUND_UP(s->num_ports + 1, 8); if (p->iov.size =3D=3D 1) { /* FreeBSD workaround */ n =3D 1; } else if (n > p->iov.size) { @@ -489,7 +490,7 @@ static void usb_hub_handle_data(USBDevice *dev, USBPack= et *p) return; } status =3D 0; - for(i =3D 0; i < NUM_PORTS; i++) { + for (i =3D 0; i < s->num_ports; i++) { port =3D &s->ports[i]; if (port->wPortChange) status |=3D (1 << (i + 1)); @@ -520,7 +521,7 @@ static void usb_hub_unrealize(USBDevice *dev, Error **e= rrp) USBHubState *s =3D (USBHubState *)dev; int i; =20 - for (i =3D 0; i < NUM_PORTS; i++) { + for (i =3D 0; i < s->num_ports; i++) { usb_unregister_port(usb_bus_from_device(dev), &s->ports[i].port); } @@ -540,6 +541,12 @@ static void usb_hub_realize(USBDevice *dev, Error **er= rp) USBHubPort *port; int i; =20 + if (s->num_ports < 1 || s->num_ports > MAX_PORTS) { + error_setg(errp, "num_ports (%d) out of range (1..%d)", + s->num_ports, MAX_PORTS); + return; + } + if (dev->port->hubcount =3D=3D 5) { error_setg(errp, "usb hub chain too deep"); return; @@ -548,7 +555,7 @@ static void usb_hub_realize(USBDevice *dev, Error **err= p) usb_desc_create_serial(dev); usb_desc_init(dev); s->intr =3D usb_ep_get(dev, USB_TOKEN_IN, 1); - for (i =3D 0; i < NUM_PORTS; i++) { + for (i =3D 0; i < s->num_ports; i++) { port =3D &s->ports[i]; usb_register_port(usb_bus_from_device(dev), &port->port, s, i, &usb_hub_port_ops, @@ -575,12 +582,17 @@ static const VMStateDescription vmstate_usb_hub =3D { .minimum_version_id =3D 1, .fields =3D (VMStateField[]) { VMSTATE_USB_DEVICE(dev, USBHubState), - VMSTATE_STRUCT_ARRAY(ports, USBHubState, NUM_PORTS, 0, + VMSTATE_STRUCT_ARRAY(ports, USBHubState, MAX_PORTS, 0, vmstate_usb_hub_port, USBHubPort), VMSTATE_END_OF_LIST() } }; =20 +static Property usb_hub_properties[] =3D { + DEFINE_PROP_UINT32("ports", USBHubState, num_ports, 8), + DEFINE_PROP_END_OF_LIST(), +}; + static void usb_hub_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -597,6 +609,7 @@ static void usb_hub_class_initfn(ObjectClass *klass, vo= id *data) set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name =3D "hub"; dc->vmsd =3D &vmstate_usb_hub; + dc->props =3D usb_hub_properties; } =20 static const TypeInfo hub_info =3D { --=20 2.18.1 From nobody Sat May 4 12:55:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559111803; cv=none; d=zoho.com; s=zohoarc; b=S+XdIZbjY+AE3XaTTASDRRhwp7a2/M2zeqX5wjHraxKaj4e7eSx+953Pb4B/L9FLpKeZjNLGJLC7+GtEqGOZpnRxgr423kKHP9er789bRJohvVUWCMt38ojkANIns2j9tSlAYQWALu9YyBCGPFMyQX1OiaMUqBNnYV05f+7xmq0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559111803; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Cqoi6F75DLxcpH6QWu68MPXD7JKtH7QVqDY6LNNy8dA=; b=SsCrGBqpvGfR9/HYI+MCskc/eUHh8Ts3Q3pmQZo5H1reObMG298CVHBAuNNJGrKXgd8poCL108aHZV4rAfZbD7sYlxb19tqSNece7gWkqP1BblMlogg4n7EXycSQCS8uw0Ck/fILvfY6Bkch0Cy+LUaN6HW+pUIiUzpHnGadVD0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559111803835512.4106666294997; Tue, 28 May 2019 23:36:43 -0700 (PDT) Received: from localhost ([127.0.0.1]:48130 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsBv-0005XU-0O for importer@patchew.org; Wed, 29 May 2019 02:36:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs4o-0000an-Ay for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVs4m-0004ez-0R for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47488) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVs4l-0004dp-FM for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:39 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 533533179177; Wed, 29 May 2019 06:28:38 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA9E769193; Wed, 29 May 2019 06:28:37 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3188E17532; Wed, 29 May 2019 08:28:33 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 08:28:29 +0200 Message-Id: <20190529062832.26483-7-kraxel@redhat.com> In-Reply-To: <20190529062832.26483-1-kraxel@redhat.com> References: <20190529062832.26483-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 29 May 2019 06:28:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 6/9] usb-hub: add helpers to update port state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add usb_hub_port_set() and usb_hub_port_clear() helpers which care about updating the change bits (port->wPortChange) properly, so we don't need to have that logic sprinkled all over the place ;) Signed-off-by: Gerd Hoffmann Message-id: 20190524070310.4952-4-kraxel@redhat.com --- hw/usb/dev-hub.c | 84 ++++++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 39 deletions(-) diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 4f700c8f92b5..1cc92a5f9abe 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -159,18 +159,46 @@ static const uint8_t qemu_hub_hub_descriptor[] =3D /* DeviceRemovable and PortPwrCtrlMask patched in later */ }; =20 +static bool usb_hub_port_change(USBHubPort *port, uint16_t status) +{ + bool notify =3D false; + + if (status & 0x1f) { + port->wPortChange |=3D status; + notify =3D true; + } + return notify; +} + +static bool usb_hub_port_set(USBHubPort *port, uint16_t status) +{ + if (port->wPortStatus & status) { + return false; + } + port->wPortStatus |=3D status; + return usb_hub_port_change(port, status); +} + +static bool usb_hub_port_clear(USBHubPort *port, uint16_t status) +{ + if (!(port->wPortStatus & status)) { + return false; + } + port->wPortStatus &=3D ~status; + return usb_hub_port_change(port, status); +} + static void usb_hub_attach(USBPort *port1) { USBHubState *s =3D port1->opaque; USBHubPort *port =3D &s->ports[port1->index]; =20 trace_usb_hub_attach(s->dev.addr, port1->index + 1); - port->wPortStatus |=3D PORT_STAT_CONNECTION; - port->wPortChange |=3D PORT_STAT_C_CONNECTION; + usb_hub_port_set(port, PORT_STAT_CONNECTION); if (port->port.dev->speed =3D=3D USB_SPEED_LOW) { - port->wPortStatus |=3D PORT_STAT_LOW_SPEED; + usb_hub_port_set(port, PORT_STAT_LOW_SPEED); } else { - port->wPortStatus &=3D ~PORT_STAT_LOW_SPEED; + usb_hub_port_clear(port, PORT_STAT_LOW_SPEED); } usb_wakeup(s->intr, 0); } @@ -186,16 +214,9 @@ static void usb_hub_detach(USBPort *port1) /* Let upstream know the device on this port is gone */ s->dev.port->ops->child_detach(s->dev.port, port1->dev); =20 - port->wPortStatus &=3D ~PORT_STAT_CONNECTION; - port->wPortChange |=3D PORT_STAT_C_CONNECTION; - if (port->wPortStatus & PORT_STAT_ENABLE) { - port->wPortStatus &=3D ~PORT_STAT_ENABLE; - port->wPortChange |=3D PORT_STAT_C_ENABLE; - } - if (port->wPortStatus & PORT_STAT_SUSPEND) { - port->wPortStatus &=3D ~PORT_STAT_SUSPEND; - port->wPortChange |=3D PORT_STAT_C_SUSPEND; - } + usb_hub_port_clear(port, PORT_STAT_CONNECTION); + usb_hub_port_clear(port, PORT_STAT_ENABLE); + usb_hub_port_clear(port, PORT_STAT_SUSPEND); usb_wakeup(s->intr, 0); } =20 @@ -212,9 +233,7 @@ static void usb_hub_wakeup(USBPort *port1) USBHubState *s =3D port1->opaque; USBHubPort *port =3D &s->ports[port1->index]; =20 - if (port->wPortStatus & PORT_STAT_SUSPEND) { - port->wPortStatus &=3D ~PORT_STAT_SUSPEND; - port->wPortChange |=3D PORT_STAT_C_SUSPEND; + if (usb_hub_port_clear(port, PORT_STAT_SUSPEND)) { usb_wakeup(s->intr, 0); } } @@ -265,13 +284,13 @@ static void usb_hub_handle_reset(USBDevice *dev) trace_usb_hub_reset(s->dev.addr); for (i =3D 0; i < s->num_ports; i++) { port =3D s->ports + i; - port->wPortStatus =3D PORT_STAT_POWER; + port->wPortStatus =3D 0; port->wPortChange =3D 0; + usb_hub_port_set(port, PORT_STAT_POWER); if (port->port.dev && port->port.dev->attached) { - port->wPortStatus |=3D PORT_STAT_CONNECTION; - port->wPortChange |=3D PORT_STAT_C_CONNECTION; + usb_hub_port_set(port, PORT_STAT_CONNECTION); if (port->port.dev->speed =3D=3D USB_SPEED_LOW) { - port->wPortStatus |=3D PORT_STAT_LOW_SPEED; + usb_hub_port_set(port, PORT_STAT_LOW_SPEED); } } } @@ -372,13 +391,13 @@ static void usb_hub_handle_control(USBDevice *dev, US= BPacket *p, port->wPortStatus |=3D PORT_STAT_SUSPEND; break; case PORT_RESET: + usb_hub_port_set(port, PORT_STAT_RESET); + usb_hub_port_clear(port, PORT_STAT_RESET); if (dev && dev->attached) { usb_device_reset(dev); - port->wPortChange |=3D PORT_STAT_C_RESET; - /* set enable bit */ - port->wPortStatus |=3D PORT_STAT_ENABLE; - usb_wakeup(s->intr, 0); + usb_hub_port_set(port, PORT_STAT_ENABLE); } + usb_wakeup(s->intr, 0); break; case PORT_POWER: break; @@ -407,20 +426,7 @@ static void usb_hub_handle_control(USBDevice *dev, USB= Packet *p, port->wPortChange &=3D ~PORT_STAT_C_ENABLE; break; case PORT_SUSPEND: - if (port->wPortStatus & PORT_STAT_SUSPEND) { - port->wPortStatus &=3D ~PORT_STAT_SUSPEND; - - /* - * USB Spec rev2.0 11.24.2.7.2.3 C_PORT_SUSPEND - * "This bit is set on the following transitions: - * - On transition from the Resuming state to the - * SendEOP [sic] state" - * - * Note that this includes both remote wake-up and - * explicit ClearPortFeature(PORT_SUSPEND). - */ - port->wPortChange |=3D PORT_STAT_C_SUSPEND; - } + usb_hub_port_clear(port, PORT_STAT_SUSPEND); break; case PORT_C_SUSPEND: port->wPortChange &=3D ~PORT_STAT_C_SUSPEND; --=20 2.18.1 From nobody Sat May 4 12:55:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559111619; cv=none; d=zoho.com; s=zohoarc; b=VpKKuu7tPkSDlwC8mtuag4yZRRAiXbAKaB1cV+tm/Japn0yAwepT0gGV09TV134bVUTOKwdtgSPGJKuAOXVSk9ZAymxnGdvpCRunNEtxBI/lUgY2PTT7JEu9PGNA+KynrwmjHBPsuVlk3zb9EU7oJqzRyFCKJqCpItLgs1S0OXU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559111619; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=DQIMC5Mpa8xdrRXeykZRCjyjydfoHu0QezzVYUG7iXk=; b=UtpzhaBWmb2WWf7EMSWdxu/SsYzpGa5+UH6tTW6yvLgCYl4HHm8RT0ADFtqBULHVGfpuP66YLO19P5NoPIpzfRin45kZNGjip2s8/yDHg0RYTCtnzNNuLhhE4W8ueONrVvvJMMvBuvX0gdUYBCGErpEm7cIBVOh4D2XZgy/zqM4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559111619559660.4145444293157; Tue, 28 May 2019 23:33:39 -0700 (PDT) Received: from localhost ([127.0.0.1]:48070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs9W-0003Nl-Km for importer@patchew.org; Wed, 29 May 2019 02:33:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs4o-0000ao-Az for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVs4m-0004eu-0H for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60314) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVs4l-0004dt-G8 for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:39 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 74F6F59450; Wed, 29 May 2019 06:28:38 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A7181001DDD; Wed, 29 May 2019 06:28:38 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 398A317534; Wed, 29 May 2019 08:28:33 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 08:28:30 +0200 Message-Id: <20190529062832.26483-8-kraxel@redhat.com> In-Reply-To: <20190529062832.26483-1-kraxel@redhat.com> References: <20190529062832.26483-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 29 May 2019 06:28:38 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 7/9] usb-hub: add usb_hub_port_update() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Helper function to update port status bits which depends on the connected device. We need the same logic for device attach and port reset, so factor it out. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20190524070310.4952-5-kraxel@redhat.com --- hw/usb/dev-hub.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 1cc92a5f9abe..29f4d6723e26 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -188,18 +188,28 @@ static bool usb_hub_port_clear(USBHubPort *port, uint= 16_t status) return usb_hub_port_change(port, status); } =20 +static bool usb_hub_port_update(USBHubPort *port) +{ + bool notify =3D false; + + if (port->port.dev && port->port.dev->attached) { + notify =3D usb_hub_port_set(port, PORT_STAT_CONNECTION); + if (port->port.dev->speed =3D=3D USB_SPEED_LOW) { + usb_hub_port_set(port, PORT_STAT_LOW_SPEED); + } else { + usb_hub_port_clear(port, PORT_STAT_LOW_SPEED); + } + } + return notify; +} + static void usb_hub_attach(USBPort *port1) { USBHubState *s =3D port1->opaque; USBHubPort *port =3D &s->ports[port1->index]; =20 trace_usb_hub_attach(s->dev.addr, port1->index + 1); - usb_hub_port_set(port, PORT_STAT_CONNECTION); - if (port->port.dev->speed =3D=3D USB_SPEED_LOW) { - usb_hub_port_set(port, PORT_STAT_LOW_SPEED); - } else { - usb_hub_port_clear(port, PORT_STAT_LOW_SPEED); - } + usb_hub_port_update(port); usb_wakeup(s->intr, 0); } =20 @@ -287,12 +297,7 @@ static void usb_hub_handle_reset(USBDevice *dev) port->wPortStatus =3D 0; port->wPortChange =3D 0; usb_hub_port_set(port, PORT_STAT_POWER); - if (port->port.dev && port->port.dev->attached) { - usb_hub_port_set(port, PORT_STAT_CONNECTION); - if (port->port.dev->speed =3D=3D USB_SPEED_LOW) { - usb_hub_port_set(port, PORT_STAT_LOW_SPEED); - } - } + usb_hub_port_update(port); } } =20 --=20 2.18.1 From nobody Sat May 4 12:55:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559111865; cv=none; d=zoho.com; s=zohoarc; b=I9Gb9w9xHeRkWiaGt4rO27BMvdvdBKSL8BC4Qw8MNJYig7OIK50Yu6knS3+srFdPlbMBoKe83gR8yHHT8OoCtfAw1QHc7dMS4+E5qJOkUpqFY7RSpqGufJxaxlc3G80iUNn8Ny3zreECJcZdJdhEvWK/grdRofI6xfz3nFNEtyA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559111865; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=IbzsQUjEGeJiH74rUBBG663huD/FlWu0IjSV/JifhPM=; b=n/wNrSsvRGxEzjXdDW8H60m2L86vrRGz2x5cklFiF5jIR4qWKUwWuRou8LwgFNAakqPkfYHGJxzk6vSoZ1E/5AkG3/06f5MeE4NSrj6Ktuf7bF/Wx3zytTeWGzEf8PliUrkWraXBJCIx1xZlsUh9sx39mhIdDfhmMkh2ynrNrFQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559111865139816.4049637546261; Tue, 28 May 2019 23:37:45 -0700 (PDT) Received: from localhost ([127.0.0.1]:48144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsDV-0006rx-8j for importer@patchew.org; Wed, 29 May 2019 02:37:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs4q-0000ck-Hf for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVs4o-0004gt-I4 for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53476) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVs4o-0004fw-BT for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:42 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 154AD7E423; Wed, 29 May 2019 06:28:41 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CF9E61B66; Wed, 29 May 2019 06:28:38 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 41B7D17535; Wed, 29 May 2019 08:28:33 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 08:28:31 +0200 Message-Id: <20190529062832.26483-9-kraxel@redhat.com> In-Reply-To: <20190529062832.26483-1-kraxel@redhat.com> References: <20190529062832.26483-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 29 May 2019 06:28:41 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 8/9] usb-hub: emulate per port power switching X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add support for per port power switching. Virtual power of course ;) Use port-power=3Don property to enable this. Signed-off-by: Gerd Hoffmann Message-id: 20190524070310.4952-6-kraxel@redhat.com --- hw/usb/dev-hub.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 29f4d6723e26..2b64d6ef0349 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "qemu/timer.h" #include "trace.h" #include "hw/usb.h" #include "desc.h" @@ -41,6 +42,8 @@ typedef struct USBHubState { USBDevice dev; USBEndpoint *intr; uint32_t num_ports; + bool port_power; + QEMUTimer *port_timer; USBHubPort ports[MAX_PORTS]; } USBHubState; =20 @@ -203,6 +206,20 @@ static bool usb_hub_port_update(USBHubPort *port) return notify; } =20 +static void usb_hub_port_update_timer(void *opaque) +{ + USBHubState *s =3D opaque; + bool notify =3D false; + int i; + + for (i =3D 0; i < s->num_ports; i++) { + notify |=3D usb_hub_port_update(&s->ports[i]); + } + if (notify) { + usb_wakeup(s->intr, 0); + } +} + static void usb_hub_attach(USBPort *port1) { USBHubState *s =3D port1->opaque; @@ -405,6 +422,11 @@ static void usb_hub_handle_control(USBDevice *dev, USB= Packet *p, usb_wakeup(s->intr, 0); break; case PORT_POWER: + if (s->port_power) { + int64_t now =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + usb_hub_port_set(port, PORT_STAT_POWER); + timer_mod(s->port_timer, now + 5000000); /* 5 ms */ + } break; default: goto fail; @@ -445,6 +467,14 @@ static void usb_hub_handle_control(USBDevice *dev, USB= Packet *p, case PORT_C_RESET: port->wPortChange &=3D ~PORT_STAT_C_RESET; break; + case PORT_POWER: + if (s->port_power) { + usb_hub_port_clear(port, PORT_STAT_POWER); + usb_hub_port_clear(port, PORT_STAT_CONNECTION); + usb_hub_port_clear(port, PORT_STAT_ENABLE); + usb_hub_port_clear(port, PORT_STAT_SUSPEND); + port->wPortChange =3D 0; + } default: goto fail; } @@ -457,6 +487,11 @@ static void usb_hub_handle_control(USBDevice *dev, USB= Packet *p, sizeof(qemu_hub_hub_descriptor)); data[2] =3D s->num_ports; =20 + if (s->port_power) { + data[3] &=3D ~0x03; + data[3] |=3D 0x01; + } + /* fill DeviceRemovable bits */ limit =3D DIV_ROUND_UP(s->num_ports + 1, 8) + 7; for (n =3D 7; n < limit; n++) { @@ -536,6 +571,9 @@ static void usb_hub_unrealize(USBDevice *dev, Error **e= rrp) usb_unregister_port(usb_bus_from_device(dev), &s->ports[i].port); } + + timer_del(s->port_timer); + timer_free(s->port_timer); } =20 static USBPortOps usb_hub_port_ops =3D { @@ -565,6 +603,8 @@ static void usb_hub_realize(USBDevice *dev, Error **err= p) =20 usb_desc_create_serial(dev); usb_desc_init(dev); + s->port_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, + usb_hub_port_update_timer, s); s->intr =3D usb_ep_get(dev, USB_TOKEN_IN, 1); for (i =3D 0; i < s->num_ports; i++) { port =3D &s->ports[i]; @@ -587,6 +627,24 @@ static const VMStateDescription vmstate_usb_hub_port = =3D { } }; =20 +static bool usb_hub_port_timer_needed(void *opaque) +{ + USBHubState *s =3D opaque; + + return s->port_power; +} + +static const VMStateDescription vmstate_usb_hub_port_timer =3D { + .name =3D "usb-hub/port-timer", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D usb_hub_port_timer_needed, + .fields =3D (VMStateField[]) { + VMSTATE_TIMER_PTR(port_timer, USBHubState), + VMSTATE_END_OF_LIST() + }, +}; + static const VMStateDescription vmstate_usb_hub =3D { .name =3D "usb-hub", .version_id =3D 1, @@ -596,11 +654,16 @@ static const VMStateDescription vmstate_usb_hub =3D { VMSTATE_STRUCT_ARRAY(ports, USBHubState, MAX_PORTS, 0, vmstate_usb_hub_port, USBHubPort), VMSTATE_END_OF_LIST() + }, + .subsections =3D (const VMStateDescription * []) { + &vmstate_usb_hub_port_timer, + NULL } }; =20 static Property usb_hub_properties[] =3D { DEFINE_PROP_UINT32("ports", USBHubState, num_ports, 8), + DEFINE_PROP_BOOL("port-power", USBHubState, port_power, false), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.18.1 From nobody Sat May 4 12:55:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559111775; cv=none; d=zoho.com; s=zohoarc; b=KCfQhWeBDnSxnJ4TJ3LqLgihbuZhYwJhtHWPFbZ8TOibmuj0bphdpO4t3PBT8puMkO44q375j/RN8in2uEb0DZ8X0gJb7Ox+e6PRwPPrGb2Mk+i/WVxxt160IAol/Boa/8AFSx1wrXJpXx47b5IE2FZkFd7XYCF0LLSO7gcKdto= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559111775; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=6xpaiMPTiBlE3M/CW/RIBYOXn7CqVtqIVuMwxMHm0uQ=; b=gVBSFIadOzgE4tzDGBshQLfv6Xt1RSEV84hXobIgW1vsbqDIjeZrIIKUAk05ijE1z6Vk3+GuJpfxRPj1rrNi4B4zvccqhrqjITTUx5a3d9qP7fPWibKKWKtpDcBzjZ0c4jZysudmUh164mrodKPSU75jkVyPkuWmavJ5Iq1TXEM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 15591117759271019.45728546446; Tue, 28 May 2019 23:36:15 -0700 (PDT) Received: from localhost ([127.0.0.1]:48128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsBu-0005XP-IL for importer@patchew.org; Wed, 29 May 2019 02:36:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVs4u-0000ge-9N for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVs4o-0004gc-EY for qemu-devel@nongnu.org; Wed, 29 May 2019 02:28:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60334) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVs4o-0004fq-9k; Wed, 29 May 2019 02:28:42 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC38572665; Wed, 29 May 2019 06:28:40 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4DFB218027; Wed, 29 May 2019 06:28:38 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 49CF617536; Wed, 29 May 2019 08:28:33 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 08:28:32 +0200 Message-Id: <20190529062832.26483-10-kraxel@redhat.com> In-Reply-To: <20190529062832.26483-1-kraxel@redhat.com> References: <20190529062832.26483-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 29 May 2019 06:28:41 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 9/9] usb-tablet: fix serial compat property X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Eduardo Habkost , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" s/kbd/tablet/, fixes cut+paste bug. Cc: qemu-stable@nongnu.org Reported-by: Dr. David Alan Gilbert Signed-off-by: Gerd Hoffmann Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20190520081805.15019-1-kraxel@redhat.com --- hw/core/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index 934c1bcceb46..16ba66743441 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -36,7 +36,7 @@ GlobalProperty hw_compat_3_1[] =3D { { "tpm-tis", "ppi", "false" }, { "usb-kbd", "serial", "42" }, { "usb-mouse", "serial", "42" }, - { "usb-kbd", "serial", "42" }, + { "usb-tablet", "serial", "42" }, { "virtio-blk-device", "discard", "false" }, { "virtio-blk-device", "write-zeroes", "false" }, }; --=20 2.18.1