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

staging: brcm80211: fixed sparse endianness warnings on fullmac ratespec

Structure that is sent to the 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 7d852d16
...@@ -400,6 +400,13 @@ struct brcmf_bss_info { ...@@ -400,6 +400,13 @@ struct brcmf_bss_info {
/* variable length Information Elements */ /* variable length Information Elements */
}; };
struct brcm_rateset_le {
/* # rates in this set */
__le32 count;
/* rates in 500kbps units w/hi bit set if basic */
u8 rates[WL_NUMRATES];
};
struct brcmf_ssid { struct brcmf_ssid {
u32 SSID_len; u32 SSID_len;
unsigned char SSID[32]; unsigned char SSID[32];
......
...@@ -1864,7 +1864,7 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev, ...@@ -1864,7 +1864,7 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
const u8 *addr, const u8 *addr,
const struct cfg80211_bitrate_mask *mask) const struct cfg80211_bitrate_mask *mask)
{ {
struct brcm_rateset rateset; struct brcm_rateset_le rateset_le;
s32 rate; s32 rate;
s32 val; s32 val;
s32 err_bg; s32 err_bg;
...@@ -1878,15 +1878,13 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev, ...@@ -1878,15 +1878,13 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
/* addr param is always NULL. ignore it */ /* addr param is always NULL. ignore it */
/* Get current rateset */ /* Get current rateset */
err = brcmf_dev_ioctl(dev, BRCM_GET_CURR_RATESET, &rateset, err = brcmf_dev_ioctl(dev, BRCM_GET_CURR_RATESET, &rateset_le,
sizeof(rateset)); sizeof(rateset_le));
if (unlikely(err)) { if (unlikely(err)) {
WL_ERR("could not get current rateset (%d)\n", err); WL_ERR("could not get current rateset (%d)\n", err);
goto done; goto done;
} }
rateset.count = le32_to_cpu(rateset.count);
legacy = ffs(mask->control[IEEE80211_BAND_2GHZ].legacy & 0xFFFF); legacy = ffs(mask->control[IEEE80211_BAND_2GHZ].legacy & 0xFFFF);
if (!legacy) if (!legacy)
legacy = ffs(mask->control[IEEE80211_BAND_5GHZ].legacy & legacy = ffs(mask->control[IEEE80211_BAND_5GHZ].legacy &
...@@ -1894,9 +1892,9 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev, ...@@ -1894,9 +1892,9 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
val = wl_g_rates[legacy - 1].bitrate * 100000; val = wl_g_rates[legacy - 1].bitrate * 100000;
if (val < rateset.count) if (val < le32_to_cpu(rateset_le.count))
/* Select rate by rateset index */ /* Select rate by rateset index */
rate = rateset.rates[val] & 0x7f; rate = rateset_le.rates[val] & 0x7f;
else else
/* Specified rate in bps */ /* Specified rate in bps */
rate = val / 500000; rate = val / 500000;
......
...@@ -101,6 +101,13 @@ ...@@ -101,6 +101,13 @@
#define MAX_STREAMS_SUPPORTED 4 /* max number of streams supported */ #define MAX_STREAMS_SUPPORTED 4 /* max number of streams supported */
struct brcm_rateset {
/* # rates in this set */
u32 count;
/* rates in 500kbps units w/hi bit set if basic */
u8 rates[WL_NUMRATES];
};
struct brcms_c_rateset { struct brcms_c_rateset {
uint count; /* number of rates in rates[] */ uint count; /* number of rates in rates[] */
/* rates in 500kbps units w/hi bit set if basic */ /* rates in 500kbps units w/hi bit set if basic */
......
...@@ -48,13 +48,6 @@ ...@@ -48,13 +48,6 @@
#define WL_NUMRATES 16 /* max # of rates in a rateset */ #define WL_NUMRATES 16 /* max # of rates in a rateset */
struct brcm_rateset {
/* # rates in this set */
u32 count;
/* rates in 500kbps units w/hi bit set if basic */
u8 rates[WL_NUMRATES];
};
#define BRCM_CNTRY_BUF_SZ 4 /* Country string is 3 bytes + NUL */ #define BRCM_CNTRY_BUF_SZ 4 /* Country string is 3 bytes + NUL */
#define BRCM_SET_CHANNEL 30 #define BRCM_SET_CHANNEL 30
......
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