1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Packet alignment</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The 802.11 subsystems – for kernel developers"><link rel="up" href="rx-tx.html" title="Chapter 4. Receive and transmit processing"><link rel="prev" href="bk02pt01ch04s02.html" title="Frame format"><link rel="next" href="bk02pt01ch04s04.html" title="Calling into mac80211 from interrupts"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Packet alignment</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk02pt01ch04s02.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Receive and transmit processing</th><td width="20%" align="right"> <a accesskey="n" href="bk02pt01ch04s04.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1113576620"></a>Packet alignment</h2></div></div></div><p> 2 </p><p> 3 Drivers always need to pass packets that are aligned to two-byte boundaries 4 to the stack. 5 </p><p> 6 Additionally, should, if possible, align the payload data in a way that 7 guarantees that the contained IP header is aligned to a four-byte 8 boundary. In the case of regular frames, this simply means aligning the 9 payload to a four-byte boundary (because either the IP header is directly 10 contained, or IV/RFC1042 headers that have a length divisible by four are 11 in front of it). If the payload data is not properly aligned and the 12 architecture doesn't support efficient unaligned operations, mac80211 13 will align the data. 14 </p><p> 15 With A-MSDU frames, however, the payload data address must yield two modulo 16 four because there are 14-byte 802.3 headers within the A-MSDU frames that 17 push the IP header further back to a multiple of four again. Thankfully, the 18 specs were sane enough this time around to require padding each A-MSDU 19 subframe to a length that is a multiple of four. 20 </p><p> 21 Padding like Atheros hardware adds which is between the 802.11 header and 22 the payload is not supported, the driver is required to move the 802.11 23 header to be directly in front of the payload in that case. 24</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk02pt01ch04s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="rx-tx.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk02pt01ch04s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Frame format </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Calling into mac80211 from interrupts</td></tr></table></div></body></html> 25