Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Fix check for re-enabling advertising
@ 2014-07-08 13:05 johan.hedberg
  2014-07-08 13:05 ` [PATCH 2/2] Bluetooth: Fix setting STOPPING state for discovery johan.hedberg
  2014-07-08 13:12 ` [PATCH 1/2] Bluetooth: Fix check for re-enabling advertising Marcel Holtmann
  0 siblings, 2 replies; 4+ messages in thread
From: johan.hedberg @ 2014-07-08 13:05 UTC (permalink / raw)
  To: linux-bluetooth

From: Johan Hedberg <johan.hedberg@intel.com>

There are many different places that can disable LE scanning but we only
want to re-enable advertising in hci_cc_le_set_scan_enable() for a very
specific use case, which is when the active scanning part of Start
Discovery is complete. Because of this, fix the discovery state check to
test for the exact state.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 net/bluetooth/hci_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 5d3095d7d4b0..2b3d366e5d98 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1188,7 +1188,7 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev,
 				       &hdev->dev_flags))
 			hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
 		else if (!test_bit(HCI_LE_ADV, &hdev->dev_flags) &&
-			 hdev->discovery.state != DISCOVERY_STARTING)
+			 hdev->discovery.state == DISCOVERY_FINDING)
 			mgmt_reenable_advertising(hdev);
 
 		break;
-- 
1.9.3


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

end of thread, other threads:[~2014-07-08 13:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-08 13:05 [PATCH 1/2] Bluetooth: Fix check for re-enabling advertising johan.hedberg
2014-07-08 13:05 ` [PATCH 2/2] Bluetooth: Fix setting STOPPING state for discovery johan.hedberg
2014-07-08 13:12   ` Marcel Holtmann
2014-07-08 13:12 ` [PATCH 1/2] Bluetooth: Fix check for re-enabling advertising Marcel Holtmann

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