From: Marcel Holtmann <marcel@holtmann.org>
To: Mat Martineau <mathewm@codeaurora.org>
Cc: Gustavo Padovan <gustavo@padovan.org>,
linux-bluetooth@vger.kernel.org,
Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Subject: Re: [PATCH] Bluetooth: Get a more accurate PDU len
Date: Sat, 26 May 2012 05:15:44 +0200 [thread overview]
Message-ID: <1338002144.15105.96.camel@aeonflux> (raw)
In-Reply-To: <alpine.DEB.2.02.1205251615000.2070@mathewm-linux>
Hi Gustavo,
> > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> >
> > Both FCS and Extended header might be or might not be present in a ERTM
> > channel.
> >
> > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > ---
> > net/bluetooth/l2cap_core.c | 8 +++++++-
> > 1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> > index c07c134..c614532 100644
> > --- a/net/bluetooth/l2cap_core.c
> > +++ b/net/bluetooth/l2cap_core.c
> > @@ -2143,7 +2143,13 @@ static int l2cap_segment_sdu(struct l2cap_chan *chan,
> > pdu_len = min_t(size_t, pdu_len, L2CAP_BREDR_MAX_PAYLOAD);
> >
> > /* Adjust for largest possible L2CAP overhead. */
> > - pdu_len -= L2CAP_EXT_HDR_SIZE + L2CAP_FCS_SIZE;
> > + if (chan->fcs)
> > + pdu_len -= L2CAP_FCS_SIZE;
> > +
> > + if (test_bit(FLAG_EXT_CTRL, &chan->flags))
> > + pdu_len -= L2CAP_EXT_HDR_SIZE;
> > + else
> > + pdu_len -= L2CAP_ENH_HDR_SIZE;
> >
> > /* Remote device may have requested smaller PDUs */
> > pdu_len = min_t(size_t, pdu_len, chan->remote_mps);
> > --
> > 1.7.10.1
>
> Looks good to me.
>
> Reviewed-by: Mat Martineau <mathewm@codeaurora.org>
patch has been applied to bluetooth-next tree.
Regards
Marcel
next prev parent reply other threads:[~2012-05-26 3:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-25 21:57 [PATCH] Bluetooth: Get a more accurate PDU len Gustavo Padovan
2012-05-25 23:15 ` Mat Martineau
2012-05-26 3:15 ` Marcel Holtmann [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-05-25 20:54 Gustavo Padovan
2012-05-25 21:22 ` Mat Martineau
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=1338002144.15105.96.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=gustavo.padovan@collabora.co.uk \
--cc=gustavo@padovan.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=mathewm@codeaurora.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