summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorMarcel Holtmann2014-06-30 12:34:38 +0200
committerMarcel Holtmann2014-07-03 17:42:51 +0200
commitf1649577a6c20410335dbb4765e74e51fd5df585 (patch)
tree4e7fefc0939dba2f0ebc15caa646c498bb0954e0 /net/bluetooth/hci_core.c
parentBluetooth: Expose default connection latency setting via debugfs (diff)
downloadkernel-qcow2-linux-f1649577a6c20410335dbb4765e74e51fd5df585.tar.gz
kernel-qcow2-linux-f1649577a6c20410335dbb4765e74e51fd5df585.tar.xz
kernel-qcow2-linux-f1649577a6c20410335dbb4765e74e51fd5df585.zip
Bluetooth: Expose default supervision timeout setting via debugfs
The controller has a default value for the supervision timeout. Expose this via debugfs for testing purposes. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 79d292cfb867..6c28687c9286 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -879,6 +879,34 @@ static int conn_latency_get(void *data, u64 *val)
DEFINE_SIMPLE_ATTRIBUTE(conn_latency_fops, conn_latency_get,
conn_latency_set, "%llu\n");
+static int supervision_timeout_set(void *data, u64 val)
+{
+ struct hci_dev *hdev = data;
+
+ if (val < 0x000a || val > 0x0c80)
+ return -EINVAL;
+
+ hci_dev_lock(hdev);
+ hdev->le_supv_timeout = val;
+ hci_dev_unlock(hdev);
+
+ return 0;
+}
+
+static int supervision_timeout_get(void *data, u64 *val)
+{
+ struct hci_dev *hdev = data;
+
+ hci_dev_lock(hdev);
+ *val = hdev->le_supv_timeout;
+ hci_dev_unlock(hdev);
+
+ return 0;
+}
+
+DEFINE_SIMPLE_ATTRIBUTE(supervision_timeout_fops, supervision_timeout_get,
+ supervision_timeout_set, "%llu\n");
+
static int adv_channel_map_set(void *data, u64 val)
{
struct hci_dev *hdev = data;
@@ -1738,6 +1766,8 @@ static int __hci_init(struct hci_dev *hdev)
hdev, &conn_max_interval_fops);
debugfs_create_file("conn_latency", 0644, hdev->debugfs,
hdev, &conn_latency_fops);
+ debugfs_create_file("supervision_timeout", 0644, hdev->debugfs,
+ hdev, &supervision_timeout_fops);
debugfs_create_file("adv_channel_map", 0644, hdev->debugfs,
hdev, &adv_channel_map_fops);
debugfs_create_file("device_list", 0444, hdev->debugfs, hdev,