Bluetooth: AMP: Hanlde AMP_LINK case in conn_put

Handle AMP link when setting up disconnect timeout.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
This commit is contained in:
Andrei Emeltchenko 2012-10-10 17:38:31 +03:00 committed by Gustavo Padovan
parent bd1eb66ba4
commit 716e4ab5c9
1 changed files with 14 additions and 3 deletions

View File

@ -605,7 +605,10 @@ static inline void hci_conn_put(struct hci_conn *conn)
if (atomic_dec_and_test(&conn->refcnt)) { if (atomic_dec_and_test(&conn->refcnt)) {
unsigned long timeo; unsigned long timeo;
if (conn->type == ACL_LINK || conn->type == LE_LINK) {
switch (conn->type) {
case ACL_LINK:
case LE_LINK:
del_timer(&conn->idle_timer); del_timer(&conn->idle_timer);
if (conn->state == BT_CONNECTED) { if (conn->state == BT_CONNECTED) {
timeo = conn->disc_timeout; timeo = conn->disc_timeout;
@ -614,12 +617,20 @@ static inline void hci_conn_put(struct hci_conn *conn)
} else { } else {
timeo = msecs_to_jiffies(10); timeo = msecs_to_jiffies(10);
} }
} else { break;
case AMP_LINK:
timeo = conn->disc_timeout;
break;
default:
timeo = msecs_to_jiffies(10); timeo = msecs_to_jiffies(10);
break;
} }
cancel_delayed_work(&conn->disc_work); cancel_delayed_work(&conn->disc_work);
queue_delayed_work(conn->hdev->workqueue, queue_delayed_work(conn->hdev->workqueue,
&conn->disc_work, timeo); &conn->disc_work, timeo);
} }
} }