From: Andre Guedes <andre.guedes@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 2/2] Bluetooth: DISCOVERY_STOPPED state
Date: Mon, 13 Feb 2012 15:41:02 -0300 [thread overview]
Message-ID: <1329158462-28914-2-git-send-email-andre.guedes@openbossa.org> (raw)
In-Reply-To: <1329158462-28914-1-git-send-email-andre.guedes@openbossa.org>
We are not supposed to send mgmt_discovering events if we are
transiting from DISCOVERY_STARTING to DISCOVERY_STOPPED state.
It doesn't make sense to send mgmt_discovering event once
discovery procedure has not been even started.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
net/bluetooth/hci_core.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 9ada164..dc31e7d 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -380,7 +380,8 @@ void hci_discovery_set_state(struct hci_dev *hdev, int state)
switch (state) {
case DISCOVERY_STOPPED:
- mgmt_discovering(hdev, 0);
+ if (hdev->discovery.state != DISCOVERY_STARTING)
+ mgmt_discovering(hdev, 0);
break;
case DISCOVERY_STARTING:
break;
--
1.7.9
next prev parent reply other threads:[~2012-02-13 18:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-13 18:41 [PATCH 1/2] Bluetooth: Fix discovery state machine Andre Guedes
2012-02-13 18:41 ` Andre Guedes [this message]
2012-02-15 12:31 ` [PATCH 2/2] Bluetooth: DISCOVERY_STOPPED state Marcel Holtmann
2012-02-15 12:30 ` [PATCH 1/2] Bluetooth: Fix discovery state machine Marcel Holtmann
2012-02-15 13:25 ` Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1329158462-28914-2-git-send-email-andre.guedes@openbossa.org \
--to=andre.guedes@openbossa.org \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox