aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2012-09-19 16:21:06 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-09-24 15:02:04 -0400
commit029591f3485c9bd198513df39605e14d2ab7477d (patch)
tree4ef474bb8f74efb27ece9f8d310ec3d2e5ea7fa5 /drivers
parent9a17bad1c7cc794b8faa50386495b6b9c91673e4 (diff)
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')
-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,
698 u32 n_channels; 698 u32 n_channels;
699 s32 i; 699 s32 i;
700 s32 offset; 700 s32 offset;
701 __le16 chanspec; 701 u16 chanspec;
702 u16 channel; 702 u16 channel;
703 struct ieee80211_channel *req_channel; 703 struct ieee80211_channel *req_channel;
704 char *ptr; 704 char *ptr;
705 struct brcmf_ssid ssid; 705 struct brcmf_ssid_le ssid_le;
706 706
707 memcpy(params_le->bssid, ether_bcast, ETH_ALEN); 707 memcpy(params_le->bssid, ether_bcast, ETH_ALEN);
708 params_le->bss_type = DOT11_BSSTYPE_ANY; 708 params_le->bss_type = DOT11_BSSTYPE_ANY;
@@ -745,13 +745,10 @@ static void brcmf_escan_prep(struct brcmf_scan_params_le *params_le,
745 chanspec |= WL_CHANSPEC_CTL_SB_UPPER; 745 chanspec |= WL_CHANSPEC_CTL_SB_UPPER;
746 } 746 }
747 747
748 params_le->channel_list[i] = 748 chanspec |= (channel & WL_CHANSPEC_CHAN_MASK);
749 (channel & WL_CHANSPEC_CHAN_MASK) |
750 chanspec;
751 WL_SCAN("Chan : %d, Channel spec: %x\n", 749 WL_SCAN("Chan : %d, Channel spec: %x\n",
752 channel, params_le->channel_list[i]); 750 channel, chanspec);
753 params_le->channel_list[i] = 751 params_le->channel_list[i] = cpu_to_le16(chanspec);
754 cpu_to_le16(params_le->channel_list[i]);
755 } 752 }
756 } else { 753 } else {
757 WL_SCAN("Scanning all channels\n"); 754 WL_SCAN("Scanning all channels\n");
@@ -764,17 +761,18 @@ static void brcmf_escan_prep(struct brcmf_scan_params_le *params_le,
764 offset = roundup(offset, sizeof(u32)); 761 offset = roundup(offset, sizeof(u32));
765 ptr = (char *)params_le + offset; 762 ptr = (char *)params_le + offset;
766 for (i = 0; i < n_ssids; i++) { 763 for (i = 0; i < n_ssids; i++) {
767 memset(&ssid, 0, sizeof(ssid)); 764 memset(&ssid_le, 0, sizeof(ssid_le));
768 ssid.SSID_len = cpu_to_le32(request->ssids[i].ssid_len); 765 ssid_le.SSID_len =
769 memcpy(ssid.SSID, request->ssids[i].ssid, 766 cpu_to_le32(request->ssids[i].ssid_len);
770 request->ssids[i].ssid_len); 767 memcpy(ssid_le.SSID, request->ssids[i].ssid,
771 if (!ssid.SSID_len) 768 request->ssids[i].ssid_len);
769 if (!ssid_le.SSID_len)
772 WL_SCAN("%d: Broadcast scan\n", i); 770 WL_SCAN("%d: Broadcast scan\n", i);
773 else 771 else
774 WL_SCAN("%d: scan for %s size =%d\n", i, 772 WL_SCAN("%d: scan for %s size =%d\n", i,
775 ssid.SSID, ssid.SSID_len); 773 ssid_le.SSID, ssid_le.SSID_len);
776 memcpy(ptr, &ssid, sizeof(ssid)); 774 memcpy(ptr, &ssid_le, sizeof(ssid_le));
777 ptr += sizeof(ssid); 775 ptr += sizeof(ssid_le);
778 } 776 }
779 } else { 777 } else {
780 WL_SCAN("Broadcast scan %p\n", request->ssids); 778 WL_SCAN("Broadcast scan %p\n", request->ssids);
@@ -2840,10 +2838,13 @@ brcmf_compare_update_same_bss(struct brcmf_bss_info_le *bss,
2840 !memcmp(bss_info_le->SSID, bss->SSID, bss_info_le->SSID_len)) { 2838 !memcmp(bss_info_le->SSID, bss->SSID, bss_info_le->SSID_len)) {
2841 if ((bss->flags & WLC_BSS_RSSI_ON_CHANNEL) == 2839 if ((bss->flags & WLC_BSS_RSSI_ON_CHANNEL) ==
2842 (bss_info_le->flags & WLC_BSS_RSSI_ON_CHANNEL)) { 2840 (bss_info_le->flags & WLC_BSS_RSSI_ON_CHANNEL)) {
2841 s16 bss_rssi = le16_to_cpu(bss->RSSI);
2842 s16 bss_info_rssi = le16_to_cpu(bss_info_le->RSSI);
2843
2843 /* preserve max RSSI if the measurements are 2844 /* preserve max RSSI if the measurements are
2844 * both on-channel or both off-channel 2845 * both on-channel or both off-channel
2845 */ 2846 */
2846 if (bss_info_le->RSSI > bss->RSSI) 2847 if (bss_info_rssi > bss_rssi)
2847 bss->RSSI = bss_info_le->RSSI; 2848 bss->RSSI = bss_info_le->RSSI;
2848 } else if ((bss->flags & WLC_BSS_RSSI_ON_CHANNEL) && 2849 } else if ((bss->flags & WLC_BSS_RSSI_ON_CHANNEL) &&
2849 (bss_info_le->flags & WLC_BSS_RSSI_ON_CHANNEL) == 0) { 2850 (bss_info_le->flags & WLC_BSS_RSSI_ON_CHANNEL) == 0) {