From patchwork Mon Jan 23 14:55:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 137404 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8C8071007D3 for ; Tue, 24 Jan 2012 03:22:24 +1100 (EST) Received: from localhost ([::1]:41288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpLL2-0004MD-FO for incoming@patchwork.ozlabs.org; Mon, 23 Jan 2012 09:57:40 -0500 Received: from eggs.gnu.org ([140.186.70.92]:44737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpLJ1-0007rT-Ay for qemu-devel@nongnu.org; Mon, 23 Jan 2012 09:55:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RpLIv-0004VQ-5P for qemu-devel@nongnu.org; Mon, 23 Jan 2012 09:55:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:65122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpLIu-0004VB-Rr for qemu-devel@nongnu.org; Mon, 23 Jan 2012 09:55:29 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0NEtSeZ012722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Jan 2012 09:55:28 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-58.ams2.redhat.com [10.36.116.58]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q0NEtNW5005211; Mon, 23 Jan 2012 09:55:27 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 9F5EF40F81; Mon, 23 Jan 2012 15:55:13 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 23 Jan 2012 15:55:05 +0100 Message-Id: <1327330511-16307-20-git-send-email-kraxel@redhat.com> In-Reply-To: <1327330511-16307-1-git-send-email-kraxel@redhat.com> References: <1327330511-16307-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 19/25] usb: add USBBusOps->wakeup_endpoint 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 Add usb bus op which is called whenever a usb endpoint becomes ready, so the host adapter emulation can react on that event. Signed-off-by: Gerd Hoffmann --- hw/usb.c | 4 ++++ hw/usb.h | 1 + 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/usb.c b/hw/usb.c index 381558d..2d7088d 100644 --- a/hw/usb.c +++ b/hw/usb.c @@ -77,10 +77,14 @@ void usb_device_reset(USBDevice *dev) void usb_wakeup(USBEndpoint *ep) { USBDevice *dev = ep->dev; + USBBus *bus = usb_bus_from_device(dev); if (dev->remote_wakeup && dev->port && dev->port->ops->wakeup) { dev->port->ops->wakeup(dev->port); } + if (bus->ops->wakeup_endpoint) { + bus->ops->wakeup_endpoint(bus, ep); + } } /**********************/ diff --git a/hw/usb.h b/hw/usb.h index 6b4684f..0dd6b88 100644 --- a/hw/usb.h +++ b/hw/usb.h @@ -419,6 +419,7 @@ struct USBBus { struct USBBusOps { int (*register_companion)(USBBus *bus, USBPort *ports[], uint32_t portcount, uint32_t firstport); + void (*wakeup_endpoint)(USBBus *bus, USBEndpoint *ep); }; void usb_bus_new(USBBus *bus, USBBusOps *ops, DeviceState *host);