From: Benoit PAPILLAULT <benoit.papillault@free.fr>
To: rt2x00 Users List <users@rt2x00.serialmonkey.com>
Cc: Ivo van Doorn <ivdoorn@gmail.com>, linux-wireless@vger.kernel.org
Subject: Re: [rt2x00-users] [PATCH] rt2x00: Further L2 padding fixes.
Date: Sun, 29 Nov 2009 00:55:12 +0100 [thread overview]
Message-ID: <4B11B860.4080607@free.fr> (raw)
In-Reply-To: <4B1199A7.7090903@gmail.com>
Gertjan van Wingerde a écrit :
> On 11/28/09 22:26, Ivo van Doorn wrote:
>>> diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
>>> index b8f0954..562a344 100644
>>> --- a/drivers/net/wireless/rt2x00/rt2x00queue.c
>>> +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
>>> @@ -181,7 +181,7 @@ void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length)
>>> unsigned int frame_length = skb->len;
>>> unsigned int header_align = ALIGN_SIZE(skb, 0);
>>> unsigned int payload_align = ALIGN_SIZE(skb, header_length);
>>> - unsigned int l2pad = 4 - (payload_align - header_align);
>>> + unsigned int l2pad = 4 - (header_length & 3);
Humm... is header_length = 24, then your formula gives l2pad = 4. If so,
this is wrong. Do I miss something?
BTW, I'm trying to prepare some patches for rt2800usb and padding. I
must admit the current framework is a bit complex compared to other
drivers (ath9k for instance).
To give something similar to ath9k where the pad position is computed
based on the hdr->frame_control field only (my guess is that's what the
HW does anyway), we have :
int rt2800usb_padpos(__le16 frame_control)
{
int padpos = 24;
if (ieee80211_is_data(frame_control)) {
padpos = ieee80211_hdrlen(frame_control);
}
return padpos;
}
then later : int padsize = padpos & 3;
then the usual check before doing the real padding or unpadding :
if (padsize && skb->len>padpos) {
do padding or unpadding
}
My 2 cents,
Benoit
next prev parent reply other threads:[~2009-11-29 0:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-28 18:32 [PATCH] rt2x00: Further L2 padding fixes Gertjan van Wingerde
2009-11-28 21:26 ` Ivo van Doorn
2009-11-28 21:44 ` Gertjan van Wingerde
2009-11-28 23:55 ` Benoit PAPILLAULT [this message]
2009-11-29 11:44 ` [rt2x00-users] " Gertjan van Wingerde
2009-11-29 13:02 ` Andreas Schwab
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=4B11B860.4080607@free.fr \
--to=benoit.papillault@free.fr \
--cc=ivdoorn@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=users@rt2x00.serialmonkey.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).