Bluetooth: hci_uart: Use generic functionality from Broadcom module
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 6 Apr 2015 05:52:12 +0000 (22:52 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 7 Apr 2015 16:47:11 +0000 (18:47 +0200)
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>
drivers/bluetooth/Kconfig
drivers/bluetooth/hci_bcm.c
drivers/bluetooth/hci_ldisc.c
drivers/bluetooth/hci_uart.h

index b593e5f766dfa75cb57f786ed0ec21412fd701c2..9f68e11c167149454dec683fd6d3bf49a12db976 100644 (file)
@@ -111,6 +111,7 @@ config BT_HCIUART_INTEL
 config BT_HCIUART_BCM
        bool "Broadcom protocol support"
        depends on BT_HCIUART
+       select BT_BCM
        help
          The Broadcom protocol support enables Bluetooth HCI over serial
          port interface for Broadcom Bluetooth controllers.
index 1a5817bda7c66da14f2de53a8f7eae8d1a892e52..dd338fa77433849d7814e3e58a6c0e48d982479f 100644 (file)
 #include <net/bluetooth/hci_core.h>
 
 #include "hci_uart.h"
-
-int bcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
-{
-       struct sk_buff *skb;
-       int err;
-
-       skb = __hci_cmd_sync(hdev, 0xfc01, 6, bdaddr, HCI_INIT_TIMEOUT);
-       if (IS_ERR(skb)) {
-               err = PTR_ERR(skb);
-               BT_ERR("%s: BCM: Change address command failed (%d)",
-                      hdev->name, err);
-               return err;
-       }
-       kfree_skb(skb);
-
-       return 0;
-}
index b265abcb9eb63e2332015c609be2fccef8c81603..b182ddc43dfe086e0d2b530fb1b75f76c76fde21 100644 (file)
@@ -44,6 +44,7 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 
+#include "btbcm.h"
 #include "hci_uart.h"
 
 #define VERSION "2.3"
@@ -299,7 +300,8 @@ static int hci_uart_setup(struct hci_dev *hdev)
 #endif
 #ifdef CONFIG_BT_HCIUART_BCM
        case 15:
-               hdev->set_bdaddr = bcm_set_bdaddr;
+               hdev->set_bdaddr = btbcm_set_bdaddr;
+               btbcm_check_bdaddr(hdev);
                break;
 #endif
        }
index 80e694a36143042665ba892c405b297465c71730..ad03f57e794bfe4ae73a0be5f2ce79e88b293791 100644 (file)
@@ -128,7 +128,3 @@ int h5_deinit(void);
 #ifdef CONFIG_BT_HCIUART_INTEL
 int intel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
 #endif
-
-#ifdef CONFIG_BT_HCIUART_BCM
-int bcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
-#endif