Re: [PATCH v2 4/6] Bluetooth: Make max age for connection information configurable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andrzej,

> This patch adds debugfs entry to configure max age of connection
> information. Cached values will be only refreshed by Get Connection
> Information request if cache is older than this value. Default value
> is 2000ms.
> 
> Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@xxxxxxxxx>
> ---
> include/net/bluetooth/hci_core.h | 4 ++++
> net/bluetooth/hci_core.c         | 4 ++++
> net/bluetooth/mgmt.c             | 4 +---
> 3 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
> index 9be523a..6353617 100644
> --- a/include/net/bluetooth/hci_core.h
> +++ b/include/net/bluetooth/hci_core.h
> @@ -145,6 +145,9 @@ struct oob_data {
> /* Default LE RPA expiry time, 15 minutes */
> #define HCI_DEFAULT_RPA_TIMEOUT		(15 * 60)
> 
> +/* Default max age of connection information, 2 sec */
> +#define DEFAULT_CONN_INFO_MAX_AGE	2000
> +
> struct amp_assoc {
> 	__u16	len;
> 	__u16	offset;
> @@ -200,6 +203,7 @@ struct hci_dev {
> 	__u16		le_conn_min_interval;
> 	__u16		le_conn_max_interval;
> 	__u16		discov_interleaved_timeout;
> +	__u16		conn_info_max_age;
> 	__u8		ssp_debug_mode;
> 
> 	__u16		devid_source;
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index d31f144..b2d1eee1e3 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -1754,6 +1754,9 @@ static int __hci_init(struct hci_dev *hdev)
> 			    &blacklist_fops);
> 	debugfs_create_file("uuids", 0444, hdev->debugfs, hdev, &uuids_fops);
> 
> +	debugfs_create_u16("conn_info_max_age", 0644, hdev->debugfs,
> +			   &hdev->conn_info_max_age);
> +
> 	if (lmp_bredr_capable(hdev)) {
> 		debugfs_create_file("inquiry_cache", 0444, hdev->debugfs,
> 				    hdev, &inquiry_cache_fops);
> @@ -3789,6 +3792,7 @@ struct hci_dev *hci_alloc_dev(void)
> 
> 	hdev->rpa_timeout = HCI_DEFAULT_RPA_TIMEOUT;
> 	hdev->discov_interleaved_timeout = DISCOV_INTERLEAVED_TIMEOUT;
> +	hdev->conn_info_max_age = DEFAULT_CONN_INFO_MAX_AGE;
> 
> 	mutex_init(&hdev->lock);
> 	mutex_init(&hdev->req_lock);
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index 2d86ce1..a7f45d2 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -114,8 +114,6 @@ static const u16 mgmt_events[] = {
> 
> #define CACHE_TIMEOUT	msecs_to_jiffies(2 * 1000)
> 
> -#define CONN_INFO_MAX_AGE	msecs_to_jiffies(2 * 1000)
> -

so instead of introducing it here and the later moving it around. Lets just get this right first and introduce the debugfs setting first before using the value.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux