Bluetooth: Use hdev->init/resp_addr values for smp_c1 function
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 28 Feb 2014 10:54:17 +0000 (12:54 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 28 Feb 2014 15:53:08 +0000 (07:53 -0800)
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>
net/bluetooth/smp.c

index f1cb6a32e93f1ea6f6d5276dab055fa33f49f86f..4f4ff36f5f34c539808fb027a78b3e8b17236b5e 100644 (file)
@@ -445,14 +445,9 @@ static void confirm_work(struct work_struct *work)
        /* Prevent mutual access to hdev->tfm_aes */
        hci_dev_lock(hdev);
 
-       if (conn->hcon->out)
-               ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp,
-                            conn->hcon->src_type, &conn->hcon->src,
-                            conn->hcon->dst_type, &conn->hcon->dst, res);
-       else
-               ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp,
-                            conn->hcon->dst_type, &conn->hcon->dst,
-                            conn->hcon->src_type, &conn->hcon->src, res);
+       ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp,
+                    conn->hcon->init_addr_type, &conn->hcon->init_addr,
+                    conn->hcon->resp_addr_type, &conn->hcon->resp_addr, res);
 
        hci_dev_unlock(hdev);
 
@@ -492,14 +487,9 @@ static void random_work(struct work_struct *work)
        /* Prevent mutual access to hdev->tfm_aes */
        hci_dev_lock(hdev);
 
-       if (hcon->out)
-               ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp,
-                            hcon->src_type, &hcon->src,
-                            hcon->dst_type, &hcon->dst, res);
-       else
-               ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp,
-                            hcon->dst_type, &hcon->dst,
-                            hcon->src_type, &hcon->src, res);
+       ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp,
+                    hcon->init_addr_type, &hcon->init_addr,
+                    hcon->resp_addr_type, &hcon->resp_addr, res);
 
        hci_dev_unlock(hdev);