From: Marcel Holtmann Date: Tue, 1 Jul 2014 17:28:23 +0000 (+0200) Subject: Bluetooth: Do not trigger background scanning when HCI_AUTO_OFF is set X-Git-Tag: v3.17-rc1~106^2~12^2~41^2~195 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b8221770c984bcd185c93cb3a31acab27b67c94a;p=platform%2Fkernel%2Flinux-exynos.git Bluetooth: Do not trigger background scanning when HCI_AUTO_OFF is set When a new controller is initialized, but not powered from userspace at the moment, the HCI_AUTO_OFF flag is still set. During this period, userspace might program device for auto-connection, but never power on the controller. In this case do not try to start background scanning and leave it for later to be started. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg --- diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 0aa3924..25ed6d3 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -5306,6 +5306,7 @@ void hci_update_background_scan(struct hci_dev *hdev) if (!test_bit(HCI_UP, &hdev->flags) || test_bit(HCI_INIT, &hdev->flags) || test_bit(HCI_SETUP, &hdev->dev_flags) || + test_bit(HCI_AUTO_OFF, &hdev->dev_flags) || test_bit(HCI_UNREGISTER, &hdev->dev_flags)) return;