linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to to get L2CAP Enhanced Credit Based Mode working?
@ 2020-04-21 10:45 CEE Forostyan, Konstantin
  2020-04-21 12:42 ` Ryll, Jan (GED-SDD2)
  0 siblings, 1 reply; 6+ messages in thread
From: CEE Forostyan, Konstantin @ 2020-04-21 10:45 UTC (permalink / raw)
  To: linux-bluetooth

Hi All, 

I'm trying to enable L2CAP Enhanced Credit Based Mode in order to pass BT qualification test GATT/SR/GAC/BI-01-C, but it seems that something is still missing. When my BT stack receives "LE L2CAP: Enhanced Credit Connection Request (0x17)" it answers with "LE L2CAP: Command Reject (0x01) / Reason: Command not understood (0x0000)"

I'm using BlueZ 5.54 and kernel '4.20.0-yocto-standard' with the following patches taken from 'bluetooth-next':

From 145720963b6c68d0c4054112c09050995259b8f8 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Mon, 2 Mar 2020 16:56:19 -0800
Subject: Bluetooth: L2CAP: Add definitions for Enhanced Credit Based Mode

From 15f02b91056253e8cdc592888f431da0731337b8 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Mon, 2 Mar 2020 16:56:20 -0800
Subject: Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode

From 4be5ca67d59d707a4b1c8608ca230ad65aa4f232 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Mon, 2 Mar 2020 16:56:21 -0800
Subject: Bluetooth: L2CAP: Add module option to enable ECRED mode

From da49b602f7f75ccc91386e1274b3ef71676cd092 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Wed, 25 Mar 2020 12:37:53 -0700
Subject: Bluetooth: L2CAP: Use DEFER_SETUP to group ECRED connections

Can anyone help me to enable "Enhanced Credit Based Mode", please?

Thank you and best regards,
Konstantin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: How to to get L2CAP Enhanced Credit Based Mode working?
  2020-04-21 10:45 How to to get L2CAP Enhanced Credit Based Mode working? CEE Forostyan, Konstantin
@ 2020-04-21 12:42 ` Ryll, Jan (GED-SDD2)
  2020-04-21 12:56   ` AW: " CEE Forostyan, Konstantin
  0 siblings, 1 reply; 6+ messages in thread
From: Ryll, Jan (GED-SDD2) @ 2020-04-21 12:42 UTC (permalink / raw)
  To: CEE Forostyan, Konstantin, linux-bluetooth

Hi Konstantin,

we have qualified the bluez-5.52 regarding Low Energy using Services and Characteristics with normal read, write and notify but also for long characteristics.
Only problem was a bug within bluez where wrong error code was returned in case of read/write at specific offset.
The response should be "InvalidOffset" but is "InvalidValueLength". We have fixed this here and submitted the bug. But no answer if patch is applied or not.

Best regards
Jan

-----Original Message-----
From: linux-bluetooth-owner@vger.kernel.org <linux-bluetooth-owner@vger.kernel.org> On Behalf Of CEE Forostyan, Konstantin
Sent: Tuesday, April 21, 2020 12:45 PM
To: linux-bluetooth@vger.kernel.org
Subject: How to to get L2CAP Enhanced Credit Based Mode working?

Hi All, 

I'm trying to enable L2CAP Enhanced Credit Based Mode in order to pass BT qualification test GATT/SR/GAC/BI-01-C, but it seems that something is still missing. When my BT stack receives "LE L2CAP: Enhanced Credit Connection Request (0x17)" it answers with "LE L2CAP: Command Reject (0x01) / Reason: Command not understood (0x0000)"

I'm using BlueZ 5.54 and kernel '4.20.0-yocto-standard' with the following patches taken from 'bluetooth-next':

From 145720963b6c68d0c4054112c09050995259b8f8 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Mon, 2 Mar 2020 16:56:19 -0800
Subject: Bluetooth: L2CAP: Add definitions for Enhanced Credit Based Mode

From 15f02b91056253e8cdc592888f431da0731337b8 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Mon, 2 Mar 2020 16:56:20 -0800
Subject: Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode

From 4be5ca67d59d707a4b1c8608ca230ad65aa4f232 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Mon, 2 Mar 2020 16:56:21 -0800
Subject: Bluetooth: L2CAP: Add module option to enable ECRED mode

From da49b602f7f75ccc91386e1274b3ef71676cd092 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Wed, 25 Mar 2020 12:37:53 -0700
Subject: Bluetooth: L2CAP: Use DEFER_SETUP to group ECRED connections

Can anyone help me to enable "Enhanced Credit Based Mode", please?

Thank you and best regards,
Konstantin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* AW: How to to get L2CAP Enhanced Credit Based Mode working?
  2020-04-21 12:42 ` Ryll, Jan (GED-SDD2)
