aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-04-04 19:13:03 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-04-07 12:47:08 -0400
commite9a2dd261ac3d7bffbf55368a60401f5982dcc59 (patch)
tree2ea20c4ed4586accdb395fe2c55c6bf47eb350a7 /drivers/bluetooth
parent16e3887f9c625dbcbc5d7cc939881dd4515141c5 (diff)
Bluetooth: hci_uart: Add support Broadcom address configuration
When using vendor detection, this adds support for the Broadcom specific address configuration command. 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/Kconfig9
-rw-r--r--drivers/bluetooth/Makefile1
-rw-r--r--drivers/bluetooth/hci_bcm.c48
-rw-r--r--drivers/bluetooth/hci_ldisc.c5
-rw-r--r--drivers/bluetooth/hci_uart.h7
5 files changed, 69 insertions, 1 deletions
diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
index 4356f718ea3d..e8630b605aa9 100644
--- a/drivers/bluetooth/Kconfig
+++ b/drivers/bluetooth/Kconfig
@@ -103,6 +103,15 @@ config BT_HCIUART_INTEL
103 103
104 Say Y here to compile support for Intel protocol. 104 Say Y here to compile support for Intel protocol.
105 105
106config BT_HCIUART_BCM
107 bool "Broadcom protocol support"
108 depends on BT_HCIUART
109 help
110 The Broadcom protocol support enables Bluetooth HCI over serial
111 port interface for Broadcom Bluetooth controllers.
112
113 Say Y here to compile support for Broadcom protocol.
114
106config BT_HCIBCM203X 115config BT_HCIBCM203X
107 tristate "HCI BCM203x USB driver" 116 tristate "HCI BCM203x USB driver"
108 depends on USB 117 depends on USB
diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile
index adb99457d016..51f9d0c18963 100644
--- a/drivers/bluetooth/Makefile
+++ b/drivers/bluetooth/Makefile
@@ -30,6 +30,7 @@ hci_uart-$(CONFIG_BT_HCIUART_LL) += hci_ll.o
30hci_uart-$(CONFIG_BT_HCIUART_ATH3K) += hci_ath.o 30hci_uart-$(CONFIG_BT_HCIUART_ATH3K) += hci_ath.o
31hci_uart-$(CONFIG_BT_HCIUART_3WIRE) += hci_h5.o 31hci_uart-$(CONFIG_BT_HCIUART_3WIRE) += hci_h5.o
32hci_uart-$(CONFIG_BT_HCIUART_INTEL) += hci_intel.o 32hci_uart-$(CONFIG_BT_HCIUART_INTEL) += hci_intel.o
33hci_uart-$(CONFIG_BT_HCIUART_BCM) += hci_bcm.o
33hci_uart-objs := $(hci_uart-y) 34hci_uart-objs := $(hci_uart-y)
34 35
35ccflags-y += -D__CHECK_ENDIAN__ 36ccflags-y += -D__CHECK_ENDIAN__
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
new file mode 100644
index 000000000000..1a5817bda7c6
--- /dev/null
+++ b/drivers/bluetooth/hci_bcm.c
@@ -0,0 +1,48 @@
1/*
2 *
3 * Bluetooth HCI UART driver for Broadcom devices
4 *
5 * Copyright (C) 2015 Intel Corporation
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#include <linux/kernel.h>
25#include <linux/errno.h>
26#include <linux/skbuff.h>
27
28#include <net/bluetooth/bluetooth.h>
29#include <net/bluetooth/hci_core.h>
30
31#include "hci_uart.h"
32
33int 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 03f9defac39d..b6d1ff4fbba6 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -295,6 +295,11 @@ static int hci_uart_setup(struct hci_dev *hdev)
295 hdev->set_bdaddr = intel_set_bdaddr; 295 hdev->set_bdaddr = intel_set_bdaddr;
296 break; 296 break;
297#endif 297#endif
298#ifdef CONFIG_BT_HCIUART_BCM
299 case 15:
300 hdev->set_bdaddr = bcm_set_bdaddr;
301 break;
302#endif
298 } 303 }
299 304
300done: 305done:
diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h
index 687aa7e9eb2e..4dc8ab3009a9 100644
--- a/drivers/bluetooth/hci_uart.h
+++ b/drivers/bluetooth/hci_uart.h
@@ -35,7 +35,7 @@
35#define HCIUARTGETFLAGS _IOR('U', 204, int) 35#define HCIUARTGETFLAGS _IOR('U', 204, int)
36 36
37/* UART protocols */ 37/* UART protocols */
38#define HCI_UART_MAX_PROTO 7 38#define HCI_UART_MAX_PROTO 8
39 39
40#define HCI_UART_H4 0 40#define HCI_UART_H4 0
41#define HCI_UART_BCSP 1 41#define HCI_UART_BCSP 1
@@ -44,6 +44,7 @@
44#define HCI_UART_LL 4 44#define HCI_UART_LL 4
45#define HCI_UART_ATH3K 5 45#define HCI_UART_ATH3K 5
46#define HCI_UART_INTEL 6 46#define HCI_UART_INTEL 6
47#define HCI_UART_BCM 7
47 48
48#define HCI_UART_RAW_DEVICE 0 49#define HCI_UART_RAW_DEVICE 0
49#define HCI_UART_RESET_ON_INIT 1 50#define HCI_UART_RESET_ON_INIT 1
@@ -123,3 +124,7 @@ int h5_deinit(void);
123#ifdef CONFIG_BT_HCIUART_INTEL 124#ifdef CONFIG_BT_HCIUART_INTEL
124int intel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr); 125int intel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
125#endif 126#endif
127
128#ifdef CONFIG_BT_HCIUART_BCM
129int bcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
130#endif