linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <padovan@profusion.mobi>,
	Andre Guedes <andre.guedes@openbossa.org>,
	linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org
Subject: Re: [bluetooth] linux-3.x regression (bisected)
Date: Thu, 29 Dec 2011 01:22:01 +0100	[thread overview]
Message-ID: <4EFBB2A9.5040804@gmail.com> (raw)
In-Reply-To: <1325113623.1965.289.camel@aeonflux>

On 29-12-11 00:07, Marcel Holtmann wrote:

>> By the way, while the bluetooth (2.0) spec seems to consist of a 1230
>> page document that I am most certainly not going to study ...
>>
>> ... I couldn't help noticing that the HCI_Read_Local_Extended_Features
>> command is in fact specified to return "The highest features page number
>> which contains non-zero bits for the local device", and if I look at the
>> above, it seems to indeed return max=0.
>>
>> Is it as such not in fact the case that the dongle is spec-compliant,
>> whereas it's the linux code that neglects to check that return value in
>> order to make sure that it requested a valid page?
>
> the Linux code indeed is broken for not checking the returned page, but
> it is broken for different reasons.
>
> However the expected result from the dongle would be an error code and
> not just returning page 0 instead.

Okay. Just as an additional data point:

I came across the HCI_Read_Local_Supported_Commands command in the spec 
a few pages up and quickly verified that the adapter doesn't in fact 
deny support for the HCI_Read_Local_Extended_Features command.

That is, after applying the below, I do get:

hci_cc_read_local_commands:hci0 status 0x0
hci_cc_read_local_commands:hci0 commands[14] 0xe8

which does claim support for the command (bit 6 of commands[14]).

Thought I'd check since if it hadn't, that would imply a certain fix but 
that can't be used then.

I'll stand by to test whatever final solution is arrived at.

(although I don't personally care, linux 3.0.y and 3.1.y may want it as 
well at that point I guess).

Rene.

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 8fe270c..0ac87ea 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -622,6 +622,7 @@ static void hci_cc_read_local_commands(struct 
hci_dev *hdev, struct sk_buff *skb
                 goto done;

         memcpy(hdev->commands, rp->commands, sizeof(hdev->commands));
+       BT_DBG("%s commands[14] 0x%x", hdev->name, rp->commands[14]);

         if (test_bit(HCI_INIT, &hdev->flags) && (hdev->commands[5] & 0x10))
                 hci_setup_link_policy(hdev);

  reply	other threads:[~2011-12-29  0:22 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
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 [this message]
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=4EFBB2A9.5040804@gmail.com \
    --to=rene.herman@gmail.com \
    --cc=andre.guedes@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=padovan@profusion.mobi \
    /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).