summaryrefslogtreecommitdiffstats
path: root/hw/usb-hub.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-08-31 14:24:00 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-09 14:55:17 -0500
commita5d2f7273c4f59942cc7ffa763d6b60a6f44e908 (patch)
tree58aa343b12e77313bc708d3166a9bc609039d40c /hw/usb-hub.c
parent806b60248218bd5f74a8b070f5a99a864e8e51c6 (diff)
downloadhqemu-a5d2f7273c4f59942cc7ffa763d6b60a6f44e908.zip
hqemu-a5d2f7273c4f59942cc7ffa763d6b60a6f44e908.tar.gz
qdev/usb: make qemu aware of usb busses.
Move usb code from vl.c to usb-bus.c and make it use the new data structures added by qdev conversion. qemu usb core should be able to handle multiple USB busses just fine now (untested though). Kill some usb_*_init() legacy functions, use usb_create_simple() instead. Kill some FIXMEs added by the first qdev/usb patch. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/usb-hub.c')
-rw-r--r--hw/usb-hub.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 116b1d2..0a39986 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -531,18 +531,14 @@ static int usb_hub_initfn(USBDevice *dev)
s->nb_ports = MAX_PORTS; /* FIXME: make configurable */
for (i = 0; i < s->nb_ports; i++) {
port = &s->ports[i];
- qemu_register_usb_port(&port->port, s, i, usb_hub_attach);
+ usb_register_port(usb_bus_from_device(dev),
+ &port->port, s, i, usb_hub_attach);
port->wPortStatus = PORT_STAT_POWER;
port->wPortChange = 0;
}
return 0;
}
-USBDevice *usb_hub_init(int nb_ports)
-{
- return usb_create_simple(NULL /* FIXME */, "QEMU USB Hub");
-}
-
static struct USBDeviceInfo hub_info = {
.qdev.name = "QEMU USB Hub",
.qdev.size = sizeof(USBHubState),
OpenPOWER on IntegriCloud