summary refs log tree commit diff stats
path: root/hw/usb/dev-bluetooth.c
diff options
context:
space:
mode:
authorAnthony Liguori <anthony@codemonkey.ws>2013-09-11 14:46:21 -0500
committerAnthony Liguori <anthony@codemonkey.ws>2013-09-11 14:46:21 -0500
commita640f07c0d03bfa3031af1fc0a32b0d779917d17 (patch)
treeaef05faa1cb19136263cd28fcd061ff71ae68144 /hw/usb/dev-bluetooth.c
parentf69f0bcac951f3c3089246695874b84ea8967936 (diff)
parentadbecc89731cf3e0ae656d50ea9fa58c589c4bdc (diff)
downloadfocaccia-qemu-a640f07c0d03bfa3031af1fc0a32b0d779917d17.tar.gz
focaccia-qemu-a640f07c0d03bfa3031af1fc0a32b0d779917d17.zip
Merge remote-tracking branch 'kraxel/usb.89' into staging
# By Gerd Hoffmann (2) and Miroslav Rezanina (2)
# Via Gerd Hoffmann
* kraxel/usb.89:
  ehci: save device pointer in EHCIState
  Remove dev-bluetooth.c dependency from vl.c
  Preparation for usb-bt-dongle conditional build
  usb: sanity check setup_index+setup_len in post_load

Message-id: 1378806073-25197-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
Diffstat (limited to 'hw/usb/dev-bluetooth.c')
-rw-r--r--hw/usb/dev-bluetooth.c10
1 files changed, 9 insertions, 1 deletions
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)