aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@openbossa.org>2013-10-03 17:25:45 -0400
committerMarcel Holtmann <marcel@holtmann.org>2013-10-04 02:07:17 -0400
commit46a190cbd3d8992a017664367e9227dcd357ce53 (patch)
tree3acc2712f8d410e9a80c2a2851a2bd45465c011a /net/bluetooth/hci_conn.c
parentf1e5d54743b99cbbea0e0cfb2b3f8053f045b3d7 (diff)
Bluetooth: Initialize hci_conn fields in hci_connect_le
This patch moves some hci_conn fields initialization from hci_le_ create_connection() to hci_connect_le(). It makes more sense to initialize these fields within the function that creates the hci_ conn object. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 5aba520cddfe..08e601c68314 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -54,11 +54,6 @@ static void hci_le_create_connection(struct hci_conn *conn)
54 struct hci_dev *hdev = conn->hdev; 54 struct hci_dev *hdev = conn->hdev;
55 struct hci_cp_le_create_conn cp; 55 struct hci_cp_le_create_conn cp;
56 56
57 conn->state = BT_CONNECT;
58 conn->out = true;
59 conn->link_mode |= HCI_LM_MASTER;
60 conn->sec_level = BT_SECURITY_LOW;
61
62 memset(&cp, 0, sizeof(cp)); 57 memset(&cp, 0, sizeof(cp));
63 cp.scan_interval = __constant_cpu_to_le16(0x0060); 58 cp.scan_interval = __constant_cpu_to_le16(0x0060);
64 cp.scan_window = __constant_cpu_to_le16(0x0030); 59 cp.scan_window = __constant_cpu_to_le16(0x0030);
@@ -565,6 +560,11 @@ static struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
565 return ERR_PTR(-ENOMEM); 560 return ERR_PTR(-ENOMEM);
566 561
567 conn->dst_type = bdaddr_to_le(dst_type); 562 conn->dst_type = bdaddr_to_le(dst_type);
563 conn->state = BT_CONNECT;
564 conn->out = true;
565 conn->link_mode |= HCI_LM_MASTER;
566 conn->sec_level = BT_SECURITY_LOW;
567
568 hci_le_create_connection(conn); 568 hci_le_create_connection(conn);
569 } 569 }
570 570