]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Bluetooth: AMP: Hanlde AMP_LINK case in conn_put
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Wed, 10 Oct 2012 14:38:31 +0000 (17:38 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Thu, 11 Oct 2012 06:34:46 +0000 (14:34 +0800)
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>
include/net/bluetooth/hci_core.h

index d5ed054d77cf97a77b1522a1d71a97c66172c9a9..9fe8e2dec870c57073d24aaf1b0ff6ebfbfc1801 100644 (file)
@@ -605,7 +605,10 @@ 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 || conn->type == LE_LINK) {
+
+               switch (conn->type) {
+               case ACL_LINK:
+               case LE_LINK:
                        del_timer(&conn->idle_timer);
                        if (conn->state == BT_CONNECTED) {
                                timeo = conn->disc_timeout;
@@ -614,12 +617,20 @@ static inline void hci_conn_put(struct hci_conn *conn)
                        } else {
                                timeo = msecs_to_jiffies(10);
                        }
-               } else {
+                       break;
+
+               case AMP_LINK:
+                       timeo = conn->disc_timeout;
+                       break;
+
+               default:
                        timeo = msecs_to_jiffies(10);
+                       break;
                }
+
                cancel_delayed_work(&conn->disc_work);
                queue_delayed_work(conn->hdev->workqueue,
-                                       &conn->disc_work, timeo);
+                                  &conn->disc_work, timeo);
        }
 }