staging: brcm80211: sparse endianness warnings on fullmac bss info
authorRoland Vossen <rvossen@broadcom.com>
Fri, 16 Sep 2011 19:28:08 +0000 (12:28 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 16 Sep 2011 19:39:42 +0000 (21:39 +0200)
Structure that is received from dongle has been annotated.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmfmac/dhd.h
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c

index de3f914d7a4f30f1c184e5d501188daa4220df51..da53dd02c330c6e5110568f1bb11c68010018291 100644 (file)
@@ -366,36 +366,37 @@ struct brcmf_pkt_filter_enable {
  * next bss_info structure in a vector (in struct brcmf_scan_results)
  */
 struct brcmf_bss_info {
-       u32 version;            /* version field */
-       u32 length;             /* byte length of data in this record,
+       __le32 version;         /* version field */
+       __le32 length;          /* byte length of data in this record,
                                 * starting at version and including IEs
                                 */
        u8 BSSID[ETH_ALEN];
-       u16 beacon_period;      /* units are Kusec */
-       u16 capability; /* Capability information */
+       __le16 beacon_period;   /* units are Kusec */
+       __le16 capability;      /* Capability information */
        u8 SSID_len;
        u8 SSID[32];
        struct {
-               uint count;   /* # rates in this set */
+               __le32 count;   /* # rates in this set */
                u8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
        } rateset;              /* supported rates */
-       u16 chanspec;   /* chanspec for bss */
-       u16 atim_window;        /* units are Kusec */
+       __le16 chanspec;        /* chanspec for bss */
+       __le16 atim_window;     /* units are Kusec */
        u8 dtim_period; /* DTIM period */
-       s16 RSSI;               /* receive signal strength (in dBm) */
+       __le16 RSSI;            /* receive signal strength (in dBm) */
        s8 phy_noise;           /* noise (in dBm) */
 
        u8 n_cap;               /* BSS is 802.11N Capable */
-       u32 nbss_cap;   /* 802.11N BSS Capabilities (based on HT_CAP_*) */
+       /* 802.11N BSS Capabilities (based on HT_CAP_*): */
+       __le32 nbss_cap;
        u8 ctl_ch;              /* 802.11N BSS control channel number */
-       u32 reserved32[1];      /* Reserved for expansion of BSS properties */
+       __le32 reserved32[1];   /* Reserved for expansion of BSS properties */
        u8 flags;               /* flags */
        u8 reserved[3]; /* Reserved for expansion of BSS properties */
        u8 basic_mcs[MCSSET_LEN];       /* 802.11N BSS required MCS set */
 
-       u16 ie_offset;  /* offset at which IEs start, from beginning */
-       u32 ie_length;  /* byte length of Information Elements */
-       s16 SNR;                /* average SNR of during frame reception */
+       __le16 ie_offset;       /* offset at which IEs start, from beginning */
+       __le32 ie_length;       /* byte length of Information Elements */
+       __le16 SNR;             /* average SNR of during frame reception */
        /* Add new fields here */
        /* variable length Information Elements */
 };
index 4f3e8b8d589370cc30a82643a31a105cb053201d..9e07f7775589a2cc6f7ff9e95bb8b892de29361e 100644 (file)
@@ -1955,7 +1955,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv,
        notify_capability = le16_to_cpu(bi->capability);
        notify_interval = le16_to_cpu(bi->beacon_period);
        notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset);
-       notify_ielen = le16_to_cpu(bi->ie_length);
+       notify_ielen = le32_to_cpu(bi->ie_length);
        notify_signal = (s16)le16_to_cpu(bi->RSSI) * 100;
 
        WL_CONN("bssid: %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
@@ -2054,7 +2054,7 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,
        notify_capability = le16_to_cpu(bi->capability);
        notify_interval = le16_to_cpu(bi->beacon_period);
        notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset);
-       notify_ielen = le16_to_cpu(bi->ie_length);
+       notify_ielen = le32_to_cpu(bi->ie_length);
        notify_signal = (s16)le16_to_cpu(bi->RSSI) * 100;
 
        WL_CONN("channel: %d(%d)\n", channel, freq);
@@ -2111,9 +2111,9 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv)
        if (unlikely(err))
                goto update_bss_info_out;
 
-       ie = ((u8 *)bi) + bi->ie_offset;
-       ie_len = bi->ie_length;
-       beacon_interval = cpu_to_le16(bi->beacon_period);
+       ie = ((u8 *)bi) + le16_to_cpu(bi->ie_offset);
+       ie_len = le32_to_cpu(bi->ie_length);
+       beacon_interval = le16_to_cpu(bi->beacon_period);
 
        tim = brcmu_parse_tlvs(ie, ie_len, WLAN_EID_TIM);
        if (tim)