On Tuesday 24 November 2009, Gertjan van Wingerde wrote: > On 11/24/09 18:19, Ivo van Doorn wrote: > > On Monday 23 November 2009, Gertjan van Wingerde wrote: > >> Current rt2x00 drivers may result in a "ieee80211_tx_status: headroom too > >> small" error message when a frame needs to be properly aligned before > >> transmitting it. > >> This is because the space needed to ensure proper alignment isn't > >> requested from mac80211. > >> Fix this by adding sufficient amount of alignment space to the amount > >> of headroom requested for TX frames. > >> > >> Reported-by: David Ellingsworth <david@xxxxxxxxxxxxxxxxx> > >> Signed-off-by: Gertjan van Wingerde <gwingerde@xxxxxxxxx> > >> --- > >> drivers/net/wireless/rt2x00/rt2x00.h | 6 ++++++ > >> drivers/net/wireless/rt2x00/rt2x00dev.c | 12 +++++++++++- > >> 2 files changed, 17 insertions(+), 1 deletions(-) > >> > >> diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h > >> index 4d841c0..dcfc8c2 100644 > >> --- a/drivers/net/wireless/rt2x00/rt2x00.h > >> +++ b/drivers/net/wireless/rt2x00/rt2x00.h > >> @@ -113,6 +113,12 @@ > >> ( ((unsigned long)((__skb)->data + (__header))) & 3 ) > >> > >> /* > >> + * Constants for extra TX headroom for alignment purposes. > >> + */ > >> +#define RT2X00_ALIGN_SIZE 4 /* Only whole frame needs alignment */ > >> +#define RT2X00_L2PAD_SIZE 8 /* Both header & payload need alignment */ > > > > Now that I think of it, why do we need 8 byte for L2 padding? > > Shouldn't we need the same size for regular alignment, L2 padding only indicates > > the padding occurs between header and payload rather then before the header only. > > So unless I am mistaken about how I coded the header & payload moving in rt2x00lib, > > you always need at most 4 bytes. > > > > Nope. If I read the code right then the header can be moved by more than 4 bytes, namely > when the payload needs to be shifted more than the header. In that case the header is > shifted an extra 4 bytes to make room for the payload. However, 8 is the obvious maximum. Ah right, well 8bytes is ok then. :) Acked-by: Ivo van Doorn <IvDoorn@xxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html