Bluetooth: Add support for creating HCI UART based AMP controllers
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 24 Feb 2012 16:09:38 +0000 (17:09 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 24 Feb 2012 18:15:34 +0000 (20:15 +0200)
In reality this might never be used for real hardware, but it is a nice
feature for emulating AMP controllers within a virtual machine.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
drivers/bluetooth/hci_ldisc.c
drivers/bluetooth/hci_uart.h

index cdc3594f99011cce5e3463f729b23f4351b542d6..fd5adb408f447a4a08b9dbece913e111d3fe9906 100644 (file)
@@ -396,6 +396,11 @@ static int hci_uart_register_dev(struct hci_uart *hu)
        if (!test_bit(HCI_UART_RESET_ON_INIT, &hu->hdev_flags))
                set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
 
+       if (test_bit(HCI_UART_CREATE_AMP, &hu->hdev_flags))
+               hdev->dev_type = HCI_AMP;
+       else
+               hdev->dev_type = HCI_BREDR;
+
        if (hci_register_dev(hdev) < 0) {
                BT_ERR("Can't register HCI device");
                hci_free_dev(hdev);
index 54c8983b183e48c9b466d0c1339c5d51499318af..6cf6ab22ad21f7e081f1d806f44638adc8e6a627 100644 (file)
@@ -46,6 +46,7 @@
 
 #define HCI_UART_RAW_DEVICE    0
 #define HCI_UART_RESET_ON_INIT 1
+#define HCI_UART_CREATE_AMP    2
 
 struct hci_uart;