Bluetooth: Cancel the Sniff timer 38/261638/1
authorSudha Bheemanna <b.sudha@samsung.com>
Thu, 8 Sep 2016 11:31:39 +0000 (17:01 +0530)
committerWootak Jung <wootak.jung@samsung.com>
Wed, 21 Jul 2021 05:07:34 +0000 (14:07 +0900)
This patch adds code to cancel the sniff timer.

Change-Id: I756d3b08acf6462044d1fb204064fe12ce1238c1
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
net/bluetooth/hci_conn.c

index 2a3b3b8..e64f0b3 100644 (file)
@@ -1429,9 +1429,18 @@ void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active)
        }
 
 timer:
+#ifdef TIZEN_BT
+       if (hdev->idle_timeout > 0) {
+               /* Sniff timer cancel */
+               cancel_delayed_work(&conn->idle_work);
+               queue_delayed_work(hdev->workqueue, &conn->idle_work,
+                                  msecs_to_jiffies(hdev->idle_timeout));
+       }
+#else
        if (hdev->idle_timeout > 0)
                queue_delayed_work(hdev->workqueue, &conn->idle_work,
                                   msecs_to_jiffies(hdev->idle_timeout));
+#endif
 }
 
 /* Drop all connection on the device */