From: Gustavo Padovan <padovan@profusion.mobi>
To: David Herrmann <dh.herrmann@googlemail.com>
Cc: Rene Herman <rene.herman@gmail.com>,
Andre Guedes <andre.guedes@openbossa.org>,
linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org,
Marcel Holtmann <marcel@holtmann.org>
Subject: Re: [bluetooth] linux-3.x regression (bisected)
Date: Wed, 28 Dec 2011 14:16:44 -0200 [thread overview]
Message-ID: <20111228161644.GB23292@joana> (raw)
In-Reply-To: <CANq1E4ROqGMkd-M+zMJtzdqC1j9AcUztJ+L2S0tsqtyiQhA89A@mail.gmail.com>
Hi David,
* David Herrmann <dh.herrmann@googlemail.com> [2011-12-28 17:04:11 +0100]:
> On Wed, Dec 28, 2011 at 4:52 PM, Gustavo Padovan <padovan@profusion.mobi>=
wrote:
> ..snip..
> > I think this patch can do handling, let's see what others think.
> >
> > =A0 =A0 =A0 =A0Gustavo
> >
> >
> > ---
> > Author: Gustavo F. Padovan <padovan@profusion.mobi>
> > Date: =A0 Wed Dec 28 13:40:02 2011 -0200
> >
> > =A0 =A0Bluetooth: Fix lmp_host_le_capable() check for broken devices
> >
> > =A0 =A0Some dongles reports a wrong Local Extended Features leading the=
kernel
> > =A0 =A0think that dongle support LE while it don't.
> >
> > =A0 =A0The fix here is just rely on a bit in Local Features (LE Capable=
) to tell
> > =A0 =A0us if the device really supports LE.
> >
> > =A0 =A0LE Host Capable is the only bit used from Local Extended Feature=
s in our
> > =A0 =A0kernel.
> >
> > =A0 =A0Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
> >
> > diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/h=
ci_core.h
> > index 5e2e984..c693111 100644
> > --- a/include/net/bluetooth/hci_core.h
> > +++ b/include/net/bluetooth/hci_core.h
> > @@ -676,7 +676,11 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
> > =A0#define lmp_le_capable(dev) =A0 =A0 =A0 =A0((dev)->features[4] & LMP=
_LE)
> >
> > =A0/* ----- Extended LMP capabilities ----- */
> > -#define lmp_host_le_capable(dev) =A0 ((dev)->extfeatures[0] & LMP_HOST=
_LE)
> > +/* Some crap dongles does not report a proper Local Extended Features =
causing
> > + * the kernel to wrongly init it as a LE device. So first check if it =
is LE
> > + * capable (controller) which is a info from the Local Features */
> > +#define lmp_host_le_capable(dev) =A0 =A0( lmp_le_capable(dev) && \
> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 (dev)->extfeatures[0] & LMP_HOST_LE)
> >
> > =A0/* ----- HCI protocols ----- */
> > =A0static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr=
_t *bdaddr,
>=20
> Next time we use the extfeatures for something else, we will break
> this device again. Can't we fix dev->extfeatures on initialization
> based on a blacklist/quirklist? Or is dev->extfeatures modified after
> initialzation of the device somewhere?
Sure, we will, but I don't see us using another bit of extfeatures in the n=
ear
future (after the next Core Spec release maybe) and I don't wanna got that =
far
in this fix right now.
Gustavo
WARNING: multiple messages have this Message-ID (diff)
From: Gustavo Padovan <padovan@profusion.mobi>
To: David Herrmann <dh.herrmann@googlemail.com>
Cc: Rene Herman <rene.herman@gmail.com>,
Andre Guedes <andre.guedes@openbossa.org>,
linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org,
Marcel Holtmann <marcel@holtmann.org>
Subject: Re: [bluetooth] linux-3.x regression (bisected)
Date: Wed, 28 Dec 2011 14:16:44 -0200 [thread overview]
Message-ID: <20111228161644.GB23292@joana> (raw)
In-Reply-To: <CANq1E4ROqGMkd-M+zMJtzdqC1j9AcUztJ+L2S0tsqtyiQhA89A@mail.gmail.com>
Hi David,
* David Herrmann <dh.herrmann@googlemail.com> [2011-12-28 17:04:11 +0100]:
> On Wed, Dec 28, 2011 at 4:52 PM, Gustavo Padovan <padovan@profusion.mobi> wrote:
> ..snip..
> > I think this patch can do handling, let's see what others think.
> >
> > Gustavo
> >
> >
> > ---
> > Author: Gustavo F. Padovan <padovan@profusion.mobi>
> > Date: Wed Dec 28 13:40:02 2011 -0200
> >
> > Bluetooth: Fix lmp_host_le_capable() check for broken devices
> >
> > Some dongles reports a wrong Local Extended Features leading the kernel
> > think that dongle support LE while it don't.
> >
> > The fix here is just rely on a bit in Local Features (LE Capable) to tell
> > us if the device really supports LE.
> >
> > LE Host Capable is the only bit used from Local Extended Features in our
> > kernel.
> >
> > Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
> >
> > diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
> > index 5e2e984..c693111 100644
> > --- a/include/net/bluetooth/hci_core.h
> > +++ b/include/net/bluetooth/hci_core.h
> > @@ -676,7 +676,11 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
> > #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)
> >
> > /* ----- Extended LMP capabilities ----- */
> > -#define lmp_host_le_capable(dev) ((dev)->extfeatures[0] & LMP_HOST_LE)
> > +/* Some crap dongles does not report a proper Local Extended Features causing
> > + * the kernel to wrongly init it as a LE device. So first check if it is LE
> > + * capable (controller) which is a info from the Local Features */
> > +#define lmp_host_le_capable(dev) ( lmp_le_capable(dev) && \
> > + (dev)->extfeatures[0] & LMP_HOST_LE)
> >
> > /* ----- HCI protocols ----- */
> > static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
>
> Next time we use the extfeatures for something else, we will break
> this device again. Can't we fix dev->extfeatures on initialization
> based on a blacklist/quirklist? Or is dev->extfeatures modified after
> initialzation of the device somewhere?
Sure, we will, but I don't see us using another bit of extfeatures in the near
future (after the next Core Spec release maybe) and I don't wanna got that far
in this fix right now.
Gustavo
next prev parent reply other threads:[~2011-12-28 16:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-22 23:18 [bluetooth] linux-3.x regression (bisected) Rene Herman
2011-12-27 17:22 ` Andre Guedes
2011-12-27 19:38 ` Rene Herman
2011-12-27 20:30 ` Gustavo Padovan
2011-12-27 22:19 ` Rene Herman
2011-12-28 1:22 ` Gustavo Padovan
2011-12-28 1:28 ` Gustavo Padovan
2011-12-28 1:53 ` Rene Herman
2011-12-28 1:57 ` Rene Herman
2011-12-28 15:52 ` Gustavo Padovan
2011-12-28 16:04 ` David Herrmann
2011-12-28 16:04 ` David Herrmann
2011-12-28 16:16 ` Gustavo Padovan [this message]
2011-12-28 16:16 ` Gustavo Padovan
2011-12-28 16:48 ` Marcel Holtmann
2011-12-28 17:24 ` Rene Herman
2011-12-28 22:17 ` Rene Herman
2011-12-28 23:07 ` Marcel Holtmann
2011-12-29 0:22 ` Rene Herman
2012-01-04 12:04 ` Rene Herman
2012-01-04 14:16 ` Andre Guedes
2012-01-04 14:16 ` Andre Guedes
2012-01-04 15:12 ` Rene Herman
2011-12-28 16:54 ` Rene Herman
2011-12-28 17:12 ` Marcel Holtmann
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=20111228161644.GB23292@joana \
--to=padovan@profusion.mobi \
--cc=andre.guedes@openbossa.org \
--cc=dh.herrmann@googlemail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=rene.herman@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.