From: Andre Guedes <andre.guedes@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 1/2] Bluetooth: Fix discovery state machine
Date: Mon, 13 Feb 2012 15:41:01 -0300 [thread overview]
Message-ID: <1329158462-28914-1-git-send-email-andre.guedes@openbossa.org> (raw)
In case of Start Discovery command failure, we should set the
discovery state to DISCOVERY_STOPPED. Otherwise, we stuck at
DISCOVERY_STARTING state and subsequent Start Discovery commands
will simply fail.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
net/bluetooth/mgmt.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index a2c2e12..a01d0af 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2997,6 +2997,8 @@ int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status)
struct pending_cmd *cmd;
int err;
+ hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
+
cmd = mgmt_pending_find(MGMT_OP_START_DISCOVERY, hdev);
if (!cmd)
return -ENOENT;
--
1.7.9
next 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 Andre Guedes [this message]
2012-02-13 18:41 ` [PATCH 2/2] Bluetooth: DISCOVERY_STOPPED state Andre Guedes
2012-02-15 12:31 ` 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-1-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