From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Gerd Hoffmann 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> Subject: [Qemu-devel] [PATCH 19/25] 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 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); -- 1.7.1