diff options
| author | Marcel Holtmann <marcel@holtmann.org> | 2004-01-13 06:17:12 +0100 |
|---|---|---|
| committer | Marcel Holtmann <holtmann@holtmann.org> | 2004-01-13 06:17:12 +0100 |
| commit | 71f644c0dec2b329e7ee9e0580d56d9da7bb53a0 (patch) | |
| tree | 27bc765b0a595ed965ac68b120bea71503f15993 /include | |
| parent | d2d54085a53160a802edd42febc44c60393ae4c9 (diff) | |
[Bluetooth] Set disconnect timer for incoming ACL links
In general a Bluetooth stack that creates an ACL link should also take
care of its termination, but some Bluetooth devices think otherwise. The
problem is that the Bluetooth specification don't defines an ownership
of an ACL link and if nobody cares about it, two devices stay connected
even if there is no need. To avoid leftover ACL links the disconnect
timer must also be used for incoming connections, but it is set twice
the default disconnect timeout so the other side get enough time to
clean everything by itself.
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/bluetooth/hci_core.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index fd010a9dc75e..dd11dfdfe0bd 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -281,10 +281,12 @@ static inline void hci_conn_hold(struct hci_conn *conn) static inline void hci_conn_put(struct hci_conn *conn) { if (atomic_dec_and_test(&conn->refcnt)) { - if (conn->type == SCO_LINK) + if (conn->type == ACL_LINK) { + unsigned long timeo = (conn->out) ? + HCI_DISCONN_TIMEOUT : HCI_DISCONN_TIMEOUT * 2; + hci_conn_set_timer(conn, timeo); + } else hci_conn_set_timer(conn, HZ / 100); - else if (conn->out) - hci_conn_set_timer(conn, HCI_DISCONN_TIMEOUT); } } |
