From a5d2f7273c4f59942cc7ffa763d6b60a6f44e908 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 31 Aug 2009 14:24:00 +0200 Subject: 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 Signed-off-by: Anthony Liguori --- hw/usb-ohci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hw/usb-ohci.c') diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c index e725e974b2..7f620c7d21 100644 --- a/hw/usb-ohci.c +++ b/hw/usb-ohci.c @@ -65,6 +65,7 @@ enum ohci_type { }; typedef struct { + USBBus *bus; qemu_irq irq; enum ohci_type type; int mem; @@ -1688,9 +1689,10 @@ static void usb_ohci_init(OHCIState *ohci, int num_ports, int devfn, ohci->irq = irq; ohci->type = type; + ohci->bus = usb_bus_new(NULL /* FIXME */); ohci->num_ports = num_ports; for (i = 0; i < num_ports; i++) { - qemu_register_usb_port(&ohci->rhport[i].port, ohci, i, ohci_attach); + usb_register_port(ohci->bus, &ohci->rhport[i].port, ohci, i, ohci_attach); } ohci->async_td = 0; -- cgit v1.2.3