aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorMiroslav Rezanina <mrezanin@redhat.com>2013-09-03 11:23:09 +0200
committerGerd Hoffmann <kraxel@redhat.com>2013-09-10 11:14:42 +0200
commit615fe4de4b3c26619611078960d3103550bde7d0 (patch)
tree131a60494fd466632ddba6d83df357d96f23a172 /hw/usb
parent644e1a8a34d2f799bfeefae94b71593a2aa662ae (diff)
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 <mrezanin@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/Makefile.objs3
-rw-r--r--hw/usb/dev-bluetooth.c10
2 files changed, 9 insertions, 4 deletions
diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
index f9695e7d8a..a3eac3e5c1 100644
--- a/hw/usb/Makefile.objs
+++ b/hw/usb/Makefile.objs
@@ -18,9 +18,6 @@ common-obj-$(CONFIG_USB_STORAGE_UAS) += dev-uas.o
common-obj-$(CONFIG_USB_AUDIO) += dev-audio.o
common-obj-$(CONFIG_USB_SERIAL) += dev-serial.o
common-obj-$(CONFIG_USB_NETWORK) += dev-network.o
-
-# FIXME: make configurable too
-CONFIG_USB_BLUETOOTH := y
common-obj-$(CONFIG_USB_BLUETOOTH) += dev-bluetooth.o
ifeq ($(CONFIG_USB_SMARTCARD),y)
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)