diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-08-31 14:24:00 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-09-09 14:55:17 -0500 |
commit | a5d2f7273c4f59942cc7ffa763d6b60a6f44e908 (patch) | |
tree | 58aa343b12e77313bc708d3166a9bc609039d40c /hw/usb-uhci.c | |
parent | 806b60248218bd5f74a8b070f5a99a864e8e51c6 (diff) |
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-uhci.c')
-rw-r--r-- | hw/usb-uhci.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c index a112a6960..2ff287b30 100644 --- a/hw/usb-uhci.c +++ b/hw/usb-uhci.c @@ -122,6 +122,7 @@ typedef struct UHCIPort { typedef struct UHCIState { PCIDevice dev; + USBBus *bus; uint16_t cmd; /* cmd register */ uint16_t status; uint16_t intr; /* interrupt enable register */ @@ -1089,8 +1090,9 @@ void usb_uhci_piix3_init(PCIBus *bus, int devfn) pci_conf[0x3d] = 4; // interrupt pin 3 pci_conf[0x60] = 0x10; // release number + s->bus = usb_bus_new(NULL /* FIXME */); for(i = 0; i < NB_PORTS; i++) { - qemu_register_usb_port(&s->ports[i].port, s, i, uhci_attach); + usb_register_port(s->bus, &s->ports[i].port, s, i, uhci_attach); } s->frame_timer = qemu_new_timer(vm_clock, uhci_frame_timer, s); @@ -1124,8 +1126,9 @@ void usb_uhci_piix4_init(PCIBus *bus, int devfn) pci_conf[0x3d] = 4; // interrupt pin 3 pci_conf[0x60] = 0x10; // release number + s->bus = usb_bus_new(NULL /* FIXME */); for(i = 0; i < NB_PORTS; i++) { - qemu_register_usb_port(&s->ports[i].port, s, i, uhci_attach); + usb_register_port(s->bus, &s->ports[i].port, s, i, uhci_attach); } s->frame_timer = qemu_new_timer(vm_clock, uhci_frame_timer, s); |