summary refs log tree commit diff stats
path: root/hw/usb-hub.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-09-08 08:57:33 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-09-08 08:57:33 -0500
commita60fce0bcc193c37c92972b8217341d81f7a9860 (patch)
tree57f7977faa534d05d969d5e4a23154d8381866ae /hw/usb-hub.c
parent63236c15e93e18d37ce657171a42af1f809d0aa6 (diff)
parent5b1cdb4ead0b3d2190492fce0a17e809ef915f26 (diff)
downloadfocaccia-qemu-a60fce0bcc193c37c92972b8217341d81f7a9860.tar.gz
focaccia-qemu-a60fce0bcc193c37c92972b8217341d81f7a9860.zip
Merge remote-tracking branch 'kraxel/usb.26' into staging
Diffstat (limited to 'hw/usb-hub.c')
-rw-r--r--hw/usb-hub.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index c49c547d0c..286e3ad85d 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -213,16 +213,6 @@ static void usb_hub_complete(USBPort *port, USBPacket *packet)
     usb_packet_complete(&s->dev, packet);
 }
 
-static void usb_hub_handle_attach(USBDevice *dev)
-{
-    USBHubState *s = DO_UPCAST(USBHubState, dev, dev);
-    int i;
-
-    for (i = 0; i < NUM_PORTS; i++) {
-        usb_port_location(&s->ports[i].port, dev->port, i+1);
-    }
-}
-
 static void usb_hub_handle_reset(USBDevice *dev)
 {
     /* XXX: do it */
@@ -499,6 +489,7 @@ static int usb_hub_initfn(USBDevice *dev)
         usb_register_port(usb_bus_from_device(dev),
                           &port->port, s, i, &usb_hub_port_ops,
                           USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL);
+        usb_port_location(&port->port, dev->port, i+1);
         port->wPortStatus = PORT_STAT_POWER;
         port->wPortChange = 0;
     }
@@ -537,7 +528,6 @@ static struct USBDeviceInfo hub_info = {
     .usb_desc       = &desc_hub,
     .init           = usb_hub_initfn,
     .handle_packet  = usb_hub_handle_packet,
-    .handle_attach  = usb_hub_handle_attach,
     .handle_reset   = usb_hub_handle_reset,
     .handle_control = usb_hub_handle_control,
     .handle_data    = usb_hub_handle_data,