aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-06-29 10:43:26 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:50 -0400
commitf044eb0524a02ea7f921c9234fbdba43290da1e2 (patch)
tree98a3ac81fdefaa594f2f4bb17058b8fe278bd0d9 /net/bluetooth/hci_conn.c
parent1c1697c0cad41fa468e3cb6061ce74debb4f3733 (diff)
Bluetooth: Store latency and supervision timeout in connection params
When the slave updates the connection parameters, store also the connection latency and supervision timeout information in the internal list of connection parameters for known devices. Having these values available allowes the auto-connection procedure to use the correct values from the beginning without having to request an update on every connection establishment. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 25ee27ddc882..adb413d77637 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -216,11 +216,23 @@ bool hci_setup_sync(struct hci_conn *conn, __u16 handle)
216void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, 216void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
217 u16 latency, u16 to_multiplier) 217 u16 latency, u16 to_multiplier)
218{ 218{
219 struct hci_cp_le_conn_update cp;
220 struct hci_dev *hdev = conn->hdev; 219 struct hci_dev *hdev = conn->hdev;
220 struct hci_conn_params *params;
221 struct hci_cp_le_conn_update cp;
221 222
222 memset(&cp, 0, sizeof(cp)); 223 hci_dev_lock(hdev);
224
225 params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type);
226 if (params) {
227 params->conn_min_interval = min;
228 params->conn_max_interval = max;
229 params->conn_latency = latency;
230 params->supervision_timeout = to_multiplier;
231 }
223 232
233 hci_dev_unlock(hdev);
234
235 memset(&cp, 0, sizeof(cp));
224 cp.handle = cpu_to_le16(conn->handle); 236 cp.handle = cpu_to_le16(conn->handle);
225 cp.conn_interval_min = cpu_to_le16(min); 237 cp.conn_interval_min = cpu_to_le16(min);
226 cp.conn_interval_max = cpu_to_le16(max); 238 cp.conn_interval_max = cpu_to_le16(max);