aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-02 17:37:30 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 17:42:57 +0200
commit348d50b8e96c2c4630801e6e720c7c722ade83e8 (patch)
tree39992e1a21b0c62d985ade178e5b4a233db17652
parentBluetooth: Add Load Connection Parameters command (diff)
downloadlinux-dev-348d50b8e96c2c4630801e6e720c7c722ade83e8.tar.xz
linux-dev-348d50b8e96c2c4630801e6e720c7c722ade83e8.zip
Bluetooth: Fix missing update of conn params
We should update any stored connection parameters when we receive the LE Remote Connection Parameter Request HCI event. This patch adds the necessary code to the function that handles the event. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/hci_event.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ed49a065dd67..3ad2576fd3f1 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4429,9 +4429,25 @@ static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev,
return send_conn_param_neg_reply(hdev, handle,
HCI_ERROR_INVALID_LL_PARAMS);
- if (test_bit(HCI_CONN_MASTER, &hcon->flags))
+ if (test_bit(HCI_CONN_MASTER, &hcon->flags)) {
+ struct hci_conn_params *params;
+
+ hci_dev_lock(hdev);
+
+ params = hci_conn_params_lookup(hdev, &hcon->dst,
+ hcon->dst_type);
+ if (params) {
+ params->conn_min_interval = min;
+ params->conn_max_interval = max;
+ params->conn_latency = latency;
+ params->supervision_timeout = timeout;
+ }
+
+ hci_dev_unlock(hdev);
+
mgmt_new_conn_param(hdev, &hcon->dst, hcon->dst_type, min, max,
latency, timeout);
+ }
cp.handle = ev->handle;
cp.interval_min = ev->interval_min;