[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>
This commit is contained in:
committed by
David S. Miller
parent
1143e5a6d4
commit
6ac59344ef
@@ -316,10 +316,13 @@ static inline void hci_conn_put(struct hci_conn *conn)
|
||||
if (atomic_dec_and_test(&conn->refcnt)) {
|
||||
unsigned long timeo;
|
||||
if (conn->type == ACL_LINK) {
|
||||
timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT);
|
||||
if (!conn->out)
|
||||
timeo *= 2;
|
||||
del_timer(&conn->idle_timer);
|
||||
if (conn->state == BT_CONNECTED) {
|
||||
timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT);
|
||||
if (!conn->out)
|
||||
timeo *= 2;
|
||||
} else
|
||||
timeo = msecs_to_jiffies(10);
|
||||
} else
|
||||
timeo = msecs_to_jiffies(10);
|
||||
mod_timer(&conn->disc_timer, jiffies + timeo);
|
||||
|
Reference in New Issue
Block a user