提交 04fb7d90 编写于 作者: M Marcel Holtmann

Bluetooth: Provide defaults for LE connection latency and timeout

Store the connection latency and supervision timeout default values
with all the other controller defaults. And when needed use them
for new connections.
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 8afef092
...@@ -203,6 +203,8 @@ struct hci_dev { ...@@ -203,6 +203,8 @@ struct hci_dev {
__u16 le_scan_window; __u16 le_scan_window;
__u16 le_conn_min_interval; __u16 le_conn_min_interval;
__u16 le_conn_max_interval; __u16 le_conn_max_interval;
__u16 le_conn_latency;
__u16 le_supv_timeout;
__u16 discov_interleaved_timeout; __u16 discov_interleaved_timeout;
__u16 conn_info_min_age; __u16 conn_info_min_age;
__u16 conn_info_max_age; __u16 conn_info_max_age;
......
...@@ -773,8 +773,8 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst, ...@@ -773,8 +773,8 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
} else { } else {
conn->le_conn_min_interval = hdev->le_conn_min_interval; conn->le_conn_min_interval = hdev->le_conn_min_interval;
conn->le_conn_max_interval = hdev->le_conn_max_interval; conn->le_conn_max_interval = hdev->le_conn_max_interval;
conn->le_conn_latency = 0x0000; conn->le_conn_latency = hdev->le_conn_latency;
conn->le_supv_timeout = 0x002a; conn->le_supv_timeout = hdev->le_supv_timeout;
} }
/* If controller is scanning, we stop it since some controllers are /* If controller is scanning, we stop it since some controllers are
......
...@@ -3439,8 +3439,8 @@ int hci_conn_params_add(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type, ...@@ -3439,8 +3439,8 @@ int hci_conn_params_add(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
update: update:
params->conn_min_interval = conn_min_interval; params->conn_min_interval = conn_min_interval;
params->conn_max_interval = conn_max_interval; params->conn_max_interval = conn_max_interval;
params->conn_latency = 0x0000; params->conn_latency = hdev->le_conn_latency;
params->supervision_timeout = 0x002a; params->supervision_timeout = hdev->le_supv_timeout;
params->auto_connect = auto_connect; params->auto_connect = auto_connect;
switch (auto_connect) { switch (auto_connect) {
...@@ -3706,6 +3706,8 @@ struct hci_dev *hci_alloc_dev(void) ...@@ -3706,6 +3706,8 @@ struct hci_dev *hci_alloc_dev(void)
hdev->le_scan_window = 0x0030; hdev->le_scan_window = 0x0030;
hdev->le_conn_min_interval = 0x0028; hdev->le_conn_min_interval = 0x0028;
hdev->le_conn_max_interval = 0x0038; hdev->le_conn_max_interval = 0x0038;
hdev->le_conn_latency = 0x0000;
hdev->le_supv_timeout = 0x002a;
hdev->rpa_timeout = HCI_DEFAULT_RPA_TIMEOUT; hdev->rpa_timeout = HCI_DEFAULT_RPA_TIMEOUT;
hdev->discov_interleaved_timeout = DISCOV_INTERLEAVED_TIMEOUT; hdev->discov_interleaved_timeout = DISCOV_INTERLEAVED_TIMEOUT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册