[PATCH] [V3] Add non-Virtex5 support for LL TEMAC driver
Steven J. Magnani
steve at digidescorp.com
Wed Apr 7 01:08:02 EST 2010
On Mon, 2010-04-05 at 15:33 -0600, John Linn wrote:
> > > +/* Align the IP data in the packet on word boundaries as MicroBlaze
> > > + * needs it.
> > > + */
> > > +
> > > #define XTE_ALIGN 32
> > > -#define BUFFER_ALIGN(adr) ((XTE_ALIGN - ((u32) adr)) % XTE_ALIGN)
> > > +#define BUFFER_ALIGN(adr) ((34 - ((u32) adr)) % XTE_ALIGN)
> > >
> >
> > Very interesting way of doing this, but why such convoluted thing ?
>
> Grant might have insight into why this started this way, I just updated to help with MicroBlaze alignment.
>
> >
> > Because of the % 32, this is equivalent to :
> >
> > #define BUFFER_ALIGN(adr) ((2 - ((u32) adr)) % XTE_ALIGN)
> >
> > But wait, dont we recognise the magic constant NET_IP_ALIGN ?
> >
> > So, I ask, cant you use netdev_alloc_skb_ip_align() in this driver ?
> >
That should work. I switched to that in the older xilinx_lltemac driver
without any problem.
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>
More information about the Linuxppc-dev
mailing list