Merge tag 'for-5.2-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
[linux-block.git] / net / bluetooth / amp.c
CommitLineData
903e4541
AE
1/*
2 Copyright (c) 2011,2012 Intel Corp.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License version 2 and
6 only version 2 as published by the Free Software Foundation.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12*/
13
14#include <net/bluetooth/bluetooth.h>
15#include <net/bluetooth/hci.h>
16#include <net/bluetooth/hci_core.h>
ba221bba 17#include <crypto/hash.h>
903e4541 18
b3d39140 19#include "hci_request.h"
7024728e 20#include "a2mp.h"
7ef9fbf0
MH
21#include "amp.h"
22
52c0d6e5 23/* Remote AMP Controllers interface */
0b26ab9d 24void amp_ctrl_get(struct amp_ctrl *ctrl)
52c0d6e5
AE
25{
26 BT_DBG("ctrl %p orig refcnt %d", ctrl,
2c935bc5 27 kref_read(&ctrl->kref));
52c0d6e5
AE
28
29 kref_get(&ctrl->kref);
30}
31
32static void amp_ctrl_destroy(struct kref *kref)
33{
34 struct amp_ctrl *ctrl = container_of(kref, struct amp_ctrl, kref);
35
36 BT_DBG("ctrl %p", ctrl);
37
38 kfree(ctrl->assoc);
39 kfree(ctrl);
40}
41
42int amp_ctrl_put(struct amp_ctrl *ctrl)
43{
44 BT_DBG("ctrl %p orig refcnt %d", ctrl,
2c935bc5 45 kref_read(&ctrl->kref));
52c0d6e5
AE
46
47 return kref_put(&ctrl->kref, &amp_ctrl_destroy);
48}
49
fa4ebc66 50struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id)
52c0d6e5
AE
51{
52 struct amp_ctrl *ctrl;
53
54 ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
55 if (!ctrl)
56 return NULL;
57
fa4ebc66
AE
58 kref_init(&ctrl->kref);
59 ctrl->id = id;
60
52c0d6e5
AE
61 mutex_lock(&mgr->amp_ctrls_lock);
62 list_add(&ctrl->list, &mgr->amp_ctrls);
63 mutex_unlock(&mgr->amp_ctrls_lock);
64
52c0d6e5
AE
65 BT_DBG("mgr %p ctrl %p", mgr, ctrl);
66
67 return ctrl;
68}
69
70void amp_ctrl_list_flush(struct amp_mgr *mgr)
71{
72 struct amp_ctrl *ctrl, *n;
73
74 BT_DBG("mgr %p", mgr);
75
76 mutex_lock(&mgr->amp_ctrls_lock);
77 list_for_each_entry_safe(ctrl, n, &mgr->amp_ctrls, list) {
78 list_del(&ctrl->list);
79 amp_ctrl_put(ctrl);
80 }
81 mutex_unlock(&mgr->amp_ctrls_lock);
82}
83
84struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id)
85{
86 struct amp_ctrl *ctrl;
87
88 BT_DBG("mgr %p id %d", mgr, id);
89
90 mutex_lock(&mgr->amp_ctrls_lock);
91 list_for_each_entry(ctrl, &mgr->amp_ctrls, list) {
92 if (ctrl->id == id) {
93 amp_ctrl_get(ctrl);
94 mutex_unlock(&mgr->amp_ctrls_lock);
95 return ctrl;
96 }
97 }
98 mutex_unlock(&mgr->amp_ctrls_lock);
99
100 return NULL;
101}
102
3161ae1c
AE
103/* Physical Link interface */
104static u8 __next_handle(struct amp_mgr *mgr)
105{
106 if (++mgr->handle == 0)
107 mgr->handle = 1;
108
109 return mgr->handle;
110}
111
112struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr,
a0c234fe 113 u8 remote_id, bool out)
3161ae1c 114{
bdc8ead2 115 bdaddr_t *dst = &mgr->l2cap_conn->hcon->dst;
3161ae1c 116 struct hci_conn *hcon;
a5c4e309 117 u8 role = out ? HCI_ROLE_MASTER : HCI_ROLE_SLAVE;
3161ae1c 118
a5c4e309 119 hcon = hci_conn_add(hdev, AMP_LINK, dst, role);
3161ae1c
AE
120 if (!hcon)
121 return NULL;
122
a0c234fe
AE
123 BT_DBG("hcon %p dst %pMR", hcon, dst);
124
3161ae1c 125 hcon->state = BT_CONNECT;
3161ae1c
AE
126 hcon->attempt++;
127 hcon->handle = __next_handle(mgr);
128 hcon->remote_id = remote_id;
f706adfe 129 hcon->amp_mgr = amp_mgr_get(mgr);
3161ae1c
AE
130
131 return hcon;
132}
133
ba221bba
DK
134/* AMP crypto key generation interface */
135static int hmac_sha256(u8 *key, u8 ksize, char *plaintext, u8 psize, u8 *output)
136{
ba221bba 137 struct crypto_shash *tfm;
252670c4 138 struct shash_desc *shash;
0a961a44 139 int ret;
ba221bba
DK
140
141 if (!ksize)
142 return -EINVAL;
143
144 tfm = crypto_alloc_shash("hmac(sha256)", 0, 0);
145 if (IS_ERR(tfm)) {
146 BT_DBG("crypto_alloc_ahash failed: err %ld", PTR_ERR(tfm));
147 return PTR_ERR(tfm);
148 }
149
150 ret = crypto_shash_setkey(tfm, key, ksize);
151 if (ret) {
152 BT_DBG("crypto_ahash_setkey failed: err %d", ret);
252670c4
JH
153 goto failed;
154 }
ba221bba 155
252670c4
JH
156 shash = kzalloc(sizeof(*shash) + crypto_shash_descsize(tfm),
157 GFP_KERNEL);
158 if (!shash) {
159 ret = -ENOMEM;
160 goto failed;
ba221bba
DK
161 }
162
252670c4 163 shash->tfm = tfm;
252670c4
JH
164
165 ret = crypto_shash_digest(shash, plaintext, psize, output);
166
167 kfree(shash);
168
169failed:
ba221bba
DK
170 crypto_free_shash(tfm);
171 return ret;
172}
173
5a349186
AE
174int phylink_gen_key(struct hci_conn *conn, u8 *data, u8 *len, u8 *type)
175{
176 struct hci_dev *hdev = conn->hdev;
177 struct link_key *key;
178 u8 keybuf[HCI_AMP_LINK_KEY_SIZE];
179 u8 gamp_key[HCI_AMP_LINK_KEY_SIZE];
180 int err;
181
182 if (!hci_conn_check_link_mode(conn))
183 return -EACCES;
184
185 BT_DBG("conn %p key_type %d", conn, conn->key_type);
186
187 /* Legacy key */
188 if (conn->key_type < 3) {
2064ee33 189 bt_dev_err(hdev, "legacy key type %d", conn->key_type);
5a349186
AE
190 return -EACCES;
191 }
192
193 *type = conn->key_type;
194 *len = HCI_AMP_LINK_KEY_SIZE;
195
196 key = hci_find_link_key(hdev, &conn->dst);
079db0c6
AE
197 if (!key) {
198 BT_DBG("No Link key for conn %p dst %pMR", conn, &conn->dst);
199 return -EACCES;
200 }
5a349186
AE
201
202 /* BR/EDR Link Key concatenated together with itself */
203 memcpy(&keybuf[0], key->val, HCI_LINK_KEY_SIZE);
204 memcpy(&keybuf[HCI_LINK_KEY_SIZE], key->val, HCI_LINK_KEY_SIZE);
205
206 /* Derive Generic AMP Link Key (gamp) */
207 err = hmac_sha256(keybuf, HCI_AMP_LINK_KEY_SIZE, "gamp", 4, gamp_key);
208 if (err) {
2064ee33 209 bt_dev_err(hdev, "could not derive Generic AMP Key: err %d", err);
5a349186
AE
210 return err;
211 }
212
213 if (conn->key_type == HCI_LK_DEBUG_COMBINATION) {
214 BT_DBG("Use Generic AMP Key (gamp)");
215 memcpy(data, gamp_key, HCI_AMP_LINK_KEY_SIZE);
216 return err;
217 }
218
219 /* Derive Dedicated AMP Link Key: "802b" is 802.11 PAL keyID */
220 return hmac_sha256(gamp_key, HCI_AMP_LINK_KEY_SIZE, "802b", 4, data);
221}
222
b3d39140
AW
223static void read_local_amp_assoc_complete(struct hci_dev *hdev, u8 status,
224 u16 opcode, struct sk_buff *skb)
225{
226 struct hci_rp_read_local_amp_assoc *rp = (void *)skb->data;
227 struct amp_assoc *assoc = &hdev->loc_assoc;
228 size_t rem_len, frag_len;
229
230 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
231
232 if (rp->status)
233 goto send_rsp;
234
235 frag_len = skb->len - sizeof(*rp);
236 rem_len = __le16_to_cpu(rp->rem_len);
237
238 if (rem_len > frag_len) {
239 BT_DBG("frag_len %zu rem_len %zu", frag_len, rem_len);
240
241 memcpy(assoc->data + assoc->offset, rp->frag, frag_len);
242 assoc->offset += frag_len;
243
244 /* Read other fragments */
245 amp_read_loc_assoc_frag(hdev, rp->phy_handle);
246
247 return;
248 }
249
250 memcpy(assoc->data + assoc->offset, rp->frag, rem_len);
251 assoc->len = assoc->offset + rem_len;
252 assoc->offset = 0;
253
254send_rsp:
255 /* Send A2MP Rsp when all fragments are received */
256 a2mp_send_getampassoc_rsp(hdev, rp->status);
257 a2mp_send_create_phy_link_req(hdev, rp->status);
258}
259
903e4541
AE
260void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle)
261{
262 struct hci_cp_read_local_amp_assoc cp;
263 struct amp_assoc *loc_assoc = &hdev->loc_assoc;
b3d39140 264 struct hci_request req;
cd50361c 265 int err;
903e4541
AE
266
267 BT_DBG("%s handle %d", hdev->name, phy_handle);
268
269 cp.phy_handle = phy_handle;
270 cp.max_len = cpu_to_le16(hdev->amp_assoc_size);
271 cp.len_so_far = cpu_to_le16(loc_assoc->offset);
272
b3d39140
AW
273 hci_req_init(&req, hdev);
274 hci_req_add(&req, HCI_OP_READ_LOCAL_AMP_ASSOC, sizeof(cp), &cp);
275 err = hci_req_run_skb(&req, read_local_amp_assoc_complete);
276 if (err < 0)
277 a2mp_send_getampassoc_rsp(hdev, A2MP_STATUS_INVALID_CTRL_ID);
903e4541
AE
278}
279
280void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr)
281{
282 struct hci_cp_read_local_amp_assoc cp;
b3d39140 283 struct hci_request req;
cd50361c 284 int err;
903e4541
AE
285
286 memset(&hdev->loc_assoc, 0, sizeof(struct amp_assoc));
287 memset(&cp, 0, sizeof(cp));
288
289 cp.max_len = cpu_to_le16(hdev->amp_assoc_size);
290
cb6801c6 291 set_bit(READ_LOC_AMP_ASSOC, &mgr->state);
b3d39140
AW
292 hci_req_init(&req, hdev);
293 hci_req_add(&req, HCI_OP_READ_LOCAL_AMP_ASSOC, sizeof(cp), &cp);
cd50361c 294 err = hci_req_run_skb(&req, read_local_amp_assoc_complete);
b3d39140
AW
295 if (err < 0)
296 a2mp_send_getampassoc_rsp(hdev, A2MP_STATUS_INVALID_CTRL_ID);
903e4541 297}
a02226d6 298
9495b2ee
AE
299void amp_read_loc_assoc_final_data(struct hci_dev *hdev,
300 struct hci_conn *hcon)
301{
302 struct hci_cp_read_local_amp_assoc cp;
303 struct amp_mgr *mgr = hcon->amp_mgr;
b3d39140 304 struct hci_request req;
cd50361c 305 int err;
9495b2ee
AE
306
307 cp.phy_handle = hcon->handle;
308 cp.len_so_far = cpu_to_le16(0);
309 cp.max_len = cpu_to_le16(hdev->amp_assoc_size);
310
cb6801c6 311 set_bit(READ_LOC_AMP_ASSOC_FINAL, &mgr->state);
9495b2ee
AE
312
313 /* Read Local AMP Assoc final link information data */
b3d39140
AW
314 hci_req_init(&req, hdev);
315 hci_req_add(&req, HCI_OP_READ_LOCAL_AMP_ASSOC, sizeof(cp), &cp);
cd50361c 316 err = hci_req_run_skb(&req, read_local_amp_assoc_complete);
b3d39140
AW
317 if (err < 0)
318 a2mp_send_getampassoc_rsp(hdev, A2MP_STATUS_INVALID_CTRL_ID);
319}
320
321static void write_remote_amp_assoc_complete(struct hci_dev *hdev, u8 status,
322 u16 opcode, struct sk_buff *skb)
323{
324 struct hci_rp_write_remote_amp_assoc *rp = (void *)skb->data;
325
326 BT_DBG("%s status 0x%2.2x phy_handle 0x%2.2x",
327 hdev->name, rp->status, rp->phy_handle);
328
329 if (rp->status)
330 return;
331
332 amp_write_rem_assoc_continue(hdev, rp->phy_handle);
9495b2ee 333}
93c284ee
AE
334
335/* Write AMP Assoc data fragments, returns true with last fragment written*/
336static bool amp_write_rem_assoc_frag(struct hci_dev *hdev,
337 struct hci_conn *hcon)
338{
339 struct hci_cp_write_remote_amp_assoc *cp;
340 struct amp_mgr *mgr = hcon->amp_mgr;
341 struct amp_ctrl *ctrl;
b3d39140 342 struct hci_request req;
93c284ee
AE
343 u16 frag_len, len;
344
345 ctrl = amp_ctrl_lookup(mgr, hcon->remote_id);
346 if (!ctrl)
347 return false;
348
349 if (!ctrl->assoc_rem_len) {
350 BT_DBG("all fragments are written");
351 ctrl->assoc_rem_len = ctrl->assoc_len;
352 ctrl->assoc_len_so_far = 0;
353
354 amp_ctrl_put(ctrl);
355 return true;
356 }
357
358 frag_len = min_t(u16, 248, ctrl->assoc_rem_len);
359 len = frag_len + sizeof(*cp);
360
361 cp = kzalloc(len, GFP_KERNEL);
362 if (!cp) {
363 amp_ctrl_put(ctrl);
364 return false;
365 }
366
367 BT_DBG("hcon %p ctrl %p frag_len %u assoc_len %u rem_len %u",
368 hcon, ctrl, frag_len, ctrl->assoc_len, ctrl->assoc_rem_len);
369
370 cp->phy_handle = hcon->handle;
371 cp->len_so_far = cpu_to_le16(ctrl->assoc_len_so_far);
372 cp->rem_len = cpu_to_le16(ctrl->assoc_rem_len);
373 memcpy(cp->frag, ctrl->assoc, frag_len);
374
375 ctrl->assoc_len_so_far += frag_len;
376 ctrl->assoc_rem_len -= frag_len;
377
378 amp_ctrl_put(ctrl);
379
b3d39140 380 hci_req_init(&req, hdev);
0208bc88 381 hci_req_add(&req, HCI_OP_WRITE_REMOTE_AMP_ASSOC, len, cp);
b3d39140 382 hci_req_run_skb(&req, write_remote_amp_assoc_complete);
93c284ee
AE
383
384 kfree(cp);
385
386 return false;
387}
388
389void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle)
390{
391 struct hci_conn *hcon;
392
393 BT_DBG("%s phy handle 0x%2.2x", hdev->name, handle);
394
395 hcon = hci_conn_hash_lookup_handle(hdev, handle);
396 if (!hcon)
397 return;
398
8e05e3ba
AE
399 /* Send A2MP create phylink rsp when all fragments are written */
400 if (amp_write_rem_assoc_frag(hdev, hcon))
401 a2mp_send_create_phy_link_rsp(hdev, 0);
93c284ee
AE
402}
403
404void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle)
405{
406 struct hci_conn *hcon;
407
408 BT_DBG("%s phy handle 0x%2.2x", hdev->name, handle);
409
410 hcon = hci_conn_hash_lookup_handle(hdev, handle);
411 if (!hcon)
412 return;
413
414 BT_DBG("%s phy handle 0x%2.2x hcon %p", hdev->name, handle, hcon);
415
416 amp_write_rem_assoc_frag(hdev, hcon);
417}
418
df9b89c7
AW
419static void create_phylink_complete(struct hci_dev *hdev, u8 status,
420 u16 opcode)
421{
422 struct hci_cp_create_phy_link *cp;
423
424 BT_DBG("%s status 0x%2.2x", hdev->name, status);
425
426 cp = hci_sent_cmd_data(hdev, HCI_OP_CREATE_PHY_LINK);
427 if (!cp)
428 return;
429
430 hci_dev_lock(hdev);
431
432 if (status) {
433 struct hci_conn *hcon;
434
435 hcon = hci_conn_hash_lookup_handle(hdev, cp->phy_handle);
436 if (hcon)
437 hci_conn_del(hcon);
438 } else {
439 amp_write_remote_assoc(hdev, cp->phy_handle);
440 }
441
442 hci_dev_unlock(hdev);
443}
444
a02226d6
AE
445void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
446 struct hci_conn *hcon)
447{
448 struct hci_cp_create_phy_link cp;
df9b89c7 449 struct hci_request req;
a02226d6
AE
450
451 cp.phy_handle = hcon->handle;
452
453 BT_DBG("%s hcon %p phy handle 0x%2.2x", hdev->name, hcon,
454 hcon->handle);
455
456 if (phylink_gen_key(mgr->l2cap_conn->hcon, cp.key, &cp.key_len,
457 &cp.key_type)) {
458 BT_DBG("Cannot create link key");
459 return;
460 }
461
df9b89c7
AW
462 hci_req_init(&req, hdev);
463 hci_req_add(&req, HCI_OP_CREATE_PHY_LINK, sizeof(cp), &cp);
464 hci_req_run(&req, create_phylink_complete);
465}
466
467static void accept_phylink_complete(struct hci_dev *hdev, u8 status,
468 u16 opcode)
469{
470 struct hci_cp_accept_phy_link *cp;
471
472 BT_DBG("%s status 0x%2.2x", hdev->name, status);
473
474 if (status)
475 return;
476
477 cp = hci_sent_cmd_data(hdev, HCI_OP_ACCEPT_PHY_LINK);
478 if (!cp)
479 return;
480
481 amp_write_remote_assoc(hdev, cp->phy_handle);
a02226d6 482}
dffa3871
AE
483
484void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
485 struct hci_conn *hcon)
486{
487 struct hci_cp_accept_phy_link cp;
df9b89c7 488 struct hci_request req;
dffa3871
AE
489
490 cp.phy_handle = hcon->handle;
491
492 BT_DBG("%s hcon %p phy handle 0x%2.2x", hdev->name, hcon,
493 hcon->handle);
494
495 if (phylink_gen_key(mgr->l2cap_conn->hcon, cp.key, &cp.key_len,
496 &cp.key_type)) {
497 BT_DBG("Cannot create link key");
498 return;
499 }
500
df9b89c7
AW
501 hci_req_init(&req, hdev);
502 hci_req_add(&req, HCI_OP_ACCEPT_PHY_LINK, sizeof(cp), &cp);
503 hci_req_run(&req, accept_phylink_complete);
dffa3871 504}
5ce66b59 505
cf70ff22
AE
506void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon)
507{
508 struct hci_dev *bredr_hdev = hci_dev_hold(bredr_hcon->hdev);
509 struct amp_mgr *mgr = hs_hcon->amp_mgr;
510 struct l2cap_chan *bredr_chan;
511
512 BT_DBG("bredr_hcon %p hs_hcon %p mgr %p", bredr_hcon, hs_hcon, mgr);
513
514 if (!bredr_hdev || !mgr || !mgr->bredr_chan)
515 return;
516
517 bredr_chan = mgr->bredr_chan;
518
a514b17f
AE
519 l2cap_chan_lock(bredr_chan);
520
cf70ff22 521 set_bit(FLAG_EFS_ENABLE, &bredr_chan->flags);
fffadc08 522 bredr_chan->remote_amp_id = hs_hcon->remote_id;
37295996 523 bredr_chan->local_amp_id = hs_hcon->hdev->id;
cf70ff22
AE
524 bredr_chan->hs_hcon = hs_hcon;
525 bredr_chan->conn->mtu = hs_hcon->hdev->block_mtu;
cf70ff22 526
a514b17f
AE
527 __l2cap_physical_cfm(bredr_chan, 0);
528
529 l2cap_chan_unlock(bredr_chan);
cf70ff22
AE
530
531 hci_dev_put(bredr_hdev);
532}
533
5ce66b59
AE
534void amp_create_logical_link(struct l2cap_chan *chan)
535{
7a9898c6 536 struct hci_conn *hs_hcon = chan->hs_hcon;
5ce66b59 537 struct hci_cp_create_accept_logical_link cp;
5ce66b59
AE
538 struct hci_dev *hdev;
539
bdc8ead2
MH
540 BT_DBG("chan %p hs_hcon %p dst %pMR", chan, hs_hcon,
541 &chan->conn->hcon->dst);
5ce66b59 542
7a9898c6 543 if (!hs_hcon)
5ce66b59
AE
544 return;
545
546 hdev = hci_dev_hold(chan->hs_hcon->hdev);
547 if (!hdev)
548 return;
549
7a9898c6 550 cp.phy_handle = hs_hcon->handle;
5ce66b59
AE
551
552 cp.tx_flow_spec.id = chan->local_id;
553 cp.tx_flow_spec.stype = chan->local_stype;
554 cp.tx_flow_spec.msdu = cpu_to_le16(chan->local_msdu);
555 cp.tx_flow_spec.sdu_itime = cpu_to_le32(chan->local_sdu_itime);
556 cp.tx_flow_spec.acc_lat = cpu_to_le32(chan->local_acc_lat);
557 cp.tx_flow_spec.flush_to = cpu_to_le32(chan->local_flush_to);
558
559 cp.rx_flow_spec.id = chan->remote_id;
560 cp.rx_flow_spec.stype = chan->remote_stype;
561 cp.rx_flow_spec.msdu = cpu_to_le16(chan->remote_msdu);
562 cp.rx_flow_spec.sdu_itime = cpu_to_le32(chan->remote_sdu_itime);
563 cp.rx_flow_spec.acc_lat = cpu_to_le32(chan->remote_acc_lat);
564 cp.rx_flow_spec.flush_to = cpu_to_le32(chan->remote_flush_to);
565
7a9898c6 566 if (hs_hcon->out)
5ce66b59
AE
567 hci_send_cmd(hdev, HCI_OP_CREATE_LOGICAL_LINK, sizeof(cp),
568 &cp);
569 else
570 hci_send_cmd(hdev, HCI_OP_ACCEPT_LOGICAL_LINK, sizeof(cp),
571 &cp);
572
5ce66b59
AE
573 hci_dev_put(hdev);
574}
606e2a10 575
419e08c1
AE
576void amp_disconnect_logical_link(struct hci_chan *hchan)
577{
578 struct hci_conn *hcon = hchan->conn;
579 struct hci_cp_disconn_logical_link cp;
580
581 if (hcon->state != BT_CONNECTED) {
582 BT_DBG("hchan %p not connected", hchan);
583 return;
584 }
585
586 cp.log_handle = cpu_to_le16(hchan->handle);
587 hci_send_cmd(hcon->hdev, HCI_OP_DISCONN_LOGICAL_LINK, sizeof(cp), &cp);
588}
589
606e2a10
AE
590void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason)
591{
592 BT_DBG("hchan %p", hchan);
593
594 hci_chan_del(hchan);
595}