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 --- usb-linux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'usb-linux.c') 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; -- cgit v1.1