Commit 14739fee authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: sparse endianness warnings on fullmac bss info

Structure that is received from dongle has been annotated.
Reported-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7dae3a63
...@@ -366,36 +366,37 @@ struct brcmf_pkt_filter_enable { ...@@ -366,36 +366,37 @@ struct brcmf_pkt_filter_enable {
* next bss_info structure in a vector (in struct brcmf_scan_results) * next bss_info structure in a vector (in struct brcmf_scan_results)
*/ */
struct brcmf_bss_info { struct brcmf_bss_info {
u32 version; /* version field */ __le32 version; /* version field */
u32 length; /* byte length of data in this record, __le32 length; /* byte length of data in this record,
* starting at version and including IEs * starting at version and including IEs
*/ */
u8 BSSID[ETH_ALEN]; u8 BSSID[ETH_ALEN];
u16 beacon_period; /* units are Kusec */ __le16 beacon_period; /* units are Kusec */
u16 capability; /* Capability information */ __le16 capability; /* Capability information */
u8 SSID_len; u8 SSID_len;
u8 SSID[32]; u8 SSID[32];
struct { 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 */ u8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
} rateset; /* supported rates */ } rateset; /* supported rates */
u16 chanspec; /* chanspec for bss */ __le16 chanspec; /* chanspec for bss */
u16 atim_window; /* units are Kusec */ __le16 atim_window; /* units are Kusec */
u8 dtim_period; /* DTIM period */ 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) */ s8 phy_noise; /* noise (in dBm) */
u8 n_cap; /* BSS is 802.11N Capable */ 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 */ 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 flags; /* flags */
u8 reserved[3]; /* Reserved for expansion of BSS properties */ u8 reserved[3]; /* Reserved for expansion of BSS properties */
u8 basic_mcs[MCSSET_LEN]; /* 802.11N BSS required MCS set */ u8 basic_mcs[MCSSET_LEN]; /* 802.11N BSS required MCS set */
u16 ie_offset; /* offset at which IEs start, from beginning */ __le16 ie_offset; /* offset at which IEs start, from beginning */
u32 ie_length; /* byte length of Information Elements */ __le32 ie_length; /* byte length of Information Elements */
s16 SNR; /* average SNR of during frame reception */ __le16 SNR; /* average SNR of during frame reception */
/* Add new fields here */ /* Add new fields here */
/* variable length Information Elements */ /* variable length Information Elements */
}; };
......
...@@ -1955,7 +1955,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv, ...@@ -1955,7 +1955,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv,
notify_capability = le16_to_cpu(bi->capability); notify_capability = le16_to_cpu(bi->capability);
notify_interval = le16_to_cpu(bi->beacon_period); notify_interval = le16_to_cpu(bi->beacon_period);
notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset); 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; 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", 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, ...@@ -2054,7 +2054,7 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,
notify_capability = le16_to_cpu(bi->capability); notify_capability = le16_to_cpu(bi->capability);
notify_interval = le16_to_cpu(bi->beacon_period); notify_interval = le16_to_cpu(bi->beacon_period);
notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset); 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; notify_signal = (s16)le16_to_cpu(bi->RSSI) * 100;
WL_CONN("channel: %d(%d)\n", channel, freq); WL_CONN("channel: %d(%d)\n", channel, freq);
...@@ -2111,9 +2111,9 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv) ...@@ -2111,9 +2111,9 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv)
if (unlikely(err)) if (unlikely(err))
goto update_bss_info_out; goto update_bss_info_out;
ie = ((u8 *)bi) + bi->ie_offset; ie = ((u8 *)bi) + le16_to_cpu(bi->ie_offset);
ie_len = bi->ie_length; ie_len = le32_to_cpu(bi->ie_length);
beacon_interval = cpu_to_le16(bi->beacon_period); beacon_interval = le16_to_cpu(bi->beacon_period);
tim = brcmu_parse_tlvs(ie, ie_len, WLAN_EID_TIM); tim = brcmu_parse_tlvs(ie, ie_len, WLAN_EID_TIM);
if (tim) if (tim)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment