3 * Bluetooth support for Intel devices
5 * Copyright (C) 2015 Intel Corporation
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.
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.
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
24 #include <linux/module.h>
26 #include <net/bluetooth/bluetooth.h>
27 #include <net/bluetooth/hci_core.h>
33 #define BDADDR_INTEL (&(bdaddr_t) {{0x00, 0x8b, 0x9e, 0x19, 0x03, 0x00}})
35 int btintel_check_bdaddr(struct hci_dev
*hdev
)
37 struct hci_rp_read_bd_addr
*bda
;
40 skb
= __hci_cmd_sync(hdev
, HCI_OP_READ_BD_ADDR
, 0, NULL
,
43 int err
= PTR_ERR(skb
);
44 BT_ERR("%s: Reading Intel device address failed (%d)",
49 if (skb
->len
!= sizeof(*bda
)) {
50 BT_ERR("%s: Intel device address length mismatch", hdev
->name
);
55 bda
= (struct hci_rp_read_bd_addr
*)skb
->data
;
57 BT_ERR("%s: Intel device address result failed (%02x)",
58 hdev
->name
, bda
->status
);
60 return -bt_to_errno(bda
->status
);
63 /* For some Intel based controllers, the default Bluetooth device
64 * address 00:03:19:9E:8B:00 can be found. These controllers are
65 * fully operational, but have the danger of duplicate addresses
66 * and that in turn can cause problems with Bluetooth operation.
68 if (!bacmp(&bda
->bdaddr
, BDADDR_INTEL
)) {
69 BT_ERR("%s: Found Intel default device address (%pMR)",
70 hdev
->name
, &bda
->bdaddr
);
71 set_bit(HCI_QUIRK_INVALID_BDADDR
, &hdev
->quirks
);
78 EXPORT_SYMBOL_GPL(btintel_check_bdaddr
);
80 int btintel_set_bdaddr(struct hci_dev
*hdev
, const bdaddr_t
*bdaddr
)
85 skb
= __hci_cmd_sync(hdev
, 0xfc31, 6, bdaddr
, HCI_INIT_TIMEOUT
);
88 BT_ERR("%s: Changing Intel device address failed (%d)",
96 EXPORT_SYMBOL_GPL(btintel_set_bdaddr
);
98 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
99 MODULE_DESCRIPTION("Bluetooth support for Intel devices ver " VERSION
);
100 MODULE_VERSION(VERSION
);
101 MODULE_LICENSE("GPL");