Skip to content

Commit 762963b

Browse files
dberlinjannau
authored andcommitted
[brcmfmac] Support bandwidth caps for all bands
Signed-off-by: Daniel Berlin <dberlin@dberlin.org>
1 parent 6c9ed31 commit 762963b

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
@@ -7263,6 +7263,7 @@ static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg,
72637263
break;
72647264
}
72657265
}
7266+
72667267
if (!channel) {
72677268
/* It seems firmware supports some channel we never
72687269
* considered. Something new in IEEE standard?
@@ -7335,17 +7336,25 @@ static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
73357336
struct brcmu_chan ch;
73367337
u32 num_chan;
73377338
int i, j;
7339+
s32 updown;
73387340

73397341
/* verify support for bw_cap command */
7340-
val = WLC_BAND_5G;
7342+
val = WLC_BAND_2G;
73417343
err = brcmf_fil_iovar_int_get(ifp, "bw_cap", &val);
7342-
7344+
brcmf_dbg(INFO, "Check bw_cap support:%d\n", err);
73437345
if (!err) {
7346+
/* Setting the bw_cap is DOWN restricted. */
7347+
updown = 0;
7348+
brcmf_fil_cmd_data_set(ifp, BRCMF_C_DOWN, &updown, sizeof(s32));
73447349
/* only set 2G bandwidth using bw_cap command */
73457350
band_bwcap.band = cpu_to_le32(WLC_BAND_2G);
73467351
band_bwcap.bw_cap = cpu_to_le32(WLC_BW_CAP_40MHZ);
73477352
err = brcmf_fil_iovar_data_set(ifp, "bw_cap", &band_bwcap,
73487353
sizeof(band_bwcap));
7354+
brcmf_dbg(INFO, "set bw_cap support:%d\n", err);
7355+
brcmf_c_set_joinpref_default(ifp);
7356+
updown = 1;
7357+
brcmf_fil_cmd_data_set(ifp, BRCMF_C_UP, &updown, sizeof(s32));
73497358
} else {
73507359
brcmf_dbg(INFO, "fallback to mimo_bw_cap\n");
73517360
val = WLC_N_BW_40ALL;
@@ -7407,7 +7416,7 @@ static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
74077416
return err;
74087417
}
74097418

7410-
static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[], bool has_6g)
7419+
static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[4], bool has_6g)
74117420
{
74127421
struct brcmf_pub *drvr = ifp->drvr;
74137422
u32 band, mimo_bwcap;
@@ -7462,7 +7471,7 @@ static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[], bool has_6g)
74627471
}
74637472

74647473
static void brcmf_update_ht_cap(struct ieee80211_supported_band *band,
7465-
u32 bw_cap[2], u32 nrxchain)
7474+
u32 bw_cap[4], u32 nrxchain)
74667475
{
74677476
/* Not supported in 6G band */
74687477
if (band->band == NL80211_BAND_6GHZ)
@@ -7493,7 +7502,7 @@ static __le16 brcmf_get_mcs_map(u32 nstreams,
74937502
}
74947503

74957504
static void brcmf_update_vht_cap(struct ieee80211_supported_band *band,
7496-
u32 bw_cap[2], u32 txstreams, u32 rxstreams,
7505+
u32 bw_cap[4], u32 txstreams, u32 rxstreams,
74977506
u32 txbf_bfe_cap, u32 txbf_bfr_cap,
74987507
u32 ldpc_cap, u32 stbc_rx, u32 stbc_tx)
74997508
{
@@ -7678,7 +7687,7 @@ static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg)
76787687
u32 nmode = 0;
76797688
u32 vhtmode = 0;
76807689
/* 2GHZ, 5GHZ, 60GHZ, 6GHZ */
7681-
u32 bw_cap[4] = { WLC_BW_20MHZ_BIT, WLC_BW_20MHZ_BIT, 0, 0 };
7690+
u32 bw_cap[4] = { 0, 0, 0, 0 };
76827691
u32 rxchain = 0;
76837692
u32 txchain;
76847693
u32 nrxchain;

0 commit comments

Comments
 (0)