From 615fe4de4b3c26619611078960d3103550bde7d0 Mon Sep 17 00:00:00 2001 From: Miroslav Rezanina Date: Tue, 3 Sep 2013 11:23:09 +0200 Subject: Remove dev-bluetooth.c dependency from vl.c Use usb_legacy_register handling to create bt-dongle device and remove code dependency from vl.c so CONFIG_USB_BLUETOOTH can be disabled. Signed-off-by: Miroslav Rezanina Signed-off-by: Gerd Hoffmann --- hw/usb/dev-bluetooth.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'hw/usb/dev-bluetooth.c') diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c index f2fc2a8034..7f292b1ae6 100644 --- a/hw/usb/dev-bluetooth.c +++ b/hw/usb/dev-bluetooth.c @@ -511,10 +511,17 @@ static int usb_bt_initfn(USBDevice *dev) return 0; } -USBDevice *usb_bt_init(USBBus *bus, HCIInfo *hci) +static USBDevice *usb_bt_init(USBBus *bus, const char *cmdline) { USBDevice *dev; struct USBBtState *s; + HCIInfo *hci; + + if (*cmdline) { + hci = hci_init(cmdline); + } else { + hci = bt_new_hci(qemu_find_bt_vlan(0)); + } if (!hci) return NULL; @@ -566,6 +573,7 @@ static const TypeInfo bt_info = { static void usb_bt_register_types(void) { type_register_static(&bt_info); + usb_legacy_register("usb-bt-dongle", "bt", usb_bt_init); } type_init(usb_bt_register_types) -- cgit v1.2.1