Bluetooth: hci_uart: Use generic Intel support for address setting
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 6 Apr 2015 07:52:14 +0000 (00:52 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 7 Apr 2015 16:48:21 +0000 (18:48 +0200)
The Bluetooth address setting for Intel devices is provided by a generic
module now. Start using that module instead of relying it being included
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_intel.c
drivers/bluetooth/hci_ldisc.c
drivers/bluetooth/hci_uart.h

index b50fe33616595d75dd0da480765d5a53a1ad6eb2..ed5c2738bea20efcf0c6ed0a920ad9faf5b1fd67 100644 (file)
@@ -117,6 +117,7 @@ config BT_HCIUART_3WIRE
 config BT_HCIUART_INTEL
        bool "Intel protocol support"
        depends on BT_HCIUART
+       select BT_INTEL
        help
          The Intel protocol support enables Bluetooth HCI over serial
          port interface for Intel Bluetooth controllers.
index b7bd50a410806d3cf809be24210507f7dbb72d52..5dd07bf052360c15bc8631551def5e6cce687626 100644 (file)
 #include <net/bluetooth/hci_core.h>
 
 #include "hci_uart.h"
-
-int intel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
-{
-       struct sk_buff *skb;
-       int err;
-
-       skb = __hci_cmd_sync(hdev, 0xfc31, 6, bdaddr, HCI_INIT_TIMEOUT);
-       if (IS_ERR(skb)) {
-               err = PTR_ERR(skb);
-               BT_ERR("%s: Changing Intel device address failed (%d)",
-                      hdev->name, err);
-               return err;
-       }
-       kfree_skb(skb);
-
-       return 0;
-}
index a106c3e201e3d2a3e26cc82ec4712113df7e783c..5c9a73f026649c99a1b56d2f91d5981e29b905c9 100644 (file)
@@ -44,6 +44,7 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 
+#include "btintel.h"
 #include "btbcm.h"
 #include "hci_uart.h"
 
@@ -295,7 +296,8 @@ static int hci_uart_setup(struct hci_dev *hdev)
        switch (le16_to_cpu(ver->manufacturer)) {
 #ifdef CONFIG_BT_HCIUART_INTEL
        case 2:
-               hdev->set_bdaddr = intel_set_bdaddr;
+               hdev->set_bdaddr = btintel_set_bdaddr;
+               btintel_check_bdaddr(hdev);
                break;
 #endif
 #ifdef CONFIG_BT_HCIUART_BCM
index d1fa6263f7c2073b93e1798bc42732fa614bd417..72120a5ba13c8a6056649a7ec51a617eac8cf536 100644 (file)
@@ -156,10 +156,6 @@ int h5_init(void);
 int h5_deinit(void);
 #endif
 
-#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_init(void);
 int bcm_deinit(void);