Search Linux Wireless

Re: [RFC/RFT] p54: Fix for big-endian architecture

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

 



Christian Lamparter wrote:
> On Thursday 09 October 2008 17:19:23 Larry Finger wrote:
>> Index: wireless-testing/drivers/net/wireless/p54/p54common.h
>> ===================================================================
>> --- wireless-testing.orig/drivers/net/wireless/p54/p54common.h
>> +++ wireless-testing/drivers/net/wireless/p54/p54common.h
>> @@ -18,7 +18,10 @@
>>  struct bootrec {
>>  	__le32 code;
>>  	__le32 len;
>> -	u32 data[10];
>> +	union {
>> +		u32 data[10];
>> +		u8 data_char[40];
>> +	} __attribute__((packed));
>>  	__le16 rx_mtu;
>>  } __attribute__((packed));
>>
> ? how did rx_mtu end up there? it should be a part of bootrec_desc
> (which is a few lines down in p54common.h)
> struct bootrec_desc {
>         __le16 modes;
>         __le16 flags;
>         __le32 rx_start;
>         __le32 rx_end;
>         u8 headroom;
>         u8 tailroom;
>         u8 unimportant[6];
>         u8 rates[16];
> +	__le16 rx_mtu;
> } __attribute__((packed));
> 
> This structure is equivalent to struct s_lm_descr from "lmac_longbow.h", which
> can be found on wireless.kernel.org's resource page.

As the original code got the data from bootrec, I kept it the same. On
reflection, the statement above could be

priv->rx_mtu = le16_to_cpu(desc->rx_mtu);

I think which structure it is in is purely a matter of taste, but I will make
that change, test it, and submit a new patch. The big-endian fix above will also
need to be changed. I considered converting to a single struct using unions, but
that would get pretty messy.

Larry



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