aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-04-11 08:35:38 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-04-29 19:05:29 -0400
commit4c876c0edbdc28de751dc4b4583dcbfc290a2293 (patch)
treef09ed0e33eed7566de8a7df70d50de485396a932
parentc0ba7acd48d122fe5941c8f402fc1ee024cac6fb (diff)
Bluetooth: hci_uart: Add Atheros support for address configuration
The Atheros support for missing the support for configuration of the Bluetooth public address. Add support for the vendor specific command. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--drivers/bluetooth/hci_ath.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c
index 42f13d0b437f..ec8fa0e0f036 100644
--- a/drivers/bluetooth/hci_ath.c
+++ b/drivers/bluetooth/hci_ath.c
@@ -144,6 +144,39 @@ static int ath_flush(struct hci_uart *hu)
144 return 0; 144 return 0;
145} 145}
146 146
147static int ath_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
148{
149 struct sk_buff *skb;
150 u8 buf[10];
151 int err;
152
153 buf[0] = 0x01;
154 buf[1] = 0x01;
155 buf[2] = 0x00;
156 buf[3] = sizeof(bdaddr_t);
157 memcpy(buf + 4, bdaddr, sizeof(bdaddr_t));
158
159 skb = __hci_cmd_sync(hdev, 0xfc0b, sizeof(buf), buf, HCI_INIT_TIMEOUT);
160 if (IS_ERR(skb)) {
161 err = PTR_ERR(skb);
162 BT_ERR("%s: Change address command failed (%d)",
163 hdev->name, err);
164 return err;
165 }
166 kfree_skb(skb);
167
168 return 0;
169}
170
171static int ath_setup(struct hci_uart *hu)
172{
173 BT_DBG("hu %p", hu);
174
175 hu->hdev->set_bdaddr = ath_set_bdaddr;
176
177 return 0;
178}
179
147static const struct h4_recv_pkt ath_recv_pkts[] = { 180static const struct h4_recv_pkt ath_recv_pkts[] = {
148 { H4_RECV_ACL, .recv = hci_recv_frame }, 181 { H4_RECV_ACL, .recv = hci_recv_frame },
149 { H4_RECV_SCO, .recv = hci_recv_frame }, 182 { H4_RECV_SCO, .recv = hci_recv_frame },
@@ -212,6 +245,7 @@ static const struct hci_uart_proto athp = {
212 .open = ath_open, 245 .open = ath_open,
213 .close = ath_close, 246 .close = ath_close,
214 .flush = ath_flush, 247 .flush = ath_flush,
248 .setup = ath_setup,
215 .recv = ath_recv, 249 .recv = ath_recv,
216 .enqueue = ath_enqueue, 250 .enqueue = ath_enqueue,
217 .dequeue = ath_dequeue, 251 .dequeue = ath_dequeue,