Bluetooth: Expose debugfs settings for LE connection interval
Subsystems (2)
Marcel Holtmann
maintainerPATCH v2 3/3 Bluetooth: Expose debugfs settings for LE connection interval
For testing purposes expose the default LE connection interval values via debugfs.
Signed-off-by Marcel Holtmann <[email protected]>
--- include/net/bluetooth/hci_core.h | 2 ++ net/bluetooth/hci_conn.c | 5 ++-- net/bluetooth/hci_core.c | 62 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 2 deletions(-)
include/net/bluetooth/hci_core.h +2 -0
@@ -169,6 +169,8 @@ struct hci_dev {__u8 page_scan_type;__u16 le_scan_interval;__u16 le_scan_window; +__u16 le_conn_min_interval; +__u16 le_conn_max_interval;__u8 ssp_debug_mode;__u16 devid_source;
net/bluetooth/hci_conn.c +3 -2
@@ -558,11 +558,12 @@ static int hci_create_le_conn(struct hci_conn *conn)bacpy (&cp.peer_addr, &conn->dst); cp.peer_addr_type = conn->dst_type; cp.own_address_type = conn->src_type; - cp.conn_interval_min =__constant_cpu_to_le16 (0x0028 ); - cp.conn_interval_max =__constant_cpu_to_le16 (0x0038 ); + cp.conn_interval_min =cpu_to_le16 (hdev->le_conn_min_interval); + cp.conn_interval_max =cpu_to_le16 (hdev->le_conn_max_interval); cp.supervision_timeout =__constant_cpu_to_le16 (0x002a ); cp.min_ce_len =__constant_cpu_to_le16 (0x0000 ); cp.max_ce_len =__constant_cpu_to_le16 (0x0000 ); +hci_req_add (&req,HCI_OP_LE_CREATE_CONN ,sizeof (cp), &cp); err =hci_req_run (&req, create_le_conn_complete);
net/bluetooth/hci_core.c +62 -0
80 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Hi Marcel,
net/bluetooth/hci_core.c static const struct file_operations long_term_keys_fops = { · line 593
Quoted 9 lines · Marcel Holtmann
net/bluetooth/hci_core.c +9
-0+static int conn_min_interval_set (void *data,u64 val) +{ +struct hci_dev *hdev = data; + +if (val <0x0006 || val >0x0c80 || val > hdev->le_conn_max_interval) +return -EINVAL ; + +hci_dev_lock (hdev); + hdev->le_conn_min_interval= val;
Minor style issue: missing space before "=".
Quoted 4 lines
net/bluetooth/hci_core.c +4
-0+hci_dev_unlock (hdev); + +return 0 ; +}
net/bluetooth/hci_core.c static const struct file_operations long_term_keys_fops = { · line 621
Quoted 10 lines
net/bluetooth/hci_core.c +9
-0+static int conn_max_interval_set (void *data,u64 val) +{ +struct hci_dev *hdev = data; + +if (val <0x0006 || val >0x0c80 || val < hdev->le_conn_min_interval) +return -EINVAL ; + +hci_dev_lock (hdev); + hdev->le_conn_max_interval= val;
Same above.
net/bluetooth/hci_core.c static const struct file_operations long_term_keys_fops = { · line 597
Quoted 4 lines
net/bluetooth/hci_core.c +4
-0+hci_dev_unlock (hdev); + +return 0 ; +}
Best Regards,
Signature · 3 lines
Anderson Lizardo Instituto Nokia de Tecnologia - INdT Manaus - Brazil