Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/3] Bluetooth: Fix indicating discovery state when canceling inquiry
@ 2014-06-10 11:05 johan.hedberg
  2014-06-10 11:05 ` [PATCH 2/3] Bluetooth: Refactor discovery stopping into its own function johan.hedberg
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: johan.hedberg @ 2014-06-10 11:05 UTC (permalink / raw)
  To: linux-bluetooth

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

When inquiry is canceled through the HCI_Cancel_Inquiry command there is
no Inquiry Complete event generated. Instead, all we get is the command
complete for the HCI_Inquiry_Cancel command. This means that we must
call the hci_discovery_set_state() function from the respective command
complete handler in order to ensure that user space knows the correct
discovery state.

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

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 3415c3468f15..ec1b17467133 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -48,6 +48,10 @@ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb)
 	smp_mb__after_clear_bit(); /* wake_up_bit advises about this barrier */
 	wake_up_bit(&hdev->flags, HCI_INQUIRY);
 
+	hci_dev_lock(hdev);
+	hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
+	hci_dev_unlock(hdev);
+
 	hci_conn_check_pending(hdev);
 }
 
-- 
1.9.3


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

end of thread, other threads:[~2014-06-10 11:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-10 11:05 [PATCH 1/3] Bluetooth: Fix indicating discovery state when canceling inquiry johan.hedberg
2014-06-10 11:05 ` [PATCH 2/3] Bluetooth: Refactor discovery stopping into its own function johan.hedberg
2014-06-10 11:59   ` Marcel Holtmann
2014-06-10 11:05 ` [PATCH 3/3] Bluetooth: Reuse hci_stop_discovery function when cleaning up HCI state johan.hedberg
2014-06-10 11:59   ` Marcel Holtmann
2014-06-10 11:59 ` [PATCH 1/3] Bluetooth: Fix indicating discovery state when canceling inquiry Marcel Holtmann

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