2012-01-16 08:04:28

by Hemant Gupta

[permalink] [raw]
Subject: [PATCH v1 0/1] Send correct response to IO Capability Request

This patch updates the IO Capability to DisplayYesNo in case Local Device
IO capability is set to KeyboardDisplay, which is a valid IO capability
for LE Device pairing using SMP.
Without this patch, SSP pairing for 2.1 Devices will not work for devices
having IO Capability set as Keyboard Display.

Hemant Gupta (1):
Bluetooth: Send correct response to IO Capability Request

net/bluetooth/hci_event.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)



2012-01-23 14:37:04

by Hemant Gupta

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] Bluetooth: Send correct response to IO Capability Request

Hi Marcel,

On Wed, Jan 18, 2012 at 5:53 PM, Johan Hedberg <[email protected]> wr=
ote:
> Hi Hemant,
>
> On Mon, Jan 16, 2012, Hemant Gupta wrote:
>> This patch sends correct IO Capability response to remote device
>> in case Local Device supports KeyBoardDisplay IO Capability as
>> this capability is not valid as per BT spec for IO capability
>> Request Reply Command.
>> This capability is mapped to DisplayYesNo which is in accordance
>> with BT spec.
>>
>> Signed-off-by: Hemant Gupta <[email protected]>
>> ---
>> =A0net/bluetooth/hci_event.c | =A0 =A06 +++++-
>> =A01 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
>> index d37f5b2..3590e72 100644
>> --- a/net/bluetooth/hci_event.c
>> +++ b/net/bluetooth/hci_event.c
>> @@ -2782,7 +2782,11 @@ static inline void hci_io_capa_request_evt(struct=
hci_dev *hdev, struct sk_buff
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct hci_cp_io_capability_reply cp;
>>
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 bacpy(&cp.bdaddr, &ev->bdaddr);
>> - =A0 =A0 =A0 =A0 =A0 =A0 cp.capability =3D conn->io_capability;
>> + =A0 =A0 =A0 =A0 =A0 =A0 /*
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0* Change the IO capability from KeyboardDis=
play
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0* to DisplayYesNo as it is not supported by=
BT spec.
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0*/
>> + =A0 =A0 =A0 =A0 =A0 =A0 cp.capability =3D (conn->io_capability =3D=3D =
0x04) ? 0x01 : conn->io_capability;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 conn->auth_type =3D hci_get_auth_req(conn);
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 cp.authentication =3D conn->auth_type;
>
> Looks good to me but this still needs Marcel's ack before I apply it to
> my bluetooth-next tree.
>
> Johan

Could you please provide comments on this patch, as with the
application of BlueZ patch, SSP pairing would not work in case local
device has set the IO Capability to KeyboardDisplay (0x04).

--=20
Best Regards
Hemant Gupta
ST-Ericsson India

2012-01-18 12:23:54

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] Bluetooth: Send correct response to IO Capability Request

Hi Hemant,

On Mon, Jan 16, 2012, Hemant Gupta wrote:
> This patch sends correct IO Capability response to remote device
> in case Local Device supports KeyBoardDisplay IO Capability as
> this capability is not valid as per BT spec for IO capability
> Request Reply Command.
> This capability is mapped to DisplayYesNo which is in accordance
> with BT spec.
>
> Signed-off-by: Hemant Gupta <[email protected]>
> ---
> net/bluetooth/hci_event.c | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index d37f5b2..3590e72 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -2782,7 +2782,11 @@ static inline void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff
> struct hci_cp_io_capability_reply cp;
>
> bacpy(&cp.bdaddr, &ev->bdaddr);
> - cp.capability = conn->io_capability;
> + /*
> + * Change the IO capability from KeyboardDisplay
> + * to DisplayYesNo as it is not supported by BT spec.
> + */
> + cp.capability = (conn->io_capability == 0x04) ? 0x01 : conn->io_capability;
> conn->auth_type = hci_get_auth_req(conn);
> cp.authentication = conn->auth_type;

Looks good to me but this still needs Marcel's ack before I apply it to
my bluetooth-next tree.

Johan

2012-01-16 08:04:29

by Hemant Gupta

[permalink] [raw]
Subject: [PATCH v1 1/1] Bluetooth: Send correct response to IO Capability Request

This patch sends correct IO Capability response to remote device
in case Local Device supports KeyBoardDisplay IO Capability as
this capability is not valid as per BT spec for IO capability
Request Reply Command.
This capability is mapped to DisplayYesNo which is in accordance
with BT spec.

Signed-off-by: Hemant Gupta <[email protected]>
---
net/bluetooth/hci_event.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index d37f5b2..3590e72 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2782,7 +2782,11 @@ static inline void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff
struct hci_cp_io_capability_reply cp;

bacpy(&cp.bdaddr, &ev->bdaddr);
- cp.capability = conn->io_capability;
+ /*
+ * Change the IO capability from KeyboardDisplay
+ * to DisplayYesNo as it is not supported by BT spec.
+ */
+ cp.capability = (conn->io_capability == 0x04) ? 0x01 : conn->io_capability;
conn->auth_type = hci_get_auth_req(conn);
cp.authentication = conn->auth_type;

--
1.6.6.1


2012-02-02 01:16:46

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] Bluetooth: Send correct response to IO Capability Request

Hi Hemant,

On Mon, Jan 16, 2012, Hemant Gupta wrote:
> This patch sends correct IO Capability response to remote device
> in case Local Device supports KeyBoardDisplay IO Capability as
> this capability is not valid as per BT spec for IO capability
> Request Reply Command.
> This capability is mapped to DisplayYesNo which is in accordance
> with BT spec.
>
> Signed-off-by: Hemant Gupta <[email protected]>
> ---
> net/bluetooth/hci_event.c | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan