Search Linux Wireless

Re: [PATCH v2 8/8] rt2x00: Properly request tx headroom for alignment operations.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

---
Gertjan.
--
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

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux