I'm writing some network card drivers and have ran into a problem with mbuf
alignment.  In summary, the problem is that the network card expects its
transmit buffers to be double word aligned, while I'm getting tx mbufs
that are single word aligned.

The details:
The card in question is the IBM EtherJet Cardbus adaptor, AKA Xircom
CardBus Ethernet X3201-3.  The PCI-Cardbus bridge driver (my own) and this
whole mess is running on RELENG_4, and the netcard driver is based on
if_dc. Basically, after the whole processes of going through
ether_output() and stuff, when dc_start is called, the mbufs I get there
are usually misaligned.  Currently, I get by this by doing some really
nasty hack which I'm sure is dead wrong, since I have very little knowledge
of how mbufs work and what supporting functions are defined.  So, the
object of the game now is how to get an mbuf that's double word aligned
(both offset and length) from some mbuf that might not be aligned properly,
using the most correct and least resource intensive method.

I do realize that since the ethernet header is 14 bytes long, it'll be hard
to ensure that the mbuf I get will be double-word aligned to begin with, so
I must either copy it or move it to somewhere else.  Here's where I am
stuck.  Should I copy it or move it, and what are the functions/macros that
will aid me in my task?

Please bear with me, I'm fairly new to kernel level programming.



Why do I get the feeling that someone at Xircom was smoking crack when they
designed this card?

-- 
    (o_ 1-2-1-2-1-2-1-2-1-2-1-2-1-2-1-2-1-2-1-2-1-2-1-2-1-2-1-2-1-2 _o)
 \\\_\            Jonathan Chen              [EMAIL PROTECTED]           /_///
 <____) WARNING:This email contains 100% nonbiodegradable electrons (____>
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to