diff options
-rw-r--r-- | include/net/bluetooth/hci_core.h | 2 | ||||
-rw-r--r-- | net/bluetooth/hci_conn.c | 16 | ||||
-rw-r--r-- | net/bluetooth/hci_core.c | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 0906990dedd8..182044824495 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -439,6 +439,8 @@ struct hci_conn_params { | |||
439 | 439 | ||
440 | u16 conn_min_interval; | 440 | u16 conn_min_interval; |
441 | u16 conn_max_interval; | 441 | u16 conn_max_interval; |
442 | u16 conn_latency; | ||
443 | u16 supervision_timeout; | ||
442 | 444 | ||
443 | enum { | 445 | enum { |
444 | HCI_AUTO_CONN_DISABLED, | 446 | HCI_AUTO_CONN_DISABLED, |
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 25ee27ddc882..adb413d77637 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -216,11 +216,23 @@ bool hci_setup_sync(struct hci_conn *conn, __u16 handle) | |||
216 | void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, | 216 | void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, |
217 | u16 latency, u16 to_multiplier) | 217 | u16 latency, u16 to_multiplier) |
218 | { | 218 | { |
219 | struct hci_cp_le_conn_update cp; | ||
220 | struct hci_dev *hdev = conn->hdev; | 219 | struct hci_dev *hdev = conn->hdev; |
220 | struct hci_conn_params *params; | ||
221 | struct hci_cp_le_conn_update cp; | ||
221 | 222 | ||
222 | memset(&cp, 0, sizeof(cp)); | 223 | hci_dev_lock(hdev); |
224 | |||
225 | params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type); | ||
226 | if (params) { | ||
227 | params->conn_min_interval = min; | ||
228 | params->conn_max_interval = max; | ||
229 | params->conn_latency = latency; | ||
230 | params->supervision_timeout = to_multiplier; | ||
231 | } | ||
223 | 232 | ||
233 | hci_dev_unlock(hdev); | ||
234 | |||
235 | memset(&cp, 0, sizeof(cp)); | ||
224 | cp.handle = cpu_to_le16(conn->handle); | 236 | cp.handle = cpu_to_le16(conn->handle); |
225 | cp.conn_interval_min = cpu_to_le16(min); | 237 | cp.conn_interval_min = cpu_to_le16(min); |
226 | cp.conn_interval_max = cpu_to_le16(max); | 238 | cp.conn_interval_max = cpu_to_le16(max); |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index c566b57610c9..97a6453bee30 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -3514,6 +3514,8 @@ int hci_conn_params_add(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type, | |||
3514 | update: | 3514 | update: |
3515 | params->conn_min_interval = conn_min_interval; | 3515 | params->conn_min_interval = conn_min_interval; |
3516 | params->conn_max_interval = conn_max_interval; | 3516 | params->conn_max_interval = conn_max_interval; |
3517 | params->conn_latency = 0x0000; | ||
3518 | params->supervision_timeout = 0x002a; | ||
3517 | params->auto_connect = auto_connect; | 3519 | params->auto_connect = auto_connect; |
3518 | 3520 | ||
3519 | switch (auto_connect) { | 3521 | switch (auto_connect) { |