20 byte header on SD8686 rx packets

Bob Dunlop rdunlop at guralp.com
Mon Jul 13 03:48:47 EDT 2009


Hi,

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.


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;

-- 
        Bob Dunlop
        Guralp Systems Limited
        http://www.guralp.com



More information about the libertas-dev mailing list