linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Padovan <padovan@profusion.mobi>
To: Rene Herman <rene.herman@gmail.com>
Cc: 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 13:52:25 -0200	[thread overview]
Message-ID: <20111228155225.GA23292@joana> (raw)
In-Reply-To: <4EFA7696.6060506@gmail.com>

Hi Rene,

* Rene Herman <rene.herman@gmail.com> [2011-12-28 02:53:26 +0100]:

> On 28-12-11 02:28, Gustavo Padovan wrote:
> 
> >>For some reason your adapter is returning here the same value of
> >>Read Local Features. I would say your device is broken.  The only
> >>fix I have in mind now is throw away the device.
> >
> >Yes, I have one of these ISSC devices, it's completely broken
> >device.
> 
> It worked well upto and including 2.6.29 though.

We never used Extended Features before 2.6.39

> 
> This would seem to be the kind of thing other subsystems use quirk
> handling for. The device identifies itself as "1131:1004":
> 
> Bus 002 Device 002: ID 1131:1004 Integrated System Solution Corp.
> Bluetooth Device
> 
> Do you guys have infra-structure in place for adapter-specific
> (quitk) handling?

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,

  parent reply	other threads:[~2011-12-28 15:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4EF3BACA.1080405@gmail.com>
2011-12-27 17:22 ` [bluetooth] linux-3.x regression (bisected) 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 [this message]
2011-12-28 16:04                 ` David Herrmann
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 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=20111228155225.GA23292@joana \
    --to=padovan@profusion.mobi \
    --cc=andre.guedes@openbossa.org \
    --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 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).