From: Michael Buesch <mb@xxxxxxxxx> Date: Fri, 7 Dec 2007 14:36:08 +0100 > The wire protocol for the iv files is the following structure: > > struct b43_iv { > be16 a; > union { > be16 x; > be32 y; > } ((attr_packed)); > } ((attr_packed)); > > How do I handle that in userspace? In kernel space it's simple > (and we already use get_unaligned() for the 32bit value there). If you marked it packed, on platforms like sparc, MIPS, and IA-64, the compiler is only going to use byte loads and stores to objects of this type. You don't need to use get_unaligned() on members of structures that are marked packed. If you look at the asm-generic/unaligned.h pure-C implementation, it uses the packed attribute, which really shows how redundant it is to use get_unaligned() on packed structure member access :-) - To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html