aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-02-24 11:09:38 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-24 13:15:34 -0500
commit8a7a3fd680f3ea9f22fc504caf5e8e056a800401 (patch)
treefb6b512af684900105cff5ed163e8ed563419afa
parenta55e1f388767116836d32457a50eda7da3e925e5 (diff)
Bluetooth: Add support for creating HCI UART based AMP controllers
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>
-rw-r--r--drivers/bluetooth/hci_ldisc.c5
-rw-r--r--drivers/bluetooth/hci_uart.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index cdc3594f9901..fd5adb408f44 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -396,6 +396,11 @@ static int hci_uart_register_dev(struct hci_uart *hu)
396 if (!test_bit(HCI_UART_RESET_ON_INIT, &hu->hdev_flags)) 396 if (!test_bit(HCI_UART_RESET_ON_INIT, &hu->hdev_flags))
397 set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks); 397 set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
398 398
399 if (test_bit(HCI_UART_CREATE_AMP, &hu->hdev_flags))
400 hdev->dev_type = HCI_AMP;
401 else
402 hdev->dev_type = HCI_BREDR;
403
399 if (hci_register_dev(hdev) < 0) { 404 if (hci_register_dev(hdev) < 0) {
400 BT_ERR("Can't register HCI device"); 405 BT_ERR("Can't register HCI device");
401 hci_free_dev(hdev); 406 hci_free_dev(hdev);
diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h
index 54c8983b183e..6cf6ab22ad21 100644
--- a/drivers/bluetooth/hci_uart.h
+++ b/drivers/bluetooth/hci_uart.h
@@ -46,6 +46,7 @@
46 46
47#define HCI_UART_RAW_DEVICE 0 47#define HCI_UART_RAW_DEVICE 0
48#define HCI_UART_RESET_ON_INIT 1 48#define HCI_UART_RESET_ON_INIT 1
49#define HCI_UART_CREATE_AMP 2
49 50
50struct hci_uart; 51struct hci_uart;
51 52