Skip to content

Commit 4f86cfc

Browse files
dberlinjannau
authored andcommitted
[brcmfmac] Support bandwidth caps for all bands
Signed-off-by: Daniel Berlin <dberlin@dberlin.org>
1 parent 50bac88 commit 4f86cfc

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

  • drivers/net/wireless/broadcom/brcm80211/brcmfmac

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7256,6 +7256,7 @@ static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg,
72567256
break;
72577257
}
72587258
}
7259+
72597260
if (!channel) {
72607261
/* It seems firmware supports some channel we never
72617262
* considered. Something new in IEEE standard?
@@ -7328,17 +7329,25 @@ static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
73287329
struct brcmu_chan ch;
73297330
u32 num_chan;
73307331
int i, j;
7332+
s32 updown;
73317333

73327334
/* verify support for bw_cap command */
7333-
val = WLC_BAND_5G;
7335+
val = WLC_BAND_2G;
73347336
err = brcmf_fil_iovar_int_get(ifp, "bw_cap", &val);
7335-
7337+
brcmf_dbg(INFO, "Check bw_cap support:%d\n", err);
73367338
if (!err) {
7339+
/* Setting the bw_cap is DOWN restricted. */
7340+
updown = 0;
7341+
brcmf_fil_cmd_data_set(ifp, BRCMF_C_DOWN, &updown, sizeof(s32));
73377342
/* only set 2G bandwidth using bw_cap command */
73387343
band_bwcap.band = cpu_to_le32(WLC_BAND_2G);
73397344
band_bwcap.bw_cap = cpu_to_le32(WLC_BW_CAP_40MHZ);
73407345
err = brcmf_fil_iovar_data_set(ifp, "bw_cap", &band_bwcap,
73417346
sizeof(band_bwcap));
7347+
brcmf_dbg(INFO, "set bw_cap support:%d\n", err);
7348+
brcmf_c_set_joinpref_default(ifp);
7349+
updown = 1;
7350+
brcmf_fil_cmd_data_set(ifp, BRCMF_C_UP, &updown, sizeof(s32));
73427351
} else {
73437352
brcmf_dbg(INFO, "fallback to mimo_bw_cap\n");
73447353
val = WLC_N_BW_40ALL;
@@ -7400,7 +7409,7 @@ static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
74007409
return err;
74017410
}
74027411

7403-
static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[], bool has_6g)
7412+
static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[4], bool has_6g)
74047413
{
74057414
struct brcmf_pub *drvr = ifp->drvr;
74067415
u32 band, mimo_bwcap;
@@ -7455,7 +7464,7 @@ static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[], bool has_6g)
74557464
}
74567465

74577466
static void brcmf_update_ht_cap(struct ieee80211_supported_band *band,
7458-
u32 bw_cap[2], u32 nrxchain)
7467+
u32 bw_cap[4], u32 nrxchain)
74597468
{
74607469
/* Not supported in 6G band */
74617470
if (band->band == NL80211_BAND_6GHZ)
@@ -7486,7 +7495,7 @@ static __le16 brcmf_get_mcs_map(u32 nstreams,
74867495
}
74877496

74887497
static void brcmf_update_vht_cap(struct ieee80211_supported_band *band,
7489-
u32 bw_cap[2], u32 txstreams, u32 rxstreams,
7498+
u32 bw_cap[4], u32 txstreams, u32 rxstreams,
74907499
u32 txbf_bfe_cap, u32 txbf_bfr_cap,
74917500
u32 ldpc_cap, u32 stbc_rx, u32 stbc_tx)
74927501
{
@@ -7671,7 +7680,7 @@ static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg)
76717680
u32 nmode = 0;
76727681
u32 vhtmode = 0;
76737682
/* 2GHZ, 5GHZ, 60GHZ, 6GHZ */
7674-
u32 bw_cap[4] = { WLC_BW_20MHZ_BIT, WLC_BW_20MHZ_BIT, 0, 0 };
7683+
u32 bw_cap[4] = { 0, 0, 0, 0 };
76757684
u32 rxchain = 0;
76767685
u32 txchain;
76777686
u32 nrxchain;

0 commit comments

Comments
 (0)