aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index b9517bd17190..96887ae8375b 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -141,10 +141,11 @@ int hci_disconnect(struct hci_conn *conn, __u8 reason)
141 */ 141 */
142 if (conn->type == ACL_LINK && conn->role == HCI_ROLE_MASTER) { 142 if (conn->type == ACL_LINK && conn->role == HCI_ROLE_MASTER) {
143 struct hci_dev *hdev = conn->hdev; 143 struct hci_dev *hdev = conn->hdev;
144 struct hci_cp_read_clock_offset cp; 144 struct hci_cp_read_clock_offset clkoff_cp;
145 145
146 cp.handle = cpu_to_le16(conn->handle); 146 clkoff_cp.handle = cpu_to_le16(conn->handle);
147 hci_send_cmd(hdev, HCI_OP_READ_CLOCK_OFFSET, sizeof(cp), &cp); 147 hci_send_cmd(hdev, HCI_OP_READ_CLOCK_OFFSET, sizeof(clkoff_cp),
148 &clkoff_cp);
148 } 149 }
149 150
150 conn->state = BT_DISCONN; 151 conn->state = BT_DISCONN;
@@ -415,7 +416,7 @@ static void le_conn_timeout(struct work_struct *work)
415 * happen with broken hardware or if low duty cycle was used 416 * happen with broken hardware or if low duty cycle was used
416 * (which doesn't have a timeout of its own). 417 * (which doesn't have a timeout of its own).
417 */ 418 */
418 if (test_bit(HCI_ADVERTISING, &hdev->dev_flags)) { 419 if (conn->role == HCI_ROLE_SLAVE) {
419 u8 enable = 0x00; 420 u8 enable = 0x00;
420 hci_send_cmd(hdev, HCI_OP_LE_SET_ADV_ENABLE, sizeof(enable), 421 hci_send_cmd(hdev, HCI_OP_LE_SET_ADV_ENABLE, sizeof(enable),
421 &enable); 422 &enable);
@@ -517,7 +518,7 @@ int hci_conn_del(struct hci_conn *conn)
517 /* Unacked frames */ 518 /* Unacked frames */
518 hdev->acl_cnt += conn->sent; 519 hdev->acl_cnt += conn->sent;
519 } else if (conn->type == LE_LINK) { 520 } else if (conn->type == LE_LINK) {
520 cancel_delayed_work_sync(&conn->le_conn_timeout); 521 cancel_delayed_work(&conn->le_conn_timeout);
521 522
522 if (hdev->le_pkts) 523 if (hdev->le_pkts)
523 hdev->le_cnt += conn->sent; 524 hdev->le_cnt += conn->sent;
@@ -544,6 +545,9 @@ int hci_conn_del(struct hci_conn *conn)
544 545
545 hci_conn_del_sysfs(conn); 546 hci_conn_del_sysfs(conn);
546 547
548 if (test_bit(HCI_CONN_PARAM_REMOVAL_PEND, &conn->flags))
549 hci_conn_params_del(conn->hdev, &conn->dst, conn->dst_type);
550
547 hci_dev_put(hdev); 551 hci_dev_put(hdev);
548 552
549 hci_conn_put(conn); 553 hci_conn_put(conn);