Skip to contentSkip to conversation

Bluetooth: Store current LE connection parameters in hci_conn struct

PATCH In review Marcel Holtmann 2 participants 2 messages Jun 23, 2014

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/2 Bluetooth: Store current LE connection parameters in hci_conn struct

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.

---
 include/net/bluetooth/hci_core.h | 3 +++
 net/bluetooth/hci_event.c        | 4 ++++
 2 files changed, 7 insertions(+)
include/net/bluetooth/hci_core.h +3 -0
index c81de0d366df..cd73a82cc713 100644
@@ -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;
net/bluetooth/hci_event.c +4 -0
index e5b430113cfb..3d4741d789d3 100644
@@ -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);
Signature · 1 line
1.9.3
#1 lore raw

Hi Marcel,

Quoted 10 lines · Marcel Holtmann

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.

---
 include/net/bluetooth/hci_core.h | 3 +++
 net/bluetooth/hci_event.c        | 4 ++++
 2 files changed, 7 insertions(+)

Both patches have been applied to bluetooth-next. Thanks.

Johan