aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-09-26 03:43:48 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 21:01:33 -0400
commit6ac59344ef25d5f0ebadb5663cf700d25d2a3886 (patch)
treeb4dbdf1589e0a7b6d3ed04d38fb7615a54f0d7af /net/bluetooth/hci_event.c
parent1143e5a6d4d69cd36d44e0184769aa2b17041a10 (diff)
[Bluetooth] Support create connection cancel command
In case of non-blocking connects it is possible that the last user of an ACL link quits before the connection has been fully established. This will lead to a race condition where the internal state of a connection is closed, but the actual link has been established and is active. In case of Bluetooth 1.2 and later devices it is possible to call create connection cancel to abort the connect. For older devices the disconnect timer will be used to trigger the needed disconnect. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 7518bdbf34cd..bb25484b8747 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -750,6 +750,8 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
750 if (test_bit(HCI_ENCRYPT, &hdev->flags)) 750 if (test_bit(HCI_ENCRYPT, &hdev->flags))
751 conn->link_mode |= HCI_LM_ENCRYPT; 751 conn->link_mode |= HCI_LM_ENCRYPT;
752 752
753 hci_conn_hold(conn);
754
753 /* Get remote features */ 755 /* Get remote features */
754 if (conn->type == ACL_LINK) { 756 if (conn->type == ACL_LINK) {
755 struct hci_cp_read_remote_features cp; 757 struct hci_cp_read_remote_features cp;
@@ -778,6 +780,8 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
778 hci_send_cmd(hdev, OGF_LINK_CTL, 780 hci_send_cmd(hdev, OGF_LINK_CTL,
779 OCF_CHANGE_CONN_PTYPE, sizeof(cp), &cp); 781 OCF_CHANGE_CONN_PTYPE, sizeof(cp), &cp);
780 } 782 }
783
784 hci_conn_put(conn);
781 } else 785 } else
782 conn->state = BT_CLOSED; 786 conn->state = BT_CLOSED;
783 787