diff mbox

[4/7] rt2x00: Set SKBDESC_L2_PADDED in RX path

Message ID 200908171854.50790.IvDoorn@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Ivo van Doorn Aug. 17, 2009, 4:54 p.m. UTC
When the RX descriptor indicates the frame was L2 padded,
the SKBDESC_L2_PADDED flag should be set to make sure the
L2 padding is removed before it is send to mac80211.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2800usb.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Benoit PAPILLAULT Aug. 17, 2009, 8:46 p.m. UTC | #1
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ivo van Doorn a écrit :
> When the RX descriptor indicates the frame was L2 padded,
> the SKBDESC_L2_PADDED flag should be set to make sure the
> L2 padding is removed before it is send to mac80211.
>
> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
>  drivers/net/wireless/rt2x00/rt2800usb.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c
b/drivers/net/wireless/rt2x00/rt2800usb.c
> index c82474e..6de2eda 100644
> --- a/drivers/net/wireless/rt2x00/rt2800usb.c
> +++ b/drivers/net/wireless/rt2x00/rt2800usb.c
> @@ -2163,8 +2163,10 @@ static void rt2800usb_fill_rxdone(struct
queue_entry *entry,
>      if (rt2x00_get_field32(rxd0, RXD_W0_MY_BSS))
>          rxdesc->dev_flags |= RXDONE_MY_BSS;
> 
> -    if (rt2x00_get_field32(rxd0, RXD_W0_L2PAD))
> +    if (rt2x00_get_field32(rxd0, RXD_W0_L2PAD)) {
>          rxdesc->dev_flags |= RXDONE_L2PAD;
> +        skbdesc->flags |= SKBDESC_L2_PADDED;
> +    }
> 
>      if (rt2x00_get_field32(rxwi1, RXWI_W1_SHORT_GI))
>          rxdesc->flags |= RX_FLAG_SHORT_GI;
I have tested this patch as well and it looks correct. However, during
my test, the hardware does not set L2PAD flag, even if padding is
present (for some frames). I did the same test with the rt2870sta
driver from Ralink and the L2PAD was indeed set.

Ivo : what happens during your tests?

Regards,
Benoit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqJwZkACgkQOR6EySwP7oLcEACcDDUaE5oeOhF8CsC1hdg6cKQ6
7K4An2DKy76bVP2CpfhOJePGNrSWDI2v
=3ymH
-----END PGP SIGNATURE-----

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ivo van Doorn Aug. 17, 2009, 11:33 p.m. UTC | #2
On Monday 17 August 2009, Benoit PAPILLAULT wrote:
> Ivo van Doorn a écrit :
> > When the RX descriptor indicates the frame was L2 padded,
> > the SKBDESC_L2_PADDED flag should be set to make sure the
> > L2 padding is removed before it is send to mac80211.
> >
> > Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
> > ---
> >  drivers/net/wireless/rt2x00/rt2800usb.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c
> b/drivers/net/wireless/rt2x00/rt2800usb.c
> > index c82474e..6de2eda 100644
> > --- a/drivers/net/wireless/rt2x00/rt2800usb.c
> > +++ b/drivers/net/wireless/rt2x00/rt2800usb.c
> > @@ -2163,8 +2163,10 @@ static void rt2800usb_fill_rxdone(struct
> queue_entry *entry,
> >      if (rt2x00_get_field32(rxd0, RXD_W0_MY_BSS))
> >          rxdesc->dev_flags |= RXDONE_MY_BSS;
> >
> > -    if (rt2x00_get_field32(rxd0, RXD_W0_L2PAD))
> > +    if (rt2x00_get_field32(rxd0, RXD_W0_L2PAD)) {
> >          rxdesc->dev_flags |= RXDONE_L2PAD;
> > +        skbdesc->flags |= SKBDESC_L2_PADDED;
> > +    }
> >
> >      if (rt2x00_get_field32(rxwi1, RXWI_W1_SHORT_GI))
> >          rxdesc->flags |= RX_FLAG_SHORT_GI;
> I have tested this patch as well and it looks correct. However, during
> my test, the hardware does not set L2PAD flag, even if padding is
> present (for some frames). I did the same test with the rt2870sta
> driver from Ralink and the L2PAD was indeed set.

But when the flag is set, it is being set correctly?
Perhaps we can just set the flag at all times, because rt2x00lib
checks how much padding is required anyway. Unless of course
the device doesn't always add L2 padding when it actually should have.

> Ivo : what happens during your tests?

Tests?

I don't really have time to perform any testing, so all patches are
only checked by me for 'code correctness'.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index c82474e..6de2eda 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -2163,8 +2163,10 @@  static void rt2800usb_fill_rxdone(struct queue_entry *entry,
 	if (rt2x00_get_field32(rxd0, RXD_W0_MY_BSS))
 		rxdesc->dev_flags |= RXDONE_MY_BSS;
 
-	if (rt2x00_get_field32(rxd0, RXD_W0_L2PAD))
+	if (rt2x00_get_field32(rxd0, RXD_W0_L2PAD)) {
 		rxdesc->dev_flags |= RXDONE_L2PAD;
+		skbdesc->flags |= SKBDESC_L2_PADDED;
+	}
 
 	if (rt2x00_get_field32(rxwi1, RXWI_W1_SHORT_GI))
 		rxdesc->flags |= RX_FLAG_SHORT_GI;