aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-06-30 06:34:37 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:51 -0400
commit816a93d10a2809f09ce81e9fef638380d68d2c6d (patch)
treed5336fecacb71beedb46d50b89ebc5c54695ceb5
parent04fb7d9066dd9173ef0d4ccea8fe3bb59bd94605 (diff)
Bluetooth: Expose default connection latency setting via debugfs
The controller has a default value for the connection latency. Expose this via debugfs for testing purposes. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-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 94551c33c4c6..79d292cfb867 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -851,6 +851,34 @@ static int conn_max_interval_get(void *data, u64 *val)
851DEFINE_SIMPLE_ATTRIBUTE(conn_max_interval_fops, conn_max_interval_get, 851DEFINE_SIMPLE_ATTRIBUTE(conn_max_interval_fops, conn_max_interval_get,
852 conn_max_interval_set, "%llu\n"); 852 conn_max_interval_set, "%llu\n");
853 853
854static int conn_latency_set(void *data, u64 val)
855{
856 struct hci_dev *hdev = data;
857
858 if (val > 0x01f3)
859 return -EINVAL;
860
861 hci_dev_lock(hdev);
862 hdev->le_conn_latency = val;
863 hci_dev_unlock(hdev);
864
865 return 0;
866}
867
868static int conn_latency_get(void *data, u64 *val)
869{
870 struct hci_dev *hdev = data;
871
872 hci_dev_lock(hdev);
873 *val = hdev->le_conn_latency;
874 hci_dev_unlock(hdev);
875
876 return 0;
877}
878
879DEFINE_SIMPLE_ATTRIBUTE(conn_latency_fops, conn_latency_get,
880 conn_latency_set, "%llu\n");
881
854static int adv_channel_map_set(void *data, u64 val) 882static int adv_channel_map_set(void *data, u64 val)
855{ 883{
856 struct hci_dev *hdev = data; 884 struct hci_dev *hdev = data;
@@ -1708,6 +1736,8 @@ static int __hci_init(struct hci_dev *hdev)
1708 hdev, &conn_min_interval_fops); 1736 hdev, &conn_min_interval_fops);
1709 debugfs_create_file("conn_max_interval", 0644, hdev->debugfs, 1737 debugfs_create_file("conn_max_interval", 0644, hdev->debugfs,
1710 hdev, &conn_max_interval_fops); 1738 hdev, &conn_max_interval_fops);
1739 debugfs_create_file("conn_latency", 0644, hdev->debugfs,
1740 hdev, &conn_latency_fops);
1711 debugfs_create_file("adv_channel_map", 0644, hdev->debugfs, 1741 debugfs_create_file("adv_channel_map", 0644, hdev->debugfs,
1712 hdev, &adv_channel_map_fops); 1742 hdev, &adv_channel_map_fops);
1713 debugfs_create_file("device_list", 0444, hdev->debugfs, hdev, 1743 debugfs_create_file("device_list", 0444, hdev->debugfs, hdev,