summary refs log tree commit diff stats
path: root/hw/usb-hub.c
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-hub.c
parentae60fea97c78e7f855794f2770517244d93def73 (diff)
downloadfocaccia-qemu-d47e59b8b8adc96a2052f7e004cb12b6ff62edd9.tar.gz
focaccia-qemu-d47e59b8b8adc96a2052f7e004cb12b6ff62edd9.zip
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-hub.c')
-rw-r--r--hw/usb-hub.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 6e2a35839d..d324bbad8e 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -246,10 +246,10 @@ static void usb_hub_detach(USBPort *port1)
     }
 }
 
-static void usb_hub_wakeup(USBDevice *dev)
+static void usb_hub_wakeup(USBPort *port1)
 {
-    USBHubState *s = dev->port->opaque;
-    USBHubPort *port = &s->ports[dev->port->index];
+    USBHubState *s = port1->opaque;
+    USBHubPort *port = &s->ports[port1->index];
 
     if (port->wPortStatus & PORT_STAT_SUSPEND) {
         port->wPortChange |= PORT_STAT_C_SUSPEND;
@@ -257,9 +257,9 @@ static void usb_hub_wakeup(USBDevice *dev)
     }
 }
 
-static void usb_hub_complete(USBDevice *dev, USBPacket *packet)
+static void usb_hub_complete(USBPort *port, USBPacket *packet)
 {
-    USBHubState *s = dev->port->opaque;
+    USBHubState *s = port->opaque;
 
     /*
      * Just pass it along upstream for now.