aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-06-23 06:18:51 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:45 -0400
commit80afeb6cec3739d3167e1fef6214224f0f588f13 (patch)
treebc91edb1e23e0bbc0df4d042838778c0ec58ac21 /net/bluetooth/l2cap_core.c
parenta720d7351e2571bf7498681970b076e366a7d221 (diff)
Bluetooth: Add support LE slave connection update procedure
When the current LE connection parameters of a slave connection do not match up with the controller defined values, then trigger the connection update procedure to allow adjusting them. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index cbf6b9d1c404..565afb78296a 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1481,6 +1481,25 @@ static void l2cap_le_conn_ready(struct l2cap_conn *conn)
1481 if (hci_blacklist_lookup(hcon->hdev, &hcon->dst, dst_type)) 1481 if (hci_blacklist_lookup(hcon->hdev, &hcon->dst, dst_type))
1482 return; 1482 return;
1483 1483
1484 /* For LE slave connections, make sure the connection interval
1485 * is in the range of the minium and maximum interval that has
1486 * been configured for this connection. If not, then trigger
1487 * the connection update procedure.
1488 */
1489 if (!(hcon->link_mode & HCI_LM_MASTER) &&
1490 (hcon->le_conn_interval < hcon->le_conn_min_interval ||
1491 hcon->le_conn_interval > hcon->le_conn_max_interval)) {
1492 struct l2cap_conn_param_update_req req;
1493
1494 req.min = cpu_to_le16(hcon->le_conn_min_interval);
1495 req.max = cpu_to_le16(hcon->le_conn_max_interval);
1496 req.latency = cpu_to_le16(hcon->le_conn_latency);
1497 req.to_multiplier = cpu_to_le16(hcon->le_supv_timeout);
1498
1499 l2cap_send_cmd(conn, l2cap_get_ident(conn),
1500 L2CAP_CONN_PARAM_UPDATE_REQ, sizeof(req), &req);
1501 }
1502
1484 l2cap_chan_lock(pchan); 1503 l2cap_chan_lock(pchan);
1485 1504
1486 chan = pchan->ops->new_connection(pchan); 1505 chan = pchan->ops->new_connection(pchan);