Search Linux Wireless

Re: [PATCH 09/20] staging: brcm80211: use endian annotated structures in brcmsmac

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2011-09-24 at 14:34 +0200, Arend van Spriel wrote:
> On 09/24/2011 12:38 PM, Johannes Berg wrote:
> > On Fri, 2011-09-23 at 19:08 -0700, Franky Lin wrote:
> >>   struct d11rxhdr {
> >>   	u16 RxFrameSize;
> >>   	u16 PAD;
> >> +	union {
> >> +		struct d11rxhdr_le rxh_le;
> >> +		struct d11rxhdr rxh_cpu;
> >> +	};
> > This seems a little strange. Why would it be both in LE and CPU byte
> > order?
> 
> Indeed. When we receive it from the device it is in LE and we convert it 
> to CPU order for further processing using rxh_cpu.

That seems a confusing and error-prone -- you'll have to remember
whether you're before or after conversion. Would it be possible to have
two versions of the outer structure and change the pointer type at that
point?

johannes

--
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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux