|
@@ -513,7 +513,8 @@ EXPORT_SYMBOL(hci_get_route);
|
|
|
|
|
|
/* Create SCO, ACL or LE connection.
|
|
|
* Device _must_ be locked */
|
|
|
-struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 sec_level, __u8 auth_type)
|
|
|
+struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
|
|
|
+ __u8 dst_type, __u8 sec_level, __u8 auth_type)
|
|
|
{
|
|
|
struct hci_conn *acl;
|
|
|
struct hci_conn *sco;
|
|
@@ -522,19 +523,13 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
|
|
|
BT_DBG("%s dst %s", hdev->name, batostr(dst));
|
|
|
|
|
|
if (type == LE_LINK) {
|
|
|
- struct adv_entry *entry = NULL;
|
|
|
-
|
|
|
le = hci_conn_hash_lookup_ba(hdev, LE_LINK, dst);
|
|
|
if (!le) {
|
|
|
- entry = hci_find_adv_entry(hdev, dst);
|
|
|
- if (!entry)
|
|
|
- return ERR_PTR(-EHOSTUNREACH);
|
|
|
-
|
|
|
le = hci_conn_add(hdev, LE_LINK, dst);
|
|
|
if (!le)
|
|
|
return ERR_PTR(-ENOMEM);
|
|
|
|
|
|
- le->dst_type = entry->bdaddr_type;
|
|
|
+ le->dst_type = bdaddr_to_le(dst_type);
|
|
|
hci_le_connect(le);
|
|
|
}
|
|
|
|