On Fri, Jan 25, 2008 at 11:07:47AM -0800, Linus Torvalds wrote: > > > On Fri, 25 Jan 2008, Michael Buesch wrote: > > > > The problem is _not_ the wireless header access, but the alignment of the embedded > > protocol stack, if the header does not have a size aligned to 4. > > Do we want to clutter the whole networking stack below wireless with > > get_unaligned() or attribute(packed) or something like that? > > That's what all the other protocols do, isn't it? > > For example, on PowerPC, NET_IP_ALIGN is 0 - explicitly so that the *dma* > from the card should be aligned, even if that in turn means that the IP > payload itself is then just two-byte aligned rather than word-aligned > (14-byte ethernet headers and all that). http://kerneltrap.org/mailarchive/linux-netdev/2007/11/24/442496 Quoth Herbert Xu: "OK. Let me clarify this a bit more. We require at least one of the following rules to be met: * the IPv4/IPv6 header is aligned by 8 bytes on reception; * or the platform provides unaligned exception handlers. So if your platform violates both rules then it won't work with the IP stack, simple as that. Fortunately I don't think such a platform exists currently on Linux." That puts mac80211 in an awkward position. It is not architecture code, so it can't make any assumptions about what is or isn't OK. So, we need to present aligned data to the network stack. We could put the alignment onus on mac80211, but this has proven to be very solvable at (near?) zero cost by all the other drivers. I suppose we could put code in mac80211 to check/correct the alignment anyway and hope that the cost of such checking is small enough not to matter as long as drivers are passing aligned data anyway. But that seems a bit silly, when at least so far only this one driver has balked at doing the right thing. I'm working on some iwlwifi patches to check/correct alignment. (Hmmm..."aligned by 8 bytes", so our warning and my iwlwifi patch may still not be right...) John -- John W. Linville linville@xxxxxxxxxxxxx - 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