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)
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;
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)
USBDevice *usb_host_device_open(USBBus *bus, const char *devname);
void usb_host_info(Monitor *mon, const QDict *qdict);
-/* usb-bt.c */
-USBDevice *usb_bt_init(USBBus *bus, HCIInfo *hci);
-
/* usb ports of the VM */
#define VM_USB_HUB_SIZE 8
static int usb_device_add(const char *devname)
{
- const char *p;
USBDevice *dev = NULL;
+#ifndef CONFIG_LINUX
+ const char *p;
+#endif
if (!usb_enabled(false)) {
return -1;
/* only the linux version is qdev-ified, usb-bsd still needs this */
if (strstart(devname, "host:", &p)) {
dev = usb_host_device_open(usb_bus_find(-1), p);
- } else
-#endif
- if (!strcmp(devname, "bt") || strstart(devname, "bt:", &p)) {
- dev = usb_bt_init(usb_bus_find(-1),
- devname[2] ? hci_init(p)
- : bt_new_hci(qemu_find_bt_vlan(0)));
- } else {
- return -1;
}
+#endif
if (!dev)
return -1;