summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/brcm80211/brcmfmac
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2012-09-20 00:21:06 +0400
committerJohn W. Linville <linville@tuxdriver.com>2012-09-24 23:02:04 +0400
commit029591f3485c9bd198513df39605e14d2ab7477d (patch)
tree4ef474bb8f74efb27ece9f8d310ec3d2e5ea7fa5 /drivers/net/wireless/brcm80211/brcmfmac
parent9a17bad1c7cc794b8faa50386495b6b9c91673e4 (diff)
downloadlinux-029591f3485c9bd198513df39605e14d2ab7477d.tar.xz
brcmfmac: fix sparse warnings in e-scan related code
With the introduction of e-scan mechanism in brcmfmac (e756af5 brcmfmac: add e-scan support.) a couple of sparse warnings were introduced. This patch resolves those. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 3491086053cd..58949723cbb9 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -698,11 +698,11 @@ static void brcmf_escan_prep(struct brcmf_scan_params_le *params_le,
u32 n_channels;
s32 i;
s32 offset;
- __le16 chanspec;
+ u16 chanspec;
u16 channel;
struct ieee80211_channel *req_channel;
char *ptr;
- struct brcmf_ssid ssid;
+ struct brcmf_ssid_le ssid_le;
memcpy(params_le->bssid, ether_bcast, ETH_ALEN);
params_le->bss_type = DOT11_BSSTYPE_ANY;
@@ -745,13 +745,10 @@ static void brcmf_escan_prep(struct brcmf_scan_params_le *params_le,
chanspec |= WL_CHANSPEC_CTL_SB_UPPER;
}
- params_le->channel_list[i] =
- (channel & WL_CHANSPEC_CHAN_MASK) |
- chanspec;
+ chanspec |= (channel & WL_CHANSPEC_CHAN_MASK);
WL_SCAN("Chan : %d, Channel spec: %x\n",
- channel, params_le->channel_list[i]);
- params_le->channel_list[i] =
- cpu_to_le16(params_le->channel_list[i]);
+ channel, chanspec);
+ params_le->channel_list[i] = cpu_to_le16(chanspec);
}
} else {
WL_SCAN("Scanning all channels\n");
@@ -764,17 +761,18 @@ static void brcmf_escan_prep(struct brcmf_scan_params_le *params_le,
offset = roundup(offset, sizeof(u32));
ptr = (char *)params_le + offset;
for (i = 0; i < n_ssids; i++) {
- memset(&ssid, 0, sizeof(ssid));
- ssid.SSID_len = cpu_to_le32(request->ssids[i].ssid_len);
- memcpy(ssid.SSID, request->ssids[i].ssid,
- request->ssids[i].ssid_len);
- if (!ssid.SSID_len)
+ memset(&ssid_le, 0, sizeof(ssid_le));
+ ssid_le.SSID_len =
+ cpu_to_le32(request->ssids[i].ssid_len);
+ memcpy(ssid_le.SSID, request->ssids[i].ssid,
+ request->ssids[i].ssid_len);
+ if (!ssid_le.SSID_len)
WL_SCAN("%d: Broadcast scan\n", i);
else
WL_SCAN("%d: scan for %s size =%d\n", i,
- ssid.SSID, ssid.SSID_len);
- memcpy(ptr, &ssid, sizeof(ssid));
- ptr += sizeof(ssid);
+ ssid_le.SSID, ssid_le.SSID_len);
+ memcpy(ptr, &ssid_le, sizeof(ssid_le));
+ ptr += sizeof(ssid_le);
}
} else {
WL_SCAN("Broadcast scan %p\n", request->ssids);
@@ -2840,10 +2838,13 @@ brcmf_compare_update_same_bss(struct brcmf_bss_info_le *bss,
!memcmp(bss_info_le->SSID, bss->SSID, bss_info_le->SSID_len)) {
if ((bss->flags & WLC_BSS_RSSI_ON_CHANNEL) ==
(bss_info_le->flags & WLC_BSS_RSSI_ON_CHANNEL)) {
+ s16 bss_rssi = le16_to_cpu(bss->RSSI);
+ s16 bss_info_rssi = le16_to_cpu(bss_info_le->RSSI);
+
/* preserve max RSSI if the measurements are
* both on-channel or both off-channel
*/
- if (bss_info_le->RSSI > bss->RSSI)
+ if (bss_info_rssi > bss_rssi)
bss->RSSI = bss_info_le->RSSI;
} else if ((bss->flags & WLC_BSS_RSSI_ON_CHANNEL) &&
(bss_info_le->flags & WLC_BSS_RSSI_ON_CHANNEL) == 0) {