Bluetooth: Refactor HCI connection code

hci_connect() is a very simple and useless wrapper of hci_connect_acl
and hci_connect_le functions. Addtionally, all places where hci_connect
is called the link type value is passed explicitly. This way, we can
safely delete hci_connect, declare hci_connect_acl and hci_connect_le
in hci_core.h and call them directly.

No functionality is changed by this patch.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
Andre Guedes
2014-02-26 20:21:44 -03:00
committed by Marcel Holtmann
parent c99ed8343c
commit 04a6c5898e
4 changed files with 15 additions and 30 deletions

View File

@@ -2816,11 +2816,11 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
auth_type = HCI_AT_DEDICATED_BONDING_MITM;
if (cp->addr.type == BDADDR_BREDR)
conn = hci_connect(hdev, ACL_LINK, &cp->addr.bdaddr,
cp->addr.type, sec_level, auth_type);
conn = hci_connect_acl(hdev, &cp->addr.bdaddr, sec_level,
auth_type);
else
conn = hci_connect(hdev, LE_LINK, &cp->addr.bdaddr,
cp->addr.type, sec_level, auth_type);
conn = hci_connect_le(hdev, &cp->addr.bdaddr, cp->addr.type,
sec_level, auth_type);
if (IS_ERR(conn)) {
int status;