From: Sudha Bheemanna Date: Thu, 8 Sep 2016 09:24:54 +0000 (+0530) Subject: Bluetooth: Enable inquiry and page scan X-Git-Tag: accepted/tizen/unified/20191111.065916~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9509095a7feb5b95349f081a458230dbb38d8cc;p=platform%2Fkernel%2Flinux-rpi.git 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: Ifb28be7d23f237d35112b2e0739ed55169baacf7 Signed-off-by: Sudha Bheemanna Signed-off-by: Amit Purwar --- diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 5fec8e6..d464399 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -2815,6 +2815,22 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) if (type == LE_LINK) hci_req_reenable_advertising(hdev); +#ifdef TIZEN_BT + if (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); }