Bluetooth: Set default min/max connection interval for LE slaves
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 23 Jun 2014 10:14:51 +0000 (12:14 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 3 Jul 2014 15:42:45 +0000 (17:42 +0200)
For all incoming LE connections, the minimum and maximum connection
interval is a value that should be copied from the controller default
values. This allows to properly check if the resulting connection
interval of a newly established connection is in the range we are
expecting.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_event.c

index e239435312dc8ae8851ae0d0bc01a18f3a4d75ad..e1e1ecb4db10fb80dd16804b325612903fa75877 100644 (file)
@@ -4026,6 +4026,14 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 
                conn->init_addr_type = ev->bdaddr_type;
                bacpy(&conn->init_addr, &ev->bdaddr);
+
+               /* For incoming connections, set the default minimum
+                * and maximum connection interval. They will be used
+                * to check if the parameters are in range and if not
+                * trigger the connection update procedure.
+                */
+               conn->le_conn_min_interval = hdev->le_conn_min_interval;
+               conn->le_conn_max_interval = hdev->le_conn_max_interval;
        }
 
        /* Lookup the identity address from the stored connection