aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2014-03-20 05:18:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-03-20 11:55:41 -0400
commit67b3bd4e65f0854aca70e0134d59b1daede49504 (patch)
tree8bf7be73c0c87ca95f89a180bffae09021afe642 /drivers/net
parent4d1a4f16c96d3f4cf6afd92ca3ffb4d2c24875e1 (diff)
brcmfmac: fallback to mimo_bw_cap for older firmwares
In order to support the driver behaviour introduced by: commit d0575a5a703978c43e25128421158c78534ba100 Author: Daniel Kim <dekim@broadcom.com> Date: Wed Mar 12 18:12:14 2014 -0700 brcmfmac: Enable 40MHz bandwidth in 2GHz band and OBSS scanning in devices that do not support bwcap firmware command a fallback is added. Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@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')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 428b4cb94da1..e0e649aab8db 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -4930,16 +4930,27 @@ static void init_vif_event(struct brcmf_cfg80211_vif_event *event)
4930 mutex_init(&event->vif_event_lock); 4930 mutex_init(&event->vif_event_lock);
4931} 4931}
4932 4932
4933static int brcmf_set_bwcap(struct brcmf_if *ifp, u32 band, u32 bw_cap) 4933static int brcmf_enable_bw40_2g(struct brcmf_if *ifp)
4934{ 4934{
4935 struct brcmf_fil_bwcap_le band_bwcap; 4935 struct brcmf_fil_bwcap_le band_bwcap;
4936 u32 val;
4936 int err; 4937 int err;
4937 4938
4938 band_bwcap.band = cpu_to_le32(band); 4939 /* verify support for bw_cap command */
4939 band_bwcap.bw_cap = cpu_to_le32(bw_cap); 4940 val = WLC_BAND_5G;
4940 err = brcmf_fil_iovar_data_set(ifp, "bw_cap", &band_bwcap, 4941 err = brcmf_fil_iovar_int_get(ifp, "bw_cap", &val);
4941 sizeof(band_bwcap));
4942 4942
4943 if (!err) {
4944 /* only set 2G bandwidth using bw_cap command */
4945 band_bwcap.band = cpu_to_le32(WLC_BAND_2G);
4946 band_bwcap.bw_cap = cpu_to_le32(WLC_BW_40MHZ_BIT);
4947 err = brcmf_fil_iovar_data_set(ifp, "bw_cap", &band_bwcap,
4948 sizeof(band_bwcap));
4949 } else {
4950 brcmf_dbg(INFO, "fallback to mimo_bw_cap\n");
4951 val = WLC_N_BW_40ALL;
4952 err = brcmf_fil_iovar_int_set(ifp, "mimo_bw_cap", val);
4953 }
4943 return err; 4954 return err;
4944} 4955}
4945 4956
@@ -5005,11 +5016,10 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
5005 */ 5016 */
5006 if (wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap.cap & 5017 if (wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap.cap &
5007 IEEE80211_HT_CAP_SUP_WIDTH_20_40) { 5018 IEEE80211_HT_CAP_SUP_WIDTH_20_40) {
5008 err = brcmf_set_bwcap(ifp, WLC_BAND_2G, WLC_BW_CAP_40MHZ); 5019 err = brcmf_enable_bw40_2g(ifp);
5009 if (!err) { 5020 if (!err)
5010 err = brcmf_fil_iovar_int_set(ifp, "obss_coex", 5021 err = brcmf_fil_iovar_int_set(ifp, "obss_coex",
5011 BRCMF_OBSS_COEX_AUTO); 5022 BRCMF_OBSS_COEX_AUTO);
5012 }
5013 } 5023 }
5014 5024
5015 err = brcmf_fil_iovar_int_set(ifp, "tdls_enable", 1); 5025 err = brcmf_fil_iovar_int_set(ifp, "tdls_enable", 1);