aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/smp.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-02-28 05:54:17 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-02-28 10:53:08 -0500
commitb1cd5fd937e692276ac6c085684afb16a4e6e798 (patch)
treebc953a7e35923e614510ddebbe08a6ec76e3120f /net/bluetooth/smp.c
parentcb1d68f7a337142e283ef7fc78793a57ffb4cdc3 (diff)
Bluetooth: Use hdev->init/resp_addr values for smp_c1 function
Now that we have nicely tracked values of the initiator and responder address information we can pass that directly to the smp_c1 function without worrying e.g. about who initiated the connection. This patch updates the two places in smp.c to use the new variables. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r--net/bluetooth/smp.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index f1cb6a32e93f..4f4ff36f5f34 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -445,14 +445,9 @@ static void confirm_work(struct work_struct *work)
445 /* Prevent mutual access to hdev->tfm_aes */ 445 /* Prevent mutual access to hdev->tfm_aes */
446 hci_dev_lock(hdev); 446 hci_dev_lock(hdev);
447 447
448 if (conn->hcon->out) 448 ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp,
449 ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp, 449 conn->hcon->init_addr_type, &conn->hcon->init_addr,
450 conn->hcon->src_type, &conn->hcon->src, 450 conn->hcon->resp_addr_type, &conn->hcon->resp_addr, res);
451 conn->hcon->dst_type, &conn->hcon->dst, res);
452 else
453 ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp,
454 conn->hcon->dst_type, &conn->hcon->dst,
455 conn->hcon->src_type, &conn->hcon->src, res);
456 451
457 hci_dev_unlock(hdev); 452 hci_dev_unlock(hdev);
458 453
@@ -492,14 +487,9 @@ static void random_work(struct work_struct *work)
492 /* Prevent mutual access to hdev->tfm_aes */ 487 /* Prevent mutual access to hdev->tfm_aes */
493 hci_dev_lock(hdev); 488 hci_dev_lock(hdev);
494 489
495 if (hcon->out) 490 ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp,
496 ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp, 491 hcon->init_addr_type, &hcon->init_addr,
497 hcon->src_type, &hcon->src, 492 hcon->resp_addr_type, &hcon->resp_addr, res);
498 hcon->dst_type, &hcon->dst, res);
499 else
500 ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp,
501 hcon->dst_type, &hcon->dst,
502 hcon->src_type, &hcon->src, res);
503 493
504 hci_dev_unlock(hdev); 494 hci_dev_unlock(hdev);
505 495