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 /usb-linux.c | |
parent | 806b60248218bd5f74a8b070f5a99a864e8e51c6 (diff) | |
download | qemu-a5d2f7273c4f59942cc7ffa763d6b60a6f44e908.zip qemu-a5d2f7273c4f59942cc7ffa763d6b60a6f44e908.tar.gz qemu-a5d2f7273c4f59942cc7ffa763d6b60a6f44e908.tar.bz2 |
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 'usb-linux.c')
-rw-r--r-- | usb-linux.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usb-linux.c b/usb-linux.c index 7f6ca90..01d145d 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -252,7 +252,7 @@ static void async_complete(void *opaque) if (errno == ENODEV && !s->closing) { printf("husb: device %d.%d disconnected\n", s->bus_num, s->addr); - usb_device_del_addr(0, s->dev.addr); + usb_device_delete_addr(s->bus_num, s->dev.addr); return; } @@ -909,7 +909,7 @@ static USBDevice *usb_host_device_open_addr(int bus_num, int addr, const char *p } dprintf("husb: opened %s\n", buf); - d = usb_create_simple(NULL /* FIXME */, "USB Host Device"); + d = usb_create(NULL /* FIXME */, "USB Host Device"); dev = DO_UPCAST(USBHostDevice, dev, d); dev->bus_num = bus_num; @@ -1039,16 +1039,16 @@ int usb_host_device_close(const char *devname) if (usb_host_find_device(&bus_num, &addr, product_name, sizeof(product_name), devname) < 0) return -1; - + s = hostdev_find(bus_num, addr); if (s) { - usb_device_del_addr(0, s->dev.addr); + usb_device_delete_addr(s->bus_num, s->dev.addr); return 0; } return -1; } - + static int get_tag_value(char *buf, int buf_size, const char *str, const char *tag, const char *stopchars) @@ -1387,7 +1387,7 @@ static int usb_host_auto_scan(void *opaque, int bus_num, int addr, dev = usb_host_device_open_addr(bus_num, addr, product_name); if (dev) - usb_device_add_dev(dev); + qdev_init(&dev->qdev); } return 0; |