staging: brcm80211: removed functionality to disable N mode
NVRAM contains a parameter that can disable N mode. This functionality is not needed. As a consequence, brcms_c_protection_upd() could be simplified. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
44a94f62f1
commit
358830e372
@ -1004,7 +1004,7 @@ brcms_c_set_country_common(struct brcms_cm_info *wlc_cm,
|
|||||||
|
|
||||||
if ((wlc->pub->_n_enab & SUPPORT_11N) !=
|
if ((wlc->pub->_n_enab & SUPPORT_11N) !=
|
||||||
wlc->protection->nmode_user)
|
wlc->protection->nmode_user)
|
||||||
brcms_c_set_nmode(wlc, wlc->protection->nmode_user);
|
brcms_c_set_nmode(wlc);
|
||||||
|
|
||||||
brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_2G_INDEX]);
|
brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_2G_INDEX]);
|
||||||
brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_5G_INDEX]);
|
brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_5G_INDEX]);
|
||||||
|
@ -5202,7 +5202,6 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
|
|||||||
uint err = 0;
|
uint err = 0;
|
||||||
uint i, j;
|
uint i, j;
|
||||||
struct brcms_pub *pub;
|
struct brcms_pub *pub;
|
||||||
uint n_disabled;
|
|
||||||
|
|
||||||
/* allocate struct brcms_c_info state and its substructures */
|
/* allocate struct brcms_c_info state and its substructures */
|
||||||
wlc = (struct brcms_c_info *) brcms_c_attach_malloc(unit, &err, device);
|
wlc = (struct brcms_c_info *) brcms_c_attach_malloc(unit, &err, device);
|
||||||
@ -5228,9 +5227,6 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
|
|||||||
/* update sta/ap related parameters */
|
/* update sta/ap related parameters */
|
||||||
brcms_c_ap_upd(wlc);
|
brcms_c_ap_upd(wlc);
|
||||||
|
|
||||||
/* 11n_disable nvram */
|
|
||||||
n_disabled = getintvar(pub->vars, "11n_disable");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* low level attach steps(all hw accesses go
|
* low level attach steps(all hw accesses go
|
||||||
* inside, no more in rest of the attach)
|
* inside, no more in rest of the attach)
|
||||||
@ -5301,17 +5297,11 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
|
|||||||
|
|
||||||
/* init _n_enab supported mode */
|
/* init _n_enab supported mode */
|
||||||
if (BRCMS_PHY_11N_CAP(wlc->band)) {
|
if (BRCMS_PHY_11N_CAP(wlc->band)) {
|
||||||
if (n_disabled & WLFEATURE_DISABLE_11N) {
|
pub->_n_enab = SUPPORT_11N;
|
||||||
pub->_n_enab = OFF;
|
brcms_c_protection_upd(wlc, BRCMS_PROT_N_USER,
|
||||||
brcms_c_protection_upd(wlc, BRCMS_PROT_N_USER,
|
|
||||||
OFF);
|
|
||||||
} else {
|
|
||||||
pub->_n_enab = SUPPORT_11N;
|
|
||||||
brcms_c_protection_upd(wlc, BRCMS_PROT_N_USER,
|
|
||||||
((pub->_n_enab ==
|
((pub->_n_enab ==
|
||||||
SUPPORT_11N) ? WL_11N_2x2 :
|
SUPPORT_11N) ? WL_11N_2x2 :
|
||||||
WL_11N_3x3));
|
WL_11N_3x3));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* init per-band default rateset, depend on band->gmode */
|
/* init per-band default rateset, depend on band->gmode */
|
||||||
@ -5387,19 +5377,6 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
|
|||||||
brcms_c_ht_update_sgi_rx(wlc, 0);
|
brcms_c_ht_update_sgi_rx(wlc, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *******nvram 11n config overrides Start ********* */
|
|
||||||
|
|
||||||
if (n_disabled & WLFEATURE_DISABLE_11N_SGI_RX)
|
|
||||||
brcms_c_ht_update_sgi_rx(wlc, 0);
|
|
||||||
|
|
||||||
/* apply the stbc override from nvram conf */
|
|
||||||
if (n_disabled & WLFEATURE_DISABLE_11N_STBC_TX) {
|
|
||||||
wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = OFF;
|
|
||||||
wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = OFF;
|
|
||||||
}
|
|
||||||
if (n_disabled & WLFEATURE_DISABLE_11N_STBC_RX)
|
|
||||||
brcms_c_stf_stbc_rx_set(wlc, HT_CAP_RX_STBC_NO);
|
|
||||||
|
|
||||||
/* initialize radio_mpc_disable according to wlc->mpc */
|
/* initialize radio_mpc_disable according to wlc->mpc */
|
||||||
brcms_c_radio_mpc_upd(wlc);
|
brcms_c_radio_mpc_upd(wlc);
|
||||||
brcms_b_antsel_set(wlc->hw, wlc->asi->antsel_avail);
|
brcms_b_antsel_set(wlc->hw, wlc->asi->antsel_avail);
|
||||||
@ -6109,54 +6086,36 @@ static int brcms_c_nmode_validate(struct brcms_c_info *wlc, s32 nmode)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int brcms_c_set_nmode(struct brcms_c_info *wlc, s32 nmode)
|
int brcms_c_set_nmode(struct brcms_c_info *wlc)
|
||||||
{
|
{
|
||||||
uint i;
|
uint i;
|
||||||
int err;
|
int err;
|
||||||
|
s32 nmode = AUTO;
|
||||||
|
|
||||||
err = brcms_c_nmode_validate(wlc, nmode);
|
err = brcms_c_nmode_validate(wlc, nmode);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
switch (nmode) {
|
if (wlc->stf->txstreams == WL_11N_3x3)
|
||||||
case OFF:
|
nmode = WL_11N_3x3;
|
||||||
wlc->pub->_n_enab = OFF;
|
else
|
||||||
wlc->default_bss->flags &= ~BRCMS_BSS_HT;
|
nmode = WL_11N_2x2;
|
||||||
/* delete the mcs rates from the default and hw ratesets */
|
|
||||||
brcms_c_rateset_mcs_clear(&wlc->default_bss->rateset);
|
|
||||||
for (i = 0; i < wlc->pub->_nbands; i++) {
|
|
||||||
memset(wlc->bandstate[i]->hw_rateset.mcs, 0,
|
|
||||||
MCSSET_LEN);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AUTO:
|
/* force GMODE_AUTO if NMODE is ON */
|
||||||
if (wlc->stf->txstreams == WL_11N_3x3)
|
brcms_c_set_gmode(wlc, GMODE_AUTO, true);
|
||||||
nmode = WL_11N_3x3;
|
if (nmode == WL_11N_3x3)
|
||||||
else
|
wlc->pub->_n_enab = SUPPORT_HT;
|
||||||
nmode = WL_11N_2x2;
|
else
|
||||||
case WL_11N_2x2:
|
wlc->pub->_n_enab = SUPPORT_11N;
|
||||||
case WL_11N_3x3:
|
wlc->default_bss->flags |= BRCMS_BSS_HT;
|
||||||
/* force GMODE_AUTO if NMODE is ON */
|
/* add the mcs rates to the default and hw ratesets */
|
||||||
brcms_c_set_gmode(wlc, GMODE_AUTO, true);
|
brcms_c_rateset_mcs_build(&wlc->default_bss->rateset,
|
||||||
if (nmode == WL_11N_3x3)
|
wlc->stf->txstreams);
|
||||||
wlc->pub->_n_enab = SUPPORT_HT;
|
for (i = 0; i < wlc->pub->_nbands; i++)
|
||||||
else
|
memcpy(wlc->bandstate[i]->hw_rateset.mcs,
|
||||||
wlc->pub->_n_enab = SUPPORT_11N;
|
wlc->default_bss->rateset.mcs, MCSSET_LEN);
|
||||||
wlc->default_bss->flags |= BRCMS_BSS_HT;
|
|
||||||
/* add the mcs rates to the default and hw ratesets */
|
|
||||||
brcms_c_rateset_mcs_build(&wlc->default_bss->rateset,
|
|
||||||
wlc->stf->txstreams);
|
|
||||||
for (i = 0; i < wlc->pub->_nbands; i++)
|
|
||||||
memcpy(wlc->bandstate[i]->hw_rateset.mcs,
|
|
||||||
wlc->default_bss->rateset.mcs, MCSSET_LEN);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
return 0;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -799,7 +799,7 @@ extern void brcms_c_set_chanspec(struct brcms_c_info *wlc,
|
|||||||
|
|
||||||
extern bool brcms_c_timers_init(struct brcms_c_info *wlc, int unit);
|
extern bool brcms_c_timers_init(struct brcms_c_info *wlc, int unit);
|
||||||
|
|
||||||
extern int brcms_c_set_nmode(struct brcms_c_info *wlc, s32 nmode);
|
extern int brcms_c_set_nmode(struct brcms_c_info *wlc);
|
||||||
extern void brcms_c_mimops_action_ht_send(struct brcms_c_info *wlc,
|
extern void brcms_c_mimops_action_ht_send(struct brcms_c_info *wlc,
|
||||||
struct brcms_bss_cfg *bsscfg,
|
struct brcms_bss_cfg *bsscfg,
|
||||||
u8 mimops_mode);
|
u8 mimops_mode);
|
||||||
|
Loading…
Reference in New Issue
Block a user