diff options
author | Andre Guedes <andre.guedes@openbossa.org> | 2011-06-30 18:20:56 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-07-06 18:10:45 -0400 |
commit | 2e65c9d2c5206eb24439f2dd2daa2f6702df358e (patch) | |
tree | 99616f3fc5479315ed288eb17841053d9277f572 /net | |
parent | eead27da60df80a112d1ac3ea482226e9794c26b (diff) |
Bluetooth: Remove enable_smp parameter
The enable_smp parameter is no longer needed. It can be replaced by
checking lmp_host_le_capable.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_core.c | 15 | ||||
-rw-r--r-- | net/bluetooth/smp.c | 9 |
2 files changed, 10 insertions, 14 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 886cc44e1717..270933523097 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -60,8 +60,6 @@ static void hci_tx_task(unsigned long arg); | |||
60 | 60 | ||
61 | static DEFINE_RWLOCK(hci_task_lock); | 61 | static DEFINE_RWLOCK(hci_task_lock); |
62 | 62 | ||
63 | static int enable_smp; | ||
64 | |||
65 | /* HCI device list */ | 63 | /* HCI device list */ |
66 | LIST_HEAD(hci_dev_list); | 64 | LIST_HEAD(hci_dev_list); |
67 | DEFINE_RWLOCK(hci_dev_list_lock); | 65 | DEFINE_RWLOCK(hci_dev_list_lock); |
@@ -1368,14 +1366,6 @@ int hci_add_adv_entry(struct hci_dev *hdev, | |||
1368 | return 0; | 1366 | return 0; |
1369 | } | 1367 | } |
1370 | 1368 | ||
1371 | static struct crypto_blkcipher *alloc_cypher(void) | ||
1372 | { | ||
1373 | if (enable_smp) | ||
1374 | return crypto_alloc_blkcipher("ecb(aes)", 0, CRYPTO_ALG_ASYNC); | ||
1375 | |||
1376 | return ERR_PTR(-ENOTSUPP); | ||
1377 | } | ||
1378 | |||
1379 | /* Register HCI device */ | 1369 | /* Register HCI device */ |
1380 | int hci_register_dev(struct hci_dev *hdev) | 1370 | int hci_register_dev(struct hci_dev *hdev) |
1381 | { | 1371 | { |
@@ -1460,7 +1450,7 @@ int hci_register_dev(struct hci_dev *hdev) | |||
1460 | if (!hdev->workqueue) | 1450 | if (!hdev->workqueue) |
1461 | goto nomem; | 1451 | goto nomem; |
1462 | 1452 | ||
1463 | hdev->tfm = alloc_cypher(); | 1453 | hdev->tfm = crypto_alloc_blkcipher("ecb(aes)", 0, CRYPTO_ALG_ASYNC); |
1464 | if (IS_ERR(hdev->tfm)) | 1454 | if (IS_ERR(hdev->tfm)) |
1465 | BT_INFO("Failed to load transform for ecb(aes): %ld", | 1455 | BT_INFO("Failed to load transform for ecb(aes): %ld", |
1466 | PTR_ERR(hdev->tfm)); | 1456 | PTR_ERR(hdev->tfm)); |
@@ -2352,6 +2342,3 @@ static void hci_cmd_task(unsigned long arg) | |||
2352 | } | 2342 | } |
2353 | } | 2343 | } |
2354 | } | 2344 | } |
2355 | |||
2356 | module_param(enable_smp, bool, 0644); | ||
2357 | MODULE_PARM_DESC(enable_smp, "Enable SMP support (LE only)"); | ||
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index a36f8707d964..ba55bd4b5dda 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -434,6 +434,9 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level) | |||
434 | 434 | ||
435 | BT_DBG("conn %p hcon %p level 0x%2.2x", conn, hcon, sec_level); | 435 | BT_DBG("conn %p hcon %p level 0x%2.2x", conn, hcon, sec_level); |
436 | 436 | ||
437 | if (!lmp_host_le_capable(hcon->hdev)) | ||
438 | return 1; | ||
439 | |||
437 | if (IS_ERR(hcon->hdev->tfm)) | 440 | if (IS_ERR(hcon->hdev->tfm)) |
438 | return 1; | 441 | return 1; |
439 | 442 | ||
@@ -477,6 +480,12 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb) | |||
477 | __u8 reason; | 480 | __u8 reason; |
478 | int err = 0; | 481 | int err = 0; |
479 | 482 | ||
483 | if (!lmp_host_le_capable(conn->hcon->hdev)) { | ||
484 | err = -ENOTSUPP; | ||
485 | reason = SMP_PAIRING_NOTSUPP; | ||
486 | goto done; | ||
487 | } | ||
488 | |||
480 | if (IS_ERR(conn->hcon->hdev->tfm)) { | 489 | if (IS_ERR(conn->hcon->hdev->tfm)) { |
481 | err = PTR_ERR(conn->hcon->hdev->tfm); | 490 | err = PTR_ERR(conn->hcon->hdev->tfm); |
482 | reason = SMP_PAIRING_NOTSUPP; | 491 | reason = SMP_PAIRING_NOTSUPP; |