aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-06 06:41:15 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2014-07-06 07:46:15 -0400
commit09ae260ba452c2ed36ec295941a58cb75db213ed (patch)
tree55b108d9a368ee131a6e7e723c26ea65e0f56f10 /net/bluetooth/hci_conn.c
parent5ea234d3e5ff9b6e5c82bde5979307213dde249d (diff)
Bluetooth: Use lower timeout for LE auto-connections
When we establish connections as a consequence of receiving an advertising report it makes no sense to wait the normal 20 second LE connection timeout. This patch modifies the hci_connect_le function to take an extra timeout value and uses a lower 2 second timeout for the auto-connection case. This timeout is intentionally chosen to be just a bit higher than the 1.28 second timeout that High Duty Cycle Advertising uses. Signed-off-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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 0d579d036833..faa032fcdaee 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -700,7 +700,8 @@ static void hci_req_directed_advertising(struct hci_request *req,
700} 700}
701 701
702struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst, 702struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
703 u8 dst_type, u8 sec_level, u8 auth_type) 703 u8 dst_type, u8 sec_level, u8 auth_type,
704 u16 conn_timeout)
704{ 705{
705 struct hci_conn_params *params; 706 struct hci_conn_params *params;
706 struct hci_conn *conn; 707 struct hci_conn *conn;
@@ -758,6 +759,7 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
758 conn->sec_level = BT_SECURITY_LOW; 759 conn->sec_level = BT_SECURITY_LOW;
759 conn->pending_sec_level = sec_level; 760 conn->pending_sec_level = sec_level;
760 conn->auth_type = auth_type; 761 conn->auth_type = auth_type;
762 conn->conn_timeout = conn_timeout;
761 763
762 hci_req_init(&req, hdev); 764 hci_req_init(&req, hdev);
763 765