RE: [PATCH] Bluetooth : Errata Service Release 8 Erratum 3253

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luiz,
Please find the new patch with review comments incorporated.

*I have added the Page number of Core Specification for reference in the commit message and included the "signed of by" in the patch.

*L2CAP_CR_INVALID_SCID and L2CAP_CR_SCID_IN_USE are specific to LE with different result values as:
 L2CAP_CR_INVALID_SCID  -  0x0009
 L2CAP_CR_SCID_IN_USE   -  0x000A
It is already implemented.

Thanks & Regards
Mallikarjun Phulari

_____________________________________
From: Luiz Augusto von Dentz [luiz.dentz@xxxxxxxxx]
Sent: Wednesday, September 19, 2018 5:06 AM
To: Phulari, Mallikarjun
Cc: linux-bluetooth@xxxxxxxxxxxxxxx
Subject: Re: [PATCH] Bluetooth : Errata Service Release 8 Erratum 3253

Hi Mallikarjun,

On Wed, Sep 19, 2018 at 12:51 PM, Mallikarjun Phulari
<mallikarjun.phulari@xxxxxxxxx> wrote:
> L2CAP: Changes include the new result codes for the l2cap channel
> create/connect request. The new result code are:
> 0x0006 - sent in the response when the CID is not in valid dynamic range.
> 0x0007 sent in the response when the CID is already allocated.

It would be a good idea to quote the erratum with page number where
the new errors come from. Btw, you should include a signed of by in
the kernel patches.

> ---
>  include/net/bluetooth/l2cap.h |  6 ++++++
>  net/bluetooth/l2cap_core.c    | 12 ++++++++++++
>  2 files changed, 18 insertions(+)
>
> diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
> index 0697fd4..eb0c8d0 100644
> --- a/include/net/bluetooth/l2cap.h
> +++ b/include/net/bluetooth/l2cap.h
> @@ -284,6 +284,12 @@ struct l2cap_conn_rsp {
>  #define L2CAP_CR_INVALID_SCID  0x0009
>  #define L2CAP_CR_SCID_IN_USE   0x000A
>
> +/* connect/create channel results
> + * As per Erratum 3253
> + */
> +#define L2CAP_CR_BREDR_INVALID_SCID    0x0006
> +#define L2CAP_CR_BREDR_SCID_IN_USE     0x0007

Weird, are L2CAP_CR_INVALID_SCID and L2CAP_CR_SCID_IN_USE specific to
LE? If they are we should probably fix their names.

>  /* connect/create channel status */
>  #define L2CAP_CS_NO_INFO       0x0000
>  #define L2CAP_CS_AUTHEN_PEND   0x0001
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index 9b7907e..85887df 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -3814,9 +3814,21 @@ static struct l2cap_chan *l2cap_connect(struct l2cap_conn *conn,
>         }
>
>         result = L2CAP_CR_NO_MEM;
> +       /* As per Erratum 3253, check the CID is in valid dynamic range and
> +        *  is not allocated already. Send the new result codes accordingly
> +        */
> +
> +       /* Check for valid dynamic CID range */
> +       if (scid < L2CAP_CID_DYN_START || scid > L2CAP_CID_DYN_END) {
> +               result = L2CAP_CR_BREDR_INVALID_SCID;
> +               chan = NULL;
> +               goto response;
> +       }
>
>         /* Check if we already have channel with that dcid */
>         if (__l2cap_get_chan_by_dcid(conn, scid))
> +               result = L2CAP_CR_BREDR_SCID_IN_USE;
> +               chan = NULL;
>                 goto response;

Missing { } above?

>
>         chan = pchan->ops->new_connection(pchan);
> --
> 2.7.4
>



--
Luiz Augusto von Dentz
From 3d5e7712f2d7a1d59af63c4b2aac547ad9826589 Mon Sep 17 00:00:00 2001
From: Mallikarjun Phulari <mallikarjun.phulari@xxxxxxxxx>
Date: Fri, 21 Sep 2018 09:18:35 +0530
Subject: [PATCH] Bluetooth : Errata Service Release 8, Erratum 3253
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

L2CAP: New result values
	0x0006 - Connection refused â?? Invalid Source CID
	0x0007 - Connection refused â?? Source CID already allocated

As per the ESR08_V1.0.0, 1.11.2 Erratum 3253, Page No. 54,
"Remote CID invalid Issue".
Applies to Core Specification versions: V5.0, V4.2, v4.1, v4.0, and v3.0 + HS
Vol 3, Part A, Section 4.2, 4.3, 4.14, 4.15.

Core Specification Version 5.0, Page No.1753, Table 4.6 and
Page No. 1767, Table 4.14

New result values are added to l2cap connect/create channel response as
0x0006 - Connection refused â?? Invalid Source CID
0x0007 - Connection refused â?? Source CID already allocated

Signed-off-by: Mallikarjun Phulari <mallikarjun.phulari@xxxxxxxxx>
---
 include/net/bluetooth/l2cap.h |  6 ++++++
 net/bluetooth/l2cap_core.c    | 17 ++++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 0697fd4..c7f97cc 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -284,6 +284,12 @@ struct l2cap_conn_rsp {
 #define L2CAP_CR_INVALID_SCID	0x0009
 #define L2CAP_CR_SCID_IN_USE	0x000A
 
+/* connect/create channel results
+ * New result codesAs per ESR08_V1.0.0, Erratum 3253
+ */
+#define L2CAP_CR_BREDR_INVALID_SCID	0x0006
+#define L2CAP_CR_BREDR_SCID_IN_USE	0x0007
+
 /* connect/create channel status */
 #define L2CAP_CS_NO_INFO	0x0000
 #define L2CAP_CS_AUTHEN_PEND	0x0001
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index d17a473..d605748 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -3815,9 +3815,24 @@ static struct l2cap_chan *l2cap_connect(struct l2cap_conn *conn,
 
 	result = L2CAP_CR_NO_MEM;
 
+	/* As per ESR08_V1.0.0, Erratum 3253, check the CID is in valid
+	 * dynamic range and is not allocated already.
+	 * Send the new result codes accordingly
+	 */
+
+	/* Check for valid dynamic CID range */
+	if (scid < L2CAP_CID_DYN_START || scid > L2CAP_CID_DYN_END) {
+		result = L2CAP_CR_BREDR_INVALID_SCID;
+		chan = NULL;
+		goto response;
+	}
+
 	/* Check if we already have channel with that dcid */
-	if (__l2cap_get_chan_by_dcid(conn, scid))
+	if (__l2cap_get_chan_by_dcid(conn, scid)) {
+		result = L2CAP_CR_BREDR_SCID_IN_USE;
+		chan = NULL;
 		goto response;
+	}
 
 	chan = pchan->ops->new_connection(pchan);
 	if (!chan)
-- 
2.7.4


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux