]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
usb: add USBBusOps->wakeup_endpoint
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 20 Jan 2012 12:29:53 +0000 (13:29 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 10 Feb 2012 11:16:30 +0000 (12:16 +0100)
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 <kraxel@redhat.com>
hw/usb.c
hw/usb.h

index 05725474e3142b2666f8e2f971bfad1c51fbe5e3..e5b8f335dc388e7ba00fb50bf9e8b03cbc5f8357 100644 (file)
--- 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);
+    }
 }
 
 /**********************/
index b2caa773459101ed5d39e2d6bdc4a0b9899d802d..4470ea890a2fa61e8861a9a2879b5d1d973b389a 100644 (file)
--- 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);