@ 2020-04-21 12:56   ` CEE Forostyan, Konstantin
  2020-04-29 16:48     ` [PATCH] Bluetooth: L2CAP: Fix errors during L2CAP_CREDIT_BASED_CONNECTION_REQ (0x17) CEE Forostyan, Konstantin
  0 siblings, 1 reply; 6+ messages in thread
From: CEE Forostyan, Konstantin @ 2020-04-21 12:56 UTC (permalink / raw)
  To: Ryll, Jan (GED-SDD2), linux-bluetooth

Hi Jan,

Thank you for the answer. Did you succeed making GATT/SR/GAC/BI-01-C test as well?

I found out - thanks to Szymon Janc (sjanc) who gave an answer on the #bluez channel - that because of the patch "Add module option to enable ECRED mode" I have to enable 'enable_ecred' for the module 'bluetooth' in order to get L2CAP Enhanced Credit Based Mode support active.

Best regards,
Konstantin    


Von: Ryll, Jan (GED-SDD2) <Jan.Ryll@bshg.com>
Gesendet: Dienstag, 21. April 2020 14:42
An: CEE Forostyan, Konstantin; linux-bluetooth@vger.kernel.org
Betreff: RE: How to to get L2CAP Enhanced Credit Based Mode working?
    
Hi Konstantin,

we have qualified the bluez-5.52 regarding Low Energy using Services and Characteristics with normal read, write and notify but also for long characteristics.
Only problem was a bug within bluez where wrong error code was returned in case of read/write at specific offset.
The response should be "InvalidOffset" but is "InvalidValueLength". We have fixed this here and submitted the bug. But no answer if patch is applied or not.

Best regards
Jan

-----Original Message-----
From: linux-bluetooth-owner@vger.kernel.org <linux-bluetooth-owner@vger.kernel.org> On Behalf Of CEE Forostyan, Konstantin
Sent: Tuesday, April 21, 2020 12:45 PM
To: linux-bluetooth@vger.kernel.org
Subject: How to to get L2CAP Enhanced Credit Based Mode working?

Hi All, 

I'm trying to enable L2CAP Enhanced Credit Based Mode in order to pass BT qualification test GATT/SR/GAC/BI-01-C, but it seems that something is still missing. When my BT stack receives "LE L2CAP: Enhanced Credit Connection Request (0x17)" it answers with "LE  L2CAP: Command Reject (0x01) / Reason: Command not understood (0x0000)"

I'm using BlueZ 5.54 and kernel '4.20.0-yocto-standard' with the following patches taken from 'bluetooth-next':

From 145720963b6c68d0c4054112c09050995259b8f8 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Mon, 2 Mar 2020 16:56:19 -0800
Subject: Bluetooth: L2CAP: Add definitions for Enhanced Credit Based Mode

From 15f02b91056253e8cdc592888f431da0731337b8 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Mon, 2 Mar 2020 16:56:20 -0800
Subject: Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode

From 4be5ca67d59d707a4b1c8608ca230ad65aa4f232 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Mon, 2 Mar 2020 16:56:21 -0800
Subject: Bluetooth: L2CAP: Add module option to enable ECRED mode

