Bluetooth: Store current LE connection parameters in hci_conn struct
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 23 Jun 2014 09:40:04 +0000 (11:40 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 3 Jul 2014 15:42:44 +0000 (17:42 +0200)
The LE connection parameters are needed later on to be able to decide
if it is required to trigger connection update procedures. So when the
connection has been established successfully, store the current used
parameters in hci_conn struct.

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

index c81de0d366df9b7ab8dd025603e69a353487b9e8..cd73a82cc713e508dca11eefca6e8123b2b3cad7 100644 (file)
@@ -381,6 +381,9 @@ struct hci_conn {
        __u16           setting;
        __u16           le_conn_min_interval;
        __u16           le_conn_max_interval;
+       __u16           le_conn_interval;
+       __u16           le_conn_latency;
+       __u16           le_supv_timeout;
        __s8            rssi;
        __s8            tx_power;
        __s8            max_tx_power;
index e5b430113cfb3fe7fb0b851574524903be4b6414..3d4741d789d3638257f72f295d9e9ab5ecc3f31b 100644 (file)
@@ -4056,6 +4056,10 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
        conn->handle = __le16_to_cpu(ev->handle);
        conn->state = BT_CONNECTED;
 
+       conn->le_conn_interval = le16_to_cpu(ev->interval);
+       conn->le_conn_latency = le16_to_cpu(ev->latency);
+       conn->le_supv_timeout = le16_to_cpu(ev->supervision_timeout);
+
        hci_conn_add_sysfs(conn);
 
        hci_proto_connect_cfm(conn, ev->status);