diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-04-06 01:52:12 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-04-07 12:47:11 -0400 |
commit | 3e0ac12a1a610b4ab47282a25ee5945064228e35 (patch) | |
tree | ae1cc6c11d31b31e24aa768588ac0def005845eb /drivers/bluetooth | |
parent | 1df1f5910825821ebac5eb1a74da2af8fdcaebf3 (diff) |
Bluetooth: hci_uart: Use generic functionality from Broadcom module
The new Broadcom Bluetooth support module provides generic functionality
for changing and checking the Bluetooth device address. Use these new
features instead of keeping a duplicate in the driver.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/Kconfig | 1 | ||||
-rw-r--r-- | drivers/bluetooth/hci_bcm.c | 17 | ||||
-rw-r--r-- | drivers/bluetooth/hci_ldisc.c | 4 | ||||
-rw-r--r-- | drivers/bluetooth/hci_uart.h | 4 |
4 files changed, 4 insertions, 22 deletions
diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index b593e5f766df..9f68e11c1671 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig | |||
@@ -111,6 +111,7 @@ config BT_HCIUART_INTEL | |||
111 | config BT_HCIUART_BCM | 111 | config BT_HCIUART_BCM |
112 | bool "Broadcom protocol support" | 112 | bool "Broadcom protocol support" |
113 | depends on BT_HCIUART | 113 | depends on BT_HCIUART |
114 | select BT_BCM | ||
114 | help | 115 | help |
115 | The Broadcom protocol support enables Bluetooth HCI over serial | 116 | The Broadcom protocol support enables Bluetooth HCI over serial |
116 | port interface for Broadcom Bluetooth controllers. | 117 | port interface for Broadcom Bluetooth controllers. |
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 1a5817bda7c6..dd338fa77433 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c | |||
@@ -29,20 +29,3 @@ | |||
29 | #include <net/bluetooth/hci_core.h> | 29 | #include <net/bluetooth/hci_core.h> |
30 | 30 | ||
31 | #include "hci_uart.h" | 31 | #include "hci_uart.h" |
32 | |||
33 | int bcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) | ||
34 | { | ||
35 | struct sk_buff *skb; | ||
36 | int err; | ||
37 | |||
38 | skb = __hci_cmd_sync(hdev, 0xfc01, 6, bdaddr, HCI_INIT_TIMEOUT); | ||
39 | if (IS_ERR(skb)) { | ||
40 | err = PTR_ERR(skb); | ||
41 | BT_ERR("%s: BCM: Change address command failed (%d)", | ||
42 | hdev->name, err); | ||
43 | return err; | ||
44 | } | ||
45 | kfree_skb(skb); | ||
46 | |||
47 | return 0; | ||
48 | } | ||
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index b265abcb9eb6..b182ddc43dfe 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <net/bluetooth/bluetooth.h> | 44 | #include <net/bluetooth/bluetooth.h> |
45 | #include <net/bluetooth/hci_core.h> | 45 | #include <net/bluetooth/hci_core.h> |
46 | 46 | ||
47 | #include "btbcm.h" | ||
47 | #include "hci_uart.h" | 48 | #include "hci_uart.h" |
48 | 49 | ||
49 | #define VERSION "2.3" | 50 | #define VERSION "2.3" |
@@ -299,7 +300,8 @@ static int hci_uart_setup(struct hci_dev *hdev) | |||
299 | #endif | 300 | #endif |
300 | #ifdef CONFIG_BT_HCIUART_BCM | 301 | #ifdef CONFIG_BT_HCIUART_BCM |
301 | case 15: | 302 | case 15: |
302 | hdev->set_bdaddr = bcm_set_bdaddr; | 303 | hdev->set_bdaddr = btbcm_set_bdaddr; |
304 | btbcm_check_bdaddr(hdev); | ||
303 | break; | 305 | break; |
304 | #endif | 306 | #endif |
305 | } | 307 | } |
diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h index 80e694a36143..ad03f57e794b 100644 --- a/drivers/bluetooth/hci_uart.h +++ b/drivers/bluetooth/hci_uart.h | |||
@@ -128,7 +128,3 @@ int h5_deinit(void); | |||
128 | #ifdef CONFIG_BT_HCIUART_INTEL | 128 | #ifdef CONFIG_BT_HCIUART_INTEL |
129 | int intel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr); | 129 | int intel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr); |
130 | #endif | 130 | #endif |
131 | |||
132 | #ifdef CONFIG_BT_HCIUART_BCM | ||
133 | int bcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr); | ||
134 | #endif | ||