From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvotB-0005uN-Qx for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rvot9-0000Je-Vz for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvot9-0000JJ-Mh for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:39 -0500 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 (8.14.4/8.14.4) with ESMTP id q1ABhde5012959 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 10 Feb 2012 06:43:39 -0500 From: Gerd Hoffmann Date: Fri, 10 Feb 2012 12:43:18 +0100 Message-Id: <1328874204-20920-23-git-send-email-kraxel@redhat.com> In-Reply-To: <1328874204-20920-1-git-send-email-kraxel@redhat.com> References: <1328874204-20920-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 22/28] usb: add USBBusOps->wakeup_endpoint List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann 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 0572547..e5b8f33 100644 --- a/hw/usb.c +++ b/hw/usb.c @@ -73,10 +73,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 b2caa77..4470ea8 100644 --- a/hw/usb.h +++ b/hw/usb.h @@ -425,6 +425,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); -- 1.7.1