From: Gustavo Padovan <gustavo@padovan.org>
To: Jaganath Kanakkassery <jaganath.k@samsung.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2] Bluetooth: Fix incorrect ssp mode bit for non ssp devices
Date: Thu, 11 Apr 2013 02:33:43 -0300 [thread overview]
Message-ID: <20130411053343.GA19253@joana> (raw)
In-Reply-To: <1365487902-3553-1-git-send-email-jaganath.k@samsung.com>
Hi Jaganath,
* Jaganath Kanakkassery <jaganath.k@samsung.com> [2013-04-09 11:41:42 +0530]:
> Some faulty non ssp devices send extended inquiry response
> during device discovery which is a violation of 2.1 specification.
> So for these devices we set ssp bit during acl connection
> initiation thinking that it is an ssp device. But for these
> devices, in remote extended features event ssp supported bit
> will be off. But we are not clearing the ssp bit in that case
> and eventually ssp bit in conn flag will be incorrectly set for
> these devices.
>
> The software which has caused this issue is MecApp
> http://www.mecel.se/products/bluetooth/downloads/MecApp_download
>
> This patch does a workaround by clearing the ssp bit if it is
> not supported in remote extended features event
>
> hcidump log
> ----------
>
> < HCI Command: Inquiry (0x01|0x0001) plen 5
> lap 0x9e8b33 len 4 num 0
> > HCI Event: Command Status (0x0f) plen 4
> Inquiry (0x01|0x0001) status 0x00 ncmd 1
> > HCI Event: Extended Inquiry Result (0x2f) plen 255
> bdaddr 00:1B:DC:05:B5:25 mode 1 clkoffset 0x3263 class 0x3c0000 rssi -77
> Unknown type 0x42 with 8 bytes data
> Unknown type 0x1e with 2 bytes data
> > HCI Event: Inquiry Complete (0x01) plen 1
> status 0x00
>
> < HCI Command: Create Connection (0x01|0x0005) plen 13
> bdaddr 00:1B:DC:05:B5:25 ptype 0xcc18 rswitch 0x01 clkoffset 0x0000
> Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> > HCI Event: Command Status (0x0f) plen 4
> Create Connection (0x01|0x0005) status 0x00 ncmd 1
> > HCI Event: Connect Complete (0x03) plen 11
> status 0x00 handle 12 bdaddr 00:1B:DC:05:B5:25 type ACL encrypt 0x00
> < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
> handle 12
> > HCI Event: Command Status (0x0f) plen 4
> Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
> > HCI Event: Read Remote Supported Features (0x0b) plen 11
> status 0x00 handle 12
> Features: 0xff 0xff 0x8f 0x7e 0xd8 0x1f 0x5b 0x87
> < HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
> handle 12 page 1
> > HCI Event: Command Status (0x0f) plen 4
> Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
> > HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
> bdaddr 00:1B:DC:05:B5:25 mode 1
> > HCI Event: Max Slots Change (0x1b) plen 3
> handle 12 slots 5
> > HCI Event: Read Remote Extended Features (0x23) plen 13
> status 0x00 handle 12 page 1 max 0
> Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> < HCI Command: Remote Name Request (0x01|0x0019) plen 10
> bdaddr 00:1B:DC:05:B5:25 mode 2 clkoffset 0x0000
> > HCI Event: Command Status (0x0f) plen 4
> Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
> > HCI Event: Remote Name Req Complete (0x07) plen 255
> status 0x00 bdaddr 00:1B:DC:05:B5:25 name 'Bluetooth PTS Radio v4'
> < HCI Command: Authentication Requested (0x01|0x0011) plen 2
> handle 12
> > HCI Event: Command Status (0x0f) plen 4
> Authentication Requested (0x01|0x0011) status 0x00 ncmd 1
> > HCI Event: Link Key Request (0x17) plen 6
> bdaddr 00:1B:DC:05:B5:25
> < HCI Command: Link Key Request Negative Reply (0x01|0x000c) plen 6
> bdaddr 00:1B:DC:05:B5:25
> > HCI Event: Command Complete (0x0e) plen 10
> Link Key Request Negative Reply (0x01|0x000c) ncmd 1
> status 0x00 bdaddr 00:1B:DC:05:B5:25
> > HCI Event: PIN Code Request (0x16) plen 6
> bdaddr 00:1B:DC:05:B5:25
>
> Signed-off-by: Jaganath Kanakkassery <jaganath.k@samsung.com>
> ---
> net/bluetooth/hci_event.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index 0a2b128..c1af186 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -2935,6 +2935,10 @@ static void hci_remote_ext_features_evt(struct hci_dev *hdev,
>
> if (ev->features[0] & LMP_HOST_SSP)
> set_bit(HCI_CONN_SSP_ENABLED, &conn->flags);
> + else
> + /* This is a workaround for some devices which send eir
> + * which actually does not support ssp */
> + clear_bit(HCI_CONN_SSP_ENABLED, &conn->flags);
Since you added a comment after the else I would like to see braces both in
the if and else parts. Makes reading easier.
Gustavo
next prev parent reply other threads:[~2013-04-11 5:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-09 6:11 [PATCH v2] Bluetooth: Fix incorrect ssp mode bit for non ssp devices Jaganath Kanakkassery
2013-04-11 5:33 ` Gustavo Padovan [this message]
2013-04-15 5:33 ` Jaganath Kanakkassery
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=20130411053343.GA19253@joana \
--to=gustavo@padovan.org \
--cc=jaganath.k@samsung.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