From: Dmitriy Paliy <dmitriy.paliy@nokia.com>
To: linux-bluetooth@vger.kernel.org
Cc: Dmitriy Paliy <dmitriy.paliy@nokia.com>
Subject: [PATCH BlueZ 4/4] Fix disallow entering in sniff mode while SCO is open
Date: Tue, 24 Jan 2012 14:58:56 +0200 [thread overview]
Message-ID: <1327409936-6709-5-git-send-email-dmitriy.paliy@nokia.com> (raw)
In-Reply-To: <1327409936-6709-1-git-send-email-dmitriy.paliy@nokia.com>
Some Bluetooth controllers do not handle well entering sniff mode
requests while SCO channel is active, which may result in instability
in firmware.
This patch disallows entering sniff mode while SCO channel is open, and
restores link policy settings back to its default value when SCO is
closed.
The real problem is in firmware but this workaround helps to avoid
related to it problems.
---
audio/headset.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/audio/headset.c b/audio/headset.c
index 819e0f8..2e5193d 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -581,6 +581,8 @@ static void sco_connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
DBG("SCO socket opened for headset %s", dev->path);
+ manager_allow_sniff(dev, FALSE);
+
sk = g_io_channel_unix_get_fd(chan);
DBG("SCO fd=%d", sk);
@@ -1243,6 +1245,8 @@ static void close_sco(struct audio_device *device)
g_io_channel_shutdown(hs->sco, TRUE, NULL);
g_io_channel_unref(hs->sco);
hs->sco = NULL;
+
+ manager_allow_sniff(device, TRUE);
}
if (hs->sco_id) {
--
1.7.5.4
next prev parent reply other threads:[~2012-01-24 12:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-24 12:58 [RFC BlueZ 0/4] Add hciops_allow_sniff to disable and restore LMP_SNIFF bit Dmitriy Paliy
2012-01-24 12:58 ` [PATCH BlueZ 1/4] " Dmitriy Paliy
2012-01-24 12:58 ` [PATCH BlueZ 2/4] Add btd_adapter_allow_sniff to adapter Dmitriy Paliy
2012-01-24 12:58 ` [PATCH BlueZ 3/4] Add manager_allow_sniff to audio manager Dmitriy Paliy
2012-01-24 12:58 ` Dmitriy Paliy [this message]
2012-01-24 13:23 ` [RFC BlueZ 0/4] Add hciops_allow_sniff to disable and restore LMP_SNIFF bit Luiz Augusto von Dentz
2012-01-25 8:06 ` Arnaud Mouiche
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=1327409936-6709-5-git-send-email-dmitriy.paliy@nokia.com \
--to=dmitriy.paliy@nokia.com \
--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;
as well as URLs for NNTP newsgroup(s).