From da49b602f7f75ccc91386e1274b3ef71676cd092 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Wed, 25 Mar 2020 12:37:53 -0700
Subject: Bluetooth: L2CAP: Use DEFER_SETUP to group ECRED connections

Can anyone help me to enable "Enhanced Credit Based Mode", please?

Thank you and best regards,
Konstantin

    

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] Bluetooth: L2CAP: Fix errors during L2CAP_CREDIT_BASED_CONNECTION_REQ (0x17)
  2020-04-21 12:56   ` AW: " CEE Forostyan, Konstantin
@ 2020-04-29 16:48     ` CEE Forostyan, Konstantin
  2020-04-29 17:17       ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 6+ messages in thread
From: CEE Forostyan, Konstantin @ 2020-04-29 16:48 UTC (permalink / raw)
  To: linux-bluetooth

Hi All,

During Bluetooth qualification tests I found out that Bluetooth stack responds with an error to a correct L2CAP_CREDIT_BASED_CONNECTION_REQ. Please review the 2 bugfixes I made in kernel in order to correct this problem.

Best regards
Konstantin


--- a/net/bluetooth/l2cap_core.c	2020-04-28 18:19:10.481887583 +0200
+++ b/net/bluetooth/l2cap_core.c	2020-04-28 18:21:41.000000000 +0200
@@ -5817,7 +5817,7 @@
 	if (!enable_ecred)
 		return -EINVAL;
 
-	if (cmd_len < sizeof(*req) || cmd_len - sizeof(*req) % sizeof(u16)) {
+	if (cmd_len < sizeof(*req) || (cmd_len - sizeof(*req)) % sizeof(u16)) {
 		result = L2CAP_CR_LE_INVALID_PARAMS;
 		goto response;
 	}
@@ -5855,7 +5855,7 @@
 	}
 
 	result = L2CAP_CR_LE_SUCCESS;
