Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Do not trigger background scanning when HCI_AUTO_OFF is set
@ 2014-07-01 17:28 Marcel Holtmann
  2014-07-01 17:47 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Marcel Holtmann @ 2014-07-01 17:28 UTC (permalink / raw)
  To: linux-bluetooth

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 <marcel@holtmann.org>
---
 net/bluetooth/hci_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 0aa392406629..25ed6d3de410 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;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] Bluetooth: Do not trigger background scanning when HCI_AUTO_OFF is set
  2014-07-01 17:28 [PATCH 1/2] Bluetooth: Do not trigger background scanning when HCI_AUTO_OFF is set Marcel Holtmann
@ 2014-07-01 17:47 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2014-07-01 17:47 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

On Tue, Jul 01, 2014, Marcel Holtmann wrote:
> 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 <marcel@holtmann.org>
> ---
>  net/bluetooth/hci_core.c | 1 +
>  1 file changed, 1 insertion(+)

Both patches have been applied to bluetooth-next. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-01 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-01 17:28 [PATCH 1/2] Bluetooth: Do not trigger background scanning when HCI_AUTO_OFF is set Marcel Holtmann
2014-07-01 17:47 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox