aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-06-30 06:34:38 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:51 -0400
commitf1649577a6c20410335dbb4765e74e51fd5df585 (patch)
tree4e7fefc0939dba2f0ebc15caa646c498bb0954e0 /net
parent816a93d10a2809f09ce81e9fef638380d68d2c6d (diff)
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')
-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)
879DEFINE_SIMPLE_ATTRIBUTE(conn_latency_fops, conn_latency_get, 879DEFINE_SIMPLE_ATTRIBUTE(conn_latency_fops, conn_latency_get,
880 conn_latency_set, "%llu\n"); 880 conn_latency_set, "%llu\n");
881 881
882static int supervision_timeout_set(void *data, u64 val)
883{
884 struct hci_dev *hdev = data;
885
886 if (val < 0x000a || val > 0x0c80)
887 return -EINVAL;
888
889 hci_dev_lock(hdev);
890 hdev->le_supv_timeout = val;
891 hci_dev_unlock(hdev);
892
893 return 0;
894}
895
896static int supervision_timeout_get(void *data, u64 *val)
897{
898 struct hci_dev *hdev = data;
899
900 hci_dev_lock(hdev);
901 *val = hdev->le_supv_timeout;
902 hci_dev_unlock(hdev);
903
904 return 0;
905}
906
907DEFINE_SIMPLE_ATTRIBUTE(supervision_timeout_fops, supervision_timeout_get,
908 supervision_timeout_set, "%llu\n");
909
882static int adv_channel_map_set(void *data, u64 val) 910static int adv_channel_map_set(void *data, u64 val)
883{ 911{
884 struct hci_dev *hdev = data; 912 struct hci_dev *hdev = data;
@@ -1738,6 +1766,8 @@ static int __hci_init(struct hci_dev *hdev)
1738 hdev, &conn_max_interval_fops); 1766 hdev, &conn_max_interval_fops);
1739 debugfs_create_file("conn_latency", 0644, hdev->debugfs, 1767 debugfs_create_file("conn_latency", 0644, hdev->debugfs,
1740 hdev, &conn_latency_fops); 1768 hdev, &conn_latency_fops);
1769 debugfs_create_file("supervision_timeout", 0644, hdev->debugfs,
1770 hdev, &supervision_timeout_fops);
1741 debugfs_create_file("adv_channel_map", 0644, hdev->debugfs, 1771 debugfs_create_file("adv_channel_map", 0644, hdev->debugfs,
1742 hdev, &adv_channel_map_fops); 1772 hdev, &adv_channel_map_fops);
1743 debugfs_create_file("device_list", 0444, hdev->debugfs, hdev, 1773 debugfs_create_file("device_list", 0444, hdev->debugfs, hdev,