linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ville Tervo <ville.tervo@nokia.com>
To: ext Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [RFC 12/20] Bluetooth: fix receiving L2CAP packets over LE
Date: Wed, 24 Nov 2010 07:32:02 +0200	[thread overview]
Message-ID: <20101124053202.GH874@null> (raw)
In-Reply-To: <1290524796-32246-13-git-send-email-vinicius.gomes@openbossa.org>

Hi,


On Tue, Nov 23, 2010 at 12:06:28PM -0300, ext Vinicius Costa Gomes wrote:
> As L2CAP packets coming over LE don't have any more encapsulation,
> other than L2CAP, we are able to process them as soon as they arrive.
> 

I thought this patch was only fixing symphoms of broken controller? LE frames
should have same continuation bits as ACL. See Vol 2 Part E 5.4.2.

> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
> ---
>  net/bluetooth/l2cap.c |   17 +++++++++++++++--
>  1 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
> index e481d6b..0d168aa 100644
> --- a/net/bluetooth/l2cap.c
> +++ b/net/bluetooth/l2cap.c
> @@ -4798,17 +4798,30 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
>  static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)
>  {
>  	struct l2cap_conn *conn = hcon->l2cap_data;
> +	struct l2cap_hdr *hdr;
> +	int len;
>  
>  	if (!conn && !(conn = l2cap_conn_add(hcon, 0)))
>  		goto drop;
>  
>  	BT_DBG("conn %p len %d flags 0x%x", conn, skb->len, flags);
>  
> +	if (hcon->type == LE_LINK) {
> +		hdr = (struct l2cap_hdr *) skb->data;
> +		len = __le16_to_cpu(hdr->len) + L2CAP_HDR_SIZE;
> +
> +		if (len == skb->len) {
> +			/* Complete frame received */
> +			l2cap_recv_frame(conn, skb);
> +			return 0;
> +		}
> +
> +		goto drop;
> +	}
> +
>  	if (flags & ACL_START) {
> -		struct l2cap_hdr *hdr;
>  		struct sock *sk;
>  		u16 cid;
> -		int len;
>  
>  		if (conn->rx_len) {
>  			BT_ERR("Unexpected start frame (len %d)", skb->len);
> -- 
> 1.7.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-11-24  5:32 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 15:06 [RFC 00/20] Simple SMP Just Works implementation Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 01/20] Bluetooth: Add low energy commands and events Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 02/20] Bluetooth: Add LE connect support Vinicius Costa Gomes
2010-11-23 17:57   ` Gustavo F. Padovan
2010-11-24  5:03     ` Ville Tervo
2010-11-23 15:06 ` [RFC 03/20] Bluetooth: Use LE buffers for LE traffic Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 04/20] Bluetooth: Add LE connection support to L2CAP Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 05/20] Bluetooth: Add server socket support for LE connection Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 06/20] Bluetooth: Do not send disconn comand over LE links Vinicius Costa Gomes
2010-11-23 22:48   ` Gustavo F. Padovan
2010-11-24  5:05     ` Ville Tervo
2010-11-23 15:06 ` [RFC 07/20] Bluetooth: Fix initiated LE connections Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 08/20] Bluetooth: Treat LE and ACL links separately on timeout Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 09/20] Bluetooth: Fix locking balance in l2cap_le_conn_ready Vinicius Costa Gomes
2010-11-23 22:52   ` Gustavo F. Padovan
2010-11-23 15:06 ` [RFC 10/20] Bluetooth: Add server socket support for LE connection Vinicius Costa Gomes
2010-11-23 22:54   ` Gustavo F. Padovan
2010-11-23 23:04     ` Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 11/20] Bluetooth: Add SMP command structures Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 12/20] Bluetooth: fix receiving L2CAP packets over LE Vinicius Costa Gomes
2010-11-23 22:55   ` Gustavo F. Padovan
2010-11-23 23:06     ` Vinicius Costa Gomes
2010-11-24  5:32   ` Ville Tervo [this message]
2010-11-24 14:47     ` Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 13/20] Bluetooth: Implement the first SMP commands Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 14/20] Bluetooth: Start SMP procedure Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 15/20] Bluetooth: simple SMP pairing negotiation Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 16/20] Bluetooth: LE SMP Cryptoolbox functions Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 17/20] Bluetooth: Add support for using the crypto subsystem Vinicius Costa Gomes
2010-11-23 23:02   ` Gustavo F. Padovan
2010-11-23 15:06 ` [RFC 18/20] Bluetooth: Add support for SMP confirmation checks Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 19/20] Bluetooth: Add support for LE Start Encryption Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 20/20] Bluetooth: Add support for resuming socket when SMP is finished Vinicius Costa Gomes
2010-11-24  5:42 ` [RFC 00/20] Simple SMP Just Works implementation Ville Tervo
2010-11-24 21:08   ` Gustavo F. Padovan

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=20101124053202.GH874@null \
    --to=ville.tervo@nokia.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=vinicius.gomes@openbossa.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;
as well as URLs for NNTP newsgroup(s).