Commit 2e65c9d2 authored by Andre Guedes's avatar Andre Guedes Committed by Gustavo F. Padovan

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: default avatarAndre Guedes <andre.guedes@openbossa.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent eead27da
...@@ -60,8 +60,6 @@ static void hci_tx_task(unsigned long arg); ...@@ -60,8 +60,6 @@ static void hci_tx_task(unsigned long arg);
static DEFINE_RWLOCK(hci_task_lock); static DEFINE_RWLOCK(hci_task_lock);
static int enable_smp;
/* HCI device list */ /* HCI device list */
LIST_HEAD(hci_dev_list); LIST_HEAD(hci_dev_list);
DEFINE_RWLOCK(hci_dev_list_lock); DEFINE_RWLOCK(hci_dev_list_lock);
...@@ -1368,14 +1366,6 @@ int hci_add_adv_entry(struct hci_dev *hdev, ...@@ -1368,14 +1366,6 @@ int hci_add_adv_entry(struct hci_dev *hdev,
return 0; return 0;
} }
static struct crypto_blkcipher *alloc_cypher(void)
{
if (enable_smp)
return crypto_alloc_blkcipher("ecb(aes)", 0, CRYPTO_ALG_ASYNC);
return ERR_PTR(-ENOTSUPP);
}
/* Register HCI device */ /* Register HCI device */
int hci_register_dev(struct hci_dev *hdev) int hci_register_dev(struct hci_dev *hdev)
{ {
...@@ -1460,7 +1450,7 @@ int hci_register_dev(struct hci_dev *hdev) ...@@ -1460,7 +1450,7 @@ int hci_register_dev(struct hci_dev *hdev)
if (!hdev->workqueue) if (!hdev->workqueue)
goto nomem; goto nomem;
hdev->tfm = alloc_cypher(); hdev->tfm = crypto_alloc_blkcipher("ecb(aes)", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(hdev->tfm)) if (IS_ERR(hdev->tfm))
BT_INFO("Failed to load transform for ecb(aes): %ld", BT_INFO("Failed to load transform for ecb(aes): %ld",
PTR_ERR(hdev->tfm)); PTR_ERR(hdev->tfm));
...@@ -2352,6 +2342,3 @@ static void hci_cmd_task(unsigned long arg) ...@@ -2352,6 +2342,3 @@ static void hci_cmd_task(unsigned long arg)
} }
} }
} }
module_param(enable_smp, bool, 0644);
MODULE_PARM_DESC(enable_smp, "Enable SMP support (LE only)");
...@@ -434,6 +434,9 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level) ...@@ -434,6 +434,9 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level)
BT_DBG("conn %p hcon %p level 0x%2.2x", conn, hcon, sec_level); BT_DBG("conn %p hcon %p level 0x%2.2x", conn, hcon, sec_level);
if (!lmp_host_le_capable(hcon->hdev))
return 1;
if (IS_ERR(hcon->hdev->tfm)) if (IS_ERR(hcon->hdev->tfm))
return 1; return 1;
...@@ -477,6 +480,12 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb) ...@@ -477,6 +480,12 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)
__u8 reason; __u8 reason;
int err = 0; int err = 0;
if (!lmp_host_le_capable(conn->hcon->hdev)) {
err = -ENOTSUPP;
reason = SMP_PAIRING_NOTSUPP;
goto done;
}
if (IS_ERR(conn->hcon->hdev->tfm)) { if (IS_ERR(conn->hcon->hdev->tfm)) {
err = PTR_ERR(conn->hcon->hdev->tfm); err = PTR_ERR(conn->hcon->hdev->tfm);
reason = SMP_PAIRING_NOTSUPP; reason = SMP_PAIRING_NOTSUPP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment