20 byte header on SD8686 rx packets
Dan Williams
dcbw at redhat.com
Tue Aug 4 13:05:01 EDT 2009
On Tue, 2009-08-04 at 12:53 -0400, Dan Williams wrote:
> On Tue, 2009-08-04 at 10:35 +0000, Jonathan Cameron wrote:
> > > On Sat, Jul 11 at 11:51, Erwin Authried wrote:
> > >> Hi Bob,
> > >>
> > >> it looks like you have to use the "packed" attribute for the union as
> > >> well as each struct inside the union, otherwise the compiler for the ARM
> > >> will align the size to next 32-bit boundary.
> > >
> > > Yep, I've revisited the tests this morning and I can get everything to work
> > > with just the following patch. I was putting the attribute directives in
> > > the wrong place last week. You do need both directives as shown.
> > >
> > > This is with Gcc 3.4.5 but I guess the extra directives are harmless on
> > > later versions of the compiler.
> > Acked-by: Jonathan Cameron <jic23 at cam.ac.uk>
> >
> > I've only test with 3.4.1 but definitely solves the problem with that.
> > Guessing this needs to go upstream asap.
> >
> > >
> > > diff -u linux-2.6.31-rc2/drivers/net/wireless/libertas/hostcmd.h{-orig,}
> > > --- linux-2.6.31-rc2/drivers/net/wireless/libertas/hostcmd.h-orig 2009-07-04 18:58:48.000000000 +0100
> > > +++ linux-2.6.31-rc2/drivers/net/wireless/libertas/hostcmd.h 2009-07-13 08:27:45.000000000 +0100
> > > @@ -56,8 +56,8 @@
> > > u8 bss_type;
> > > /* BSS number */
> > > u8 bss_num;
> > > - } bss;
> > > - } u;
> > > + } __attribute__ ((packed)) bss;
> > > + } __attribute__ ((packed)) u;
> > >
> > > /* SNR */
> > > u8 snr;
>
> Wouldn't the txpd also need to be packed? I'm really curious why things
> are working if the rxpd is packed, but the txpd isn't, using the same
> compiler. Seems pretty odd.
To answer my own question, because the txpd union is 32 bits wide, the
ARM compiler would leave that alone. However, it really should be
packed as well if just to show intent.
Dan
More information about the libertas-dev
mailing list