Search Linux Wireless

Re: [PATCH 06/12] wl1251: fix payload alignment

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

 



On Fri, 2009-11-27 at 13:08 +0200, Kalle Valo wrote:
> Johannes Berg <johannes@xxxxxxxxxxxxxxxx> writes:
> 
> > On Thu, 2009-11-26 at 17:13 +0200, Kalle Valo wrote:
> >> Kalle Valo <kalle.valo@xxxxxx> writes:
> >> 
> >> > mac80211 complained that in some cases IP payload was not aligned, this
> >> > happens if the 802.11 header is not aligned with four. In that case we have
> >> > to move entire packet to make the payload properly aligned.
> >
> > Eh, turn off the debugging option ...
> 
> Sure. But isn't this warning going to create false alarms for others?

That's why it says "Say N unless you're writing a mac80211 based
driver." Maybe it should say "Say N unless you want to debug potential
alignment issues with your driver." Or maybe it should just go away now
that we align things properly in mac80211, and most firmware either
handles it or not, and there's nothing we can do about the firmware most
of the time... And mesh makes it more complex anyway than the warning
checks.

> > The point of the warning is to make developers aware that alignment by
> > firmware will be better. If you can't put the packet into the right
> > place directly from the device, don't bother, the memmove is done by
> > mac80211.
> 
> Ok, I have totally misunderstood the warning then. What's the proper
> way to fix this? I'll try to improve the comments in mac80211 to make
> this more clear.
> 
> At least in wl1251 we have to transfer the frame to an address aligned
> with four, otherwise DMA won't work. So the only solution I can think
> of is that firmware adds two bytes of padding before the frame in case
> of unaligned payload. Is there any other way?

No, there's no other way :) In fact, the padding has to be dynamic --
depending on whether you have QoS and/or 4addr format -- you need
padding if (!(qos ^ 4addr)) IIRC.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[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