From: Marcel Holtmann <marcel@holtmann.org>
To: Lan Zhu <zhu.lan.cn@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: can we disable/enable eSCO by using setsockopt of sco socket?
Date: Mon, 14 Sep 2009 06:32:34 -0700 [thread overview]
Message-ID: <1252935154.3421.17.camel@localhost.localdomain> (raw)
In-Reply-To: <113d36d80909140452jb808a2bub393aae7307c7450@mail.gmail.com>
Hi,
> When we connect a SCO socket, BlueZ decides whether to connect SCO or
> eSCO type according to the remote feature. If the remote device
> declares supporting eSCO in the remote feature, BlueZ will select eSCO
> type to connect with it.
>
> But in fact there are some old carkits or headsets which are only
> support SCO but wrongly declare to support eSCO, such as Motorola
> HF850 and HS820 which use a very old CSR chip, so we have problem to
> create sco connection with them.
>
> We thought a method to resolve this issue, which is force to create
> SCO type connection if we find the HFP version of one remote device is
> less than 1.2. So we need a method to control the SCO type from user
> space. We want to use setsockopt() functon to do that. The code change
> in net/bluetooth/sco.c is like below,
>
>
> @@ -653,12 +653,25 @@ static int sco_sock_setsockopt(struct socket *sock, int le
> {
> struct sock *sk = sock->sk;
> int err = 0;
> + u32 opt;
>
> BT_DBG("sk %p", sk);
>
> lock_sock(sk);
>
> + if (level != SOL_SCO) {
> + err = -ENOPROTOOPT;
> + return err;
> + }
> +
> switch (optname) {
> + case BT_DISABLE_ESCO:
> + if (get_user(opt, (u32 __user *) optval)) {
> + err = -EFAULT;
> + break;
> + }
> + disable_esco = opt;
> + break;
> default:
> err = -ENOPROTOOPT;
> break;
>
>
> Then, in the user space, we can call setsockopt(fd, SOL_SCO,
> BT_DISABLE_ESCO, &disabled, sizeof(disabled)) to force to connect SCO.
>
> Do you agree with this change?
I don't. You first have to prove to me that this change is needed at
all. Show me the hcidump -X -V connections attempts for these carkits.
Also your analysis is wrong. BlueZ doesn't care if the remote headset
supports eSCO or not. We just care about if our local controller has the
synchronous setup commands. It is the job of the link manager inside the
controller firmware to either establish SCO or eSCO. And we do retry
with SCO if eSCO fails. This sounds more like the case that you have an
outdated kernel.
Regards
Marcel
next prev parent reply other threads:[~2009-09-14 13:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-14 11:52 can we disable/enable eSCO by using setsockopt of sco socket? Lan Zhu
2009-09-14 13:32 ` Marcel Holtmann [this message]
2009-09-14 15:29 ` Lan Zhu
2009-09-18 10:47 ` Lan Zhu
2009-09-18 15:31 ` Marcel Holtmann
2009-09-18 16:13 ` Peter Hurley
2009-09-19 5:50 ` Marcel Holtmann
2009-09-22 23:09 ` Nick Pelly
-- strict thread matches above, loose matches on Subject: below --
2010-01-12 9:57 Liang Bao
2010-01-12 11:22 ` Marcel Holtmann
2010-01-12 13:39 ` Liang Bao
2010-01-12 18:45 ` Marcel Holtmann
2010-01-15 6:31 ` Liang Bao
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=1252935154.3421.17.camel@localhost.localdomain \
--to=marcel@holtmann.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=zhu.lan.cn@gmail.com \
/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).