xref: /linux/drivers/bluetooth/hci_intel.c (revision 16e3887f9c625dbcbc5d7cc939881dd4515141c5)
1*16e3887fSMarcel Holtmann /*
2*16e3887fSMarcel Holtmann  *
3*16e3887fSMarcel Holtmann  *  Bluetooth HCI UART driver for Intel devices
4*16e3887fSMarcel Holtmann  *
5*16e3887fSMarcel Holtmann  *  Copyright (C) 2015  Intel Corporation
6*16e3887fSMarcel Holtmann  *
7*16e3887fSMarcel Holtmann  *
8*16e3887fSMarcel Holtmann  *  This program is free software; you can redistribute it and/or modify
9*16e3887fSMarcel Holtmann  *  it under the terms of the GNU General Public License as published by
10*16e3887fSMarcel Holtmann  *  the Free Software Foundation; either version 2 of the License, or
11*16e3887fSMarcel Holtmann  *  (at your option) any later version.
12*16e3887fSMarcel Holtmann  *
13*16e3887fSMarcel Holtmann  *  This program is distributed in the hope that it will be useful,
14*16e3887fSMarcel Holtmann  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15*16e3887fSMarcel Holtmann  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*16e3887fSMarcel Holtmann  *  GNU General Public License for more details.
17*16e3887fSMarcel Holtmann  *
18*16e3887fSMarcel Holtmann  *  You should have received a copy of the GNU General Public License
19*16e3887fSMarcel Holtmann  *  along with this program; if not, write to the Free Software
20*16e3887fSMarcel Holtmann  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21*16e3887fSMarcel Holtmann  *
22*16e3887fSMarcel Holtmann  */
23*16e3887fSMarcel Holtmann 
24*16e3887fSMarcel Holtmann #include <linux/kernel.h>
25*16e3887fSMarcel Holtmann #include <linux/errno.h>
26*16e3887fSMarcel Holtmann #include <linux/skbuff.h>
27*16e3887fSMarcel Holtmann 
28*16e3887fSMarcel Holtmann #include <net/bluetooth/bluetooth.h>
29*16e3887fSMarcel Holtmann #include <net/bluetooth/hci_core.h>
30*16e3887fSMarcel Holtmann 
31*16e3887fSMarcel Holtmann #include "hci_uart.h"
32*16e3887fSMarcel Holtmann 
33*16e3887fSMarcel Holtmann int intel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
34*16e3887fSMarcel Holtmann {
35*16e3887fSMarcel Holtmann 	struct sk_buff *skb;
36*16e3887fSMarcel Holtmann 	int err;
37*16e3887fSMarcel Holtmann 
38*16e3887fSMarcel Holtmann 	skb = __hci_cmd_sync(hdev, 0xfc31, 6, bdaddr, HCI_INIT_TIMEOUT);
39*16e3887fSMarcel Holtmann 	if (IS_ERR(skb)) {
40*16e3887fSMarcel Holtmann 		err = PTR_ERR(skb);
41*16e3887fSMarcel Holtmann 		BT_ERR("%s: Changing Intel device address failed (%d)",
42*16e3887fSMarcel Holtmann 		       hdev->name, err);
43*16e3887fSMarcel Holtmann 		return err;
44*16e3887fSMarcel Holtmann 	}
45*16e3887fSMarcel Holtmann 	kfree_skb(skb);
46*16e3887fSMarcel Holtmann 
47*16e3887fSMarcel Holtmann 	return 0;
48*16e3887fSMarcel Holtmann }
49