From baea1a3b7dd49c8a0a916a3b360b4a5426dba4c2 Mon Sep 17 00:00:00 2001 From: Sudha Bheemanna Date: Thu, 8 Sep 2016 14:54:54 +0530 Subject: [PATCH] Bluetooth: Enable inquiry and page scan This patch enables the inquiry and page scan after ACL disconnection with one device and if there are no other devices connected. Change-Id: I2bf8368071b8b7abaa8ae1200d851fa3dfc6e153 Signed-off-by: Sudha Bheemanna Signed-off-by: Amit Purwar Signed-off-by: Wootak Jung Signed-off-by: Jaehoon Chung --- net/bluetooth/hci_event.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 934021832b8d..e666aeb81ceb 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -3588,6 +3588,22 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, void *data, hci_conn_del(conn); +#ifdef TIZEN_BT + if (conn->type == ACL_LINK && !hci_conn_num(hdev, ACL_LINK)) { + int iscan; + int pscan; + + iscan = test_bit(HCI_ISCAN, &hdev->flags); + pscan = test_bit(HCI_PSCAN, &hdev->flags); + if (!iscan && !pscan) { + u8 scan_enable = SCAN_PAGE; + + hci_send_cmd(hdev, HCI_OP_WRITE_SCAN_ENABLE, + sizeof(scan_enable), &scan_enable); + } + } +#endif + unlock: hci_dev_unlock(hdev); } -- 2.34.1