aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-06-30 06:34:40 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:51 -0400
commit7c264b10006f3c10f7a9ef314a213f9784d9ca1f (patch)
tree6bb411791dbc1d559dbc6b2ed4eb5d6d95b342bb /net
parentbf5b3c8be07905c242bb7f751dcb890b94c22d93 (diff)
Bluetooth: Add default connection parameters before pairing
When trying to pair a new Bluetooth Low Energy device, then make sure that the default connections parameters are in place before trying to establish the first connection to that device. With the connection parameters structure allocated, the slave preferred values can now easily be tracked and all future connections will use the correct values from that start decreasing connection establishment time. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/mgmt.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index e30d0ebb5018..6baba309f9e2 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2947,6 +2947,17 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
2947 else 2947 else
2948 addr_type = ADDR_LE_DEV_RANDOM; 2948 addr_type = ADDR_LE_DEV_RANDOM;
2949 2949
2950 /* When pairing a new device, it is expected to remember
2951 * this device for future connections. Adding the connection
2952 * parameter information ahead of time allows tracking
2953 * of the slave preferred values and will speed up any
2954 * further connection establishment.
2955 *
2956 * If connection parameters already exist, then they
2957 * will be kept and this function does nothing.
2958 */
2959 hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type);
2960
2950 conn = hci_connect_le(hdev, &cp->addr.bdaddr, addr_type, 2961 conn = hci_connect_le(hdev, &cp->addr.bdaddr, addr_type,
2951 sec_level, auth_type); 2962 sec_level, auth_type);
2952 } 2963 }