-	cmd_len -= sizeof(req);
+	cmd_len -= sizeof(*req);
 	num_scid = cmd_len / sizeof(u16);
 
 	for (i = 0; i < num_scid; i++) {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Bluetooth: L2CAP: Fix errors during L2CAP_CREDIT_BASED_CONNECTION_REQ (0x17)
  2020-04-29 16:48     ` [PATCH] Bluetooth: L2CAP: Fix errors during L2CAP_CREDIT_BASED_CONNECTION_REQ (0x17) CEE Forostyan, Konstantin
@ 2020-04-29 17:17       ` Luiz Augusto von Dentz
  2020-05-04 16:12         ` AW: " CEE Forostyan, Konstantin
  0 siblings, 1 reply; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2020-04-29 17:17 UTC (permalink / raw)
  To: CEE Forostyan, Konstantin; +Cc: linux-bluetooth

Hi Konstantin,

On Wed, Apr 29, 2020 at 9:52 AM CEE Forostyan, Konstantin
<Konstantin.Forostyan@peiker-cee.de> wrote:
>
> Hi All,
>
> During Bluetooth qualification tests I found out that Bluetooth stack responds with an error to a correct L2CAP_CREDIT_BASED_CONNECTION_REQ. Please review the 2 bugfixes I made in kernel in order to correct this problem.
>
> Best regards
> Konstantin
>
>
> --- a/net/bluetooth/l2cap_core.c        2020-04-28 18:19:10.481887583 +0200
> +++ b/net/bluetooth/l2cap_core.c        2020-04-28 18:21:41.000000000 +0200
> @@ -5817,7 +5817,7 @@
>         if (!enable_ecred)
>                 return -EINVAL;
>
> -       if (cmd_len < sizeof(*req) || cmd_len - sizeof(*req) % sizeof(u16)) {
> +       if (cmd_len < sizeof(*req) || (cmd_len - sizeof(*req)) % sizeof(u16)) {
>                 result = L2CAP_CR_LE_INVALID_PARAMS;
>                 goto response;
>         }
> @@ -5855,7 +5855,7 @@
>         }
>
>         result = L2CAP_CR_LE_SUCCESS;
> -       cmd_len -= sizeof(req);
> +       cmd_len -= sizeof(*req);
>         num_scid = cmd_len / sizeof(u16);
>
>         for (i = 0; i < num_scid; i++) {

Weird that I didn't run into this when creating the test for
l2cap-tester, they look correct though so please send them as proper
patches so we can apply to bluetooth-next, also please ensure
l2cap-tester is working.

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 6+ messages in thread

* AW: [PATCH] Bluetooth: L2CAP: Fix errors during L2CAP_CREDIT_BASED_CONNECTION_REQ (0x17)
  2020-04-29 17:17       ` Luiz Augusto von Dentz
@ 2020-05-04 16:12         ` CEE Forostyan, Konstantin
  0 siblings, 0 replies; 6+ messages in thread
From: CEE Forostyan, Konstantin @ 2020-05-04 16:12 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

Sorry for delay with the answer, I had a day off last Friday.

> so please send them as proper patches
I did this in a sepatare email, hopefully it is correct. This is my first time submitting a kernel patch.

> please ensure l2cap-tester is working.
Unfortunately I didn't find a way to even integrate l2cap-tester into our embedded platform, so I couldn't make any tests with it. Is it a separate tool or something that is integrated into test-runner tool? If yes, the test-runner requires qemu that we don't have.

Best regards,
Konstantin


Von: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Gesendet: Mittwoch, 29. April 2020 19:17
An: CEE Forostyan, Konstantin
Cc: linux-bluetooth@vger.kernel.org
Betreff: Re: [PATCH] Bluetooth: L2CAP: Fix errors during L2CAP_CREDIT_BASED_CONNECTION_REQ (0x17)
    
Hi Konstantin,

On Wed, Apr 29, 2020 at 9:52 AM CEE Forostyan, Konstantin
<Konstantin.Forostyan@peiker-cee.de> wrote:
>
> Hi All,
>
> During Bluetooth qualification tests I found out that Bluetooth stack responds with an error to a correct L2CAP_CREDIT_BASED_CONNECTION_REQ. Please review the 2 bugfixes I made in kernel in order to correct this problem.
>
> Best regards
> Konstantin
>
>
> --- a/net/bluetooth/l2cap_core.c        2020-04-28 18:19:10.481887583 +0200
> +++ b/net/bluetooth/l2cap_core.c        2020-04-28 18:21:41.000000000 +0200
> @@ -5817,7 +5817,7 @@
>         if (!enable_ecred)
>                 return -EINVAL;
>
> -       if (cmd_len < sizeof(*req) || cmd_len - sizeof(*req) % sizeof(u16)) {
> +       if (cmd_len < sizeof(*req) || (cmd_len - sizeof(*req)) % sizeof(u16)) {
>                 result = L2CAP_CR_LE_INVALID_PARAMS;
>                 goto response;
>         }
> @@ -5855,7 +5855,7 @@
>         }
>
>         result = L2CAP_CR_LE_SUCCESS;
> -       cmd_len -= sizeof(req);
> +       cmd_len -= sizeof(*req);
>         num_scid = cmd_len / sizeof(u16);
>
>         for (i = 0; i < num_scid; i++) {

Weird that I didn't run into this when creating the test for
l2cap-tester, they look correct though so please send them as proper
patches so we can apply to bluetooth-next, also please ensure
l2cap-tester is working.

-- 
Luiz Augusto von Dentz

    

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-04 16:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 10:45 How to to get L2CAP Enhanced Credit Based Mode working? CEE Forostyan, Konstantin
2020-04-21 12:42 ` Ryll, Jan (GED-SDD2)
2020-04-21 12:56   ` AW: " CEE Forostyan, Konstantin
2020-04-29 16:48     ` [PATCH] Bluetooth: L2CAP: Fix errors during L2CAP_CREDIT_BASED_CONNECTION_REQ (0x17) CEE Forostyan, Konstantin
2020-04-29 17:17       ` Luiz Augusto von Dentz
2020-05-04 16:12         ` AW: " CEE Forostyan, Konstantin

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).