Bluetooth: Add new debugfs parameter
authorLukasz Rymanowski <lukasz.rymanowski@tieto.com>
Thu, 27 Mar 2014 19:55:20 +0000 (20:55 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 28 Mar 2014 07:09:30 +0000 (00:09 -0700)
With this patch it is possible to control discovery interleaved
timeout value from debugfs.

It is for fine tuning of this timeout.

Signed-off-by: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_core.c
net/bluetooth/mgmt.c

index 08a1d44eeab07ce6629003537f6ccf62dde07a14..e0c26bc144e561188ab46fca52df42e77c608807 100644 (file)
@@ -199,6 +199,7 @@ struct hci_dev {
        __u16           le_scan_window;
        __u16           le_conn_min_interval;
        __u16           le_conn_max_interval;
+       __u16           discov_interleaved_timeout;
        __u8            ssp_debug_mode;
 
        __u16           devid_source;
index 7cf511cb1171de6abc011c54b5702953d562df09..d31f144860d127cdf223f2145185feb963e011c4 100644 (file)
@@ -1823,6 +1823,9 @@ static int __hci_init(struct hci_dev *hdev)
                                    &lowpan_debugfs_fops);
                debugfs_create_file("le_auto_conn", 0644, hdev->debugfs, hdev,
                                    &le_auto_conn_fops);
+               debugfs_create_u16("discov_interleaved_timeout", 0644,
+                                  hdev->debugfs,
+                                  &hdev->discov_interleaved_timeout);
        }
 
        return 0;
@@ -3785,6 +3788,7 @@ struct hci_dev *hci_alloc_dev(void)
        hdev->le_conn_max_interval = 0x0038;
 
        hdev->rpa_timeout = HCI_DEFAULT_RPA_TIMEOUT;
+       hdev->discov_interleaved_timeout = DISCOV_INTERLEAVED_TIMEOUT;
 
        mutex_init(&hdev->lock);
        mutex_init(&hdev->req_lock);
index 944c4fc879055485fc9ca05b45ff938b5db88165..b34e13aed51c5ab5f136e36b1ac65d90d5d858f3 100644 (file)
@@ -3372,7 +3372,7 @@ static void start_discovery_complete(struct hci_dev *hdev, u8 status)
                break;
 
        case DISCOV_TYPE_INTERLEAVED:
-               timeout = msecs_to_jiffies(DISCOV_INTERLEAVED_TIMEOUT);
+               timeout = msecs_to_jiffies(hdev->discov_interleaved_timeout);
                break;
 
        case DISCOV_TYPE_BREDR: