diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-07-02 10:37:32 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-03 11:42:57 -0400 |
commit | f4869e2adb7ab9d09a9335b4e26a63ec413f2c6f (patch) | |
tree | 09119d31448dcec80ca3e44c1ae39a521f57d8c9 | |
parent | 7d6ca6939cb2f701204317cbab15af1b98f7f501 (diff) |
Bluetooth: Pass store hint to mgmt_new_conn_param
The calling functions of mgmt_new_conn_param have more information about
the parameters, such as whether the kernel is tracking them or not. It
makes therefore sense to have them pass an initial store_hint value to
the mgmt_new_conn_param function.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | include/net/bluetooth/hci_core.h | 4 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 8 | ||||
-rw-r--r-- | net/bluetooth/l2cap_core.c | 8 | ||||
-rw-r--r-- | net/bluetooth/mgmt.c | 6 |
4 files changed, 17 insertions, 9 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 32c8e51f6b26..d0bca13843ce 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -1335,8 +1335,8 @@ void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk); | |||
1335 | void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk, | 1335 | void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk, |
1336 | bool persistent); | 1336 | bool persistent); |
1337 | void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1337 | void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr, |
1338 | u8 bdaddr_type, u16 min_interval, u16 max_interval, | 1338 | u8 bdaddr_type, u8 store_hint, u16 min_interval, |
1339 | u16 latency, u16 timeout); | 1339 | u16 max_interval, u16 latency, u16 timeout); |
1340 | void mgmt_reenable_advertising(struct hci_dev *hdev); | 1340 | void mgmt_reenable_advertising(struct hci_dev *hdev); |
1341 | void mgmt_smp_complete(struct hci_conn *conn, bool complete); | 1341 | void mgmt_smp_complete(struct hci_conn *conn, bool complete); |
1342 | 1342 | ||
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 3ad2576fd3f1..846f6a6af881 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -4431,6 +4431,7 @@ static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev, | |||
4431 | 4431 | ||
4432 | if (test_bit(HCI_CONN_MASTER, &hcon->flags)) { | 4432 | if (test_bit(HCI_CONN_MASTER, &hcon->flags)) { |
4433 | struct hci_conn_params *params; | 4433 | struct hci_conn_params *params; |
4434 | u8 store_hint; | ||
4434 | 4435 | ||
4435 | hci_dev_lock(hdev); | 4436 | hci_dev_lock(hdev); |
4436 | 4437 | ||
@@ -4441,12 +4442,15 @@ static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev, | |||
4441 | params->conn_max_interval = max; | 4442 | params->conn_max_interval = max; |
4442 | params->conn_latency = latency; | 4443 | params->conn_latency = latency; |
4443 | params->supervision_timeout = timeout; | 4444 | params->supervision_timeout = timeout; |
4445 | store_hint = 0x01; | ||
4446 | } else{ | ||
4447 | store_hint = 0x00; | ||
4444 | } | 4448 | } |
4445 | 4449 | ||
4446 | hci_dev_unlock(hdev); | 4450 | hci_dev_unlock(hdev); |
4447 | 4451 | ||
4448 | mgmt_new_conn_param(hdev, &hcon->dst, hcon->dst_type, min, max, | 4452 | mgmt_new_conn_param(hdev, &hcon->dst, hcon->dst_type, |
4449 | latency, timeout); | 4453 | store_hint, min, max, latency, timeout); |
4450 | } | 4454 | } |
4451 | 4455 | ||
4452 | cp.handle = ev->handle; | 4456 | cp.handle = ev->handle; |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index a6e276204ae9..dbef22d644e2 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -5250,10 +5250,14 @@ static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn, | |||
5250 | sizeof(rsp), &rsp); | 5250 | sizeof(rsp), &rsp); |
5251 | 5251 | ||
5252 | if (!err) { | 5252 | if (!err) { |
5253 | u8 store_hint; | ||
5254 | |||
5255 | store_hint = hci_le_conn_update(hcon, min, max, latency, | ||
5256 | to_multiplier); | ||
5253 | mgmt_new_conn_param(hcon->hdev, &hcon->dst, hcon->dst_type, | 5257 | mgmt_new_conn_param(hcon->hdev, &hcon->dst, hcon->dst_type, |
5254 | min, max, latency, to_multiplier); | 5258 | store_hint, min, max, latency, |
5259 | to_multiplier); | ||
5255 | 5260 | ||
5256 | hci_le_conn_update(hcon, min, max, latency, to_multiplier); | ||
5257 | } | 5261 | } |
5258 | 5262 | ||
5259 | return 0; | 5263 | return 0; |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 59bf1ac41429..fb1aa0cac137 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -5790,15 +5790,15 @@ void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk, | |||
5790 | } | 5790 | } |
5791 | 5791 | ||
5792 | void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr, | 5792 | void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr, |
5793 | u8 bdaddr_type, u16 min_interval, u16 max_interval, | 5793 | u8 bdaddr_type, u8 store_hint, u16 min_interval, |
5794 | u16 latency, u16 timeout) | 5794 | u16 max_interval, u16 latency, u16 timeout) |
5795 | { | 5795 | { |
5796 | struct mgmt_ev_new_conn_param ev; | 5796 | struct mgmt_ev_new_conn_param ev; |
5797 | 5797 | ||
5798 | memset(&ev, 0, sizeof(ev)); | 5798 | memset(&ev, 0, sizeof(ev)); |
5799 | bacpy(&ev.addr.bdaddr, bdaddr); | 5799 | bacpy(&ev.addr.bdaddr, bdaddr); |
5800 | ev.addr.type = link_to_bdaddr(LE_LINK, bdaddr_type); | 5800 | ev.addr.type = link_to_bdaddr(LE_LINK, bdaddr_type); |
5801 | ev.store_hint = 0x00; | 5801 | ev.store_hint = store_hint; |
5802 | ev.min_interval = cpu_to_le16(min_interval); | 5802 | ev.min_interval = cpu_to_le16(min_interval); |
5803 | ev.max_interval = cpu_to_le16(max_interval); | 5803 | ev.max_interval = cpu_to_le16(max_interval); |
5804 | ev.latency = cpu_to_le16(latency); | 5804 | ev.latency = cpu_to_le16(latency); |