aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-09-27 10:26:23 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-09-27 16:34:38 -0400
commitdffa387110025801862d7ad09f4e850d06ff55a9 (patch)
tree347486dc16f25674c4e58729d044105fd7a7204e /net
parent9495b2ee757f7747d7c28f9ba8d7edc53005ec2d (diff)
Bluetooth: AMP: Accept Physical Link
When receiving A2MP Create Physical Link message execute HCI Accept Physical Link command to AMP controller. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/a2mp.c5
-rw-r--r--net/bluetooth/amp.c19
2 files changed, 20 insertions, 4 deletions
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index 375a67f501d0..dbfdbbb9707c 100644
--- a/net/bluetooth/a2mp.c
+++ b/net/bluetooth/a2mp.c
@@ -453,12 +453,9 @@ static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
453 goto send_rsp; 453 goto send_rsp;
454 } 454 }
455 455
456 /* TODO process physlink create */
457
458 hcon = phylink_add(hdev, mgr, req->local_id); 456 hcon = phylink_add(hdev, mgr, req->local_id);
459 if (hcon) { 457 if (hcon) {
460 BT_DBG("hcon %p", hcon); 458 amp_accept_phylink(hdev, mgr, hcon);
461
462 rsp.status = A2MP_STATUS_SUCCESS; 459 rsp.status = A2MP_STATUS_SUCCESS;
463 } else { 460 } else {
464 rsp.status = A2MP_STATUS_UNABLE_START_LINK_CREATION; 461 rsp.status = A2MP_STATUS_UNABLE_START_LINK_CREATION;
diff --git a/net/bluetooth/amp.c b/net/bluetooth/amp.c
index 4f7b2647d5e9..845e43073c40 100644
--- a/net/bluetooth/amp.c
+++ b/net/bluetooth/amp.c
@@ -346,3 +346,22 @@ void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
346 346
347 hci_send_cmd(hdev, HCI_OP_CREATE_PHY_LINK, sizeof(cp), &cp); 347 hci_send_cmd(hdev, HCI_OP_CREATE_PHY_LINK, sizeof(cp), &cp);
348} 348}
349
350void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
351 struct hci_conn *hcon)
352{
353 struct hci_cp_accept_phy_link cp;
354
355 cp.phy_handle = hcon->handle;
356
357 BT_DBG("%s hcon %p phy handle 0x%2.2x", hdev->name, hcon,
358 hcon->handle);
359
360 if (phylink_gen_key(mgr->l2cap_conn->hcon, cp.key, &cp.key_len,
361 &cp.key_type)) {
362 BT_DBG("Cannot create link key");
363 return;
364 }
365
366 hci_send_cmd(hdev, HCI_OP_ACCEPT_PHY_LINK, sizeof(cp), &cp);
367}