summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@openbossa.org>2012-04-24 21:02:54 -0300
committerGustavo Padovan <gustavo@padovan.org>2012-05-09 01:40:45 -0300
commitb12f62cfd9f46ac70013ce661640174b489efd39 (patch)
tree5ad852475d40051fa86fe613d2b9990cd816656b /net/bluetooth/hci_conn.c
parent31f7956c6648fbae9c9550e91d1c348d28276309 (diff)
downloadop-kernel-dev-b12f62cfd9f46ac70013ce661640174b489efd39.zip
op-kernel-dev-b12f62cfd9f46ac70013ce661640174b489efd39.tar.gz
Bluetooth: Add dst_type parameter to hci_connect
This patch adds the dst_type parameter to hci_connect function. Instead of searching the address type in advertising cache, we use the dst_type parameter to establish LE connections. The dst_type is ignored for BR/EDR connection establishment. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Acked-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 8f352cd..a3ee1a9 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -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);
}
OpenPOWER on IntegriCloud