aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-08-08 09:32:52 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-08-14 08:49:18 +0200
commit711eafe345d993cf4831e890fa989d02c06cad62 (patch)
tree6a944b71657ef48d8df93441578ca4b2c90e71fd /net/bluetooth/hci_core.c
parentBluetooth: Move SMP initialization after HCI init (diff)
downloadlinux-dev-711eafe345d993cf4831e890fa989d02c06cad62.tar.xz
linux-dev-711eafe345d993cf4831e890fa989d02c06cad62.zip
Bluetooth: Move SMP (de)initialization to smp.c
As preparation for moving SMP to use l2cap_chan infrastructure we need to move the (de)initialization functions to smp.c (where they'll eventually need access to the local L2CAP channel callbacks). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 9eb2869b183b..88575a633601 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1764,34 +1764,6 @@ static void hci_init4_req(struct hci_request *req, unsigned long opt)
}
}
-static int hci_register_smp(struct hci_dev *hdev)
-{
- int err;
-
- BT_DBG("%s", hdev->name);
-
- hdev->tfm_aes = crypto_alloc_blkcipher("ecb(aes)", 0,
- CRYPTO_ALG_ASYNC);
- if (IS_ERR(hdev->tfm_aes)) {
- BT_ERR("Unable to create crypto context");
- err = PTR_ERR(hdev->tfm_aes);
- hdev->tfm_aes = NULL;
- return err;
- }
-
- return 0;
-}
-
-static void hci_unregister_smp(struct hci_dev *hdev)
-{
- BT_DBG("%s", hdev->name);
-
- if (hdev->tfm_aes) {
- crypto_free_blkcipher(hdev->tfm_aes);
- hdev->tfm_aes = NULL;
- }
-}
-
static int __hci_init(struct hci_dev *hdev)
{
int err;
@@ -1927,7 +1899,7 @@ static int __hci_init(struct hci_dev *hdev)
hdev->debugfs,
&hdev->discov_interleaved_timeout);
- hci_register_smp(hdev);
+ smp_register(hdev);
}
return 0;
@@ -4224,7 +4196,7 @@ void hci_unregister_dev(struct hci_dev *hdev)
rfkill_destroy(hdev->rfkill);
}
- hci_unregister_smp(hdev);
+ smp_unregister(hdev);
device_del(&hdev->dev);