Skip to content

Commit 67b3bd4

Browse files
Arend van Spriellinvjw
authored andcommitted
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>
1 parent 4d1a4f1 commit 67b3bd4

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

‎drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4930,16 +4930,27 @@ static void init_vif_event(struct brcmf_cfg80211_vif_event *event)
49304930
mutex_init(&event->vif_event_lock);
49314931
}
49324932

4933-
static int brcmf_set_bwcap(struct brcmf_if *ifp, u32 band, u32 bw_cap)
4933+
static int brcmf_enable_bw40_2g(struct brcmf_if *ifp)
49344934
{
49354935
struct brcmf_fil_bwcap_le band_bwcap;
4936+
u32 val;
49364937
int err;
49374938

4938-
band_bwcap.band = cpu_to_le32(band);
4939-
band_bwcap.bw_cap = cpu_to_le32(bw_cap);
4940-
err = brcmf_fil_iovar_data_set(ifp, "bw_cap", &band_bwcap,
4941-
sizeof(band_bwcap));
4939+
/* verify support for bw_cap command */
4940+
val = WLC_BAND_5G;
4941+
err = brcmf_fil_iovar_int_get(ifp, "bw_cap", &val);
49424942

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+
}
49434954
return err;
49444955
}
49454956

@@ -5005,11 +5016,10 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
50055016
*/
50065017
if (wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap.cap &
50075018
IEEE80211_HT_CAP_SUP_WIDTH_20_40) {
5008-
err = brcmf_set_bwcap(ifp, WLC_BAND_2G, WLC_BW_CAP_40MHZ);
5009-
if (!err) {
5019+
err = brcmf_enable_bw40_2g(ifp);
5020+
if (!err)
50105021
err = brcmf_fil_iovar_int_set(ifp, "obss_coex",
50115022
BRCMF_OBSS_COEX_AUTO);
5012-
}
50135023
}
50145024

50155025
err = brcmf_fil_iovar_int_set(ifp, "tdls_enable", 1);

0 commit comments

Comments
 (0)