linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Suraj Sumangala <suraj@atheros.com>
Cc: linux-bluetooth@vger.kernel.org, Jothikumar.Mothilal@Atheros.com
Subject: Re: [PATCH v5 1/3] Implements hci_reassembly to reassemble Rx packets
Date: Mon, 12 Jul 2010 11:45:12 -0300	[thread overview]
Message-ID: <1278945912.10421.194.camel@localhost.localdomain> (raw)
In-Reply-To: <1278936744-6003-1-git-send-email-suraj@atheros.com>

Hi Suraj,

> Implements feature to reassemble HCI frames received from an input stream.
> 
> Signed-off-by: Suraj Sumangala <suraj@atheros.com>
> ---
>  net/bluetooth/hci_core.c |  106 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 106 insertions(+), 0 deletions(-)
> 
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index aeb2982..e1ede0b 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -1033,6 +1033,112 @@ int hci_recv_frame(struct sk_buff *skb)
>  }
>  EXPORT_SYMBOL(hci_recv_frame);
>  
> +static int hci_reassembly(struct hci_dev *hdev, int type, void *data,
> +			  int count, struct sk_buff **skb_ptr, gfp_t how)
> +{

so while reviewing this patch, I seems to make more sense to just give
an index to the reassembly SKB instead of trying to hand it as an extra
output parameter.

So reassembly[0] can be used for streams and [1..3] for packet specific
types then. That needs a small patch first to extend the array to 4
entries, but that should be just fine.

This meaning we do index = 0 for stream reassembly and index = type - 1
for packet type based reassembly.

Especially since this method is fully internal to bluetooth.ko I would
actually prefer this.

And "gfp_t gfp_mask" please.

> +	int len = 0;
> +	int header_len = 0;

We generally called this hlen.

> +	int remain = count;
> +	struct sk_buff *skb = *skb_ptr;
> +	struct { struct bt_skb_cb cb_info; int expect; } *scb;

Why do we need this double scb. We could just extend our current
bt_skb_cb. Just put "u16 expect" after incoming.

Regards

Marcel



      parent reply	other threads:[~2010-07-12 14:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-12 12:12 [PATCH v5 1/3] Implements hci_reassembly to reassemble Rx packets Suraj Sumangala
2010-07-12 12:12 ` [PATCH v5 2/3] Modified hci_recv_fragment() to use hci_reassembly Suraj Sumangala
2010-07-12 12:12   ` [PATCH v5 3/3] Implemented HCI frame reassembly for stream Rx Suraj Sumangala
2010-07-12 14:45 ` Marcel Holtmann [this message]

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=1278945912.10421.194.camel@localhost.localdomain \
    --to=marcel@holtmann.org \
    --cc=Jothikumar.Mothilal@Atheros.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=suraj@atheros.com \
    /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).