summaryrefslogtreecommitdiff
path: root/hw/usb.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-06-21 11:52:28 +0200
committerGerd Hoffmann <kraxel@redhat.com>2011-07-05 15:09:02 +0200
commitd47e59b8b8adc96a2052f7e004cb12b6ff62edd9 (patch)
tree301cdacdde8bff6220c9405499ea925a92ea7a26 /hw/usb.h
parentae60fea97c78e7f855794f2770517244d93def73 (diff)
downloadqemu-d47e59b8b8adc96a2052f7e004cb12b6ff62edd9.tar.gz
usb: Make port wakeup and complete ops take a USBPort instead of a Device
This makes them consistent with the attach and detach ops, and in general it makes sense to make portops take a port as argument. This also makes adding support for a companion controller easier / cleaner. [ kraxel: fix usb-musb.c build ] Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb.h')
-rw-r--r--hw/usb.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/usb.h b/hw/usb.h
index a5f2efa613..65f45a0ce4 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -252,8 +252,13 @@ struct USBDeviceInfo {
typedef struct USBPortOps {
void (*attach)(USBPort *port);
void (*detach)(USBPort *port);
- void (*wakeup)(USBDevice *dev);
- void (*complete)(USBDevice *dev, USBPacket *p);
+ void (*wakeup)(USBPort *port);
+ /*
+ * Note that port->dev will be different then the device from which
+ * the packet originated when a hub is involved, if you want the orginating
+ * device use p->owner
+ */
+ void (*complete)(USBPort *port, USBPacket *p);
} USBPortOps;
/* USB port on which a device can be connected */