From: Roland Vossen Date: Sun, 2 Oct 2011 17:14:45 +0000 (-0700) Subject: staging: brcm80211: removed functionality to disable N mode X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=358830e372001fb0b89e3a4b889137247bd62bc9;p=openwrt%2Fstaging%2Fblogic.git 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 Reviewed-by: Arend van Spriel Signed-off-by: Franky Lin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/brcm80211/brcmsmac/channel.c b/drivers/staging/brcm80211/brcmsmac/channel.c index 7fe005aabd81..2127c2791a3d 100644 --- a/drivers/staging/brcm80211/brcmsmac/channel.c +++ b/drivers/staging/brcm80211/brcmsmac/channel.c @@ -1004,7 +1004,7 @@ brcms_c_set_country_common(struct brcms_cm_info *wlc_cm, if ((wlc->pub->_n_enab & SUPPORT_11N) != 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_5G_INDEX]); diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c index e4dd2d486dc5..de5f5c03499e 100644 --- a/drivers/staging/brcm80211/brcmsmac/main.c +++ b/drivers/staging/brcm80211/brcmsmac/main.c @@ -5202,7 +5202,6 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit, uint err = 0; uint i, j; struct brcms_pub *pub; - uint n_disabled; /* allocate struct brcms_c_info state and its substructures */ 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 */ brcms_c_ap_upd(wlc); - /* 11n_disable nvram */ - n_disabled = getintvar(pub->vars, "11n_disable"); - /* * low level attach steps(all hw accesses go * 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 */ if (BRCMS_PHY_11N_CAP(wlc->band)) { - if (n_disabled & WLFEATURE_DISABLE_11N) { - pub->_n_enab = OFF; - 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 = SUPPORT_11N; + brcms_c_protection_upd(wlc, BRCMS_PROT_N_USER, ((pub->_n_enab == SUPPORT_11N) ? WL_11N_2x2 : WL_11N_3x3)); - } } /* 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); } - /* *******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 */ brcms_c_radio_mpc_upd(wlc); 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; } -int brcms_c_set_nmode(struct brcms_c_info *wlc, s32 nmode) +int brcms_c_set_nmode(struct brcms_c_info *wlc) { uint i; int err; + s32 nmode = AUTO; err = brcms_c_nmode_validate(wlc, nmode); if (err) return err; - switch (nmode) { - case OFF: - wlc->pub->_n_enab = OFF; - wlc->default_bss->flags &= ~BRCMS_BSS_HT; - /* 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: - if (wlc->stf->txstreams == WL_11N_3x3) - nmode = WL_11N_3x3; - else - nmode = WL_11N_2x2; - case WL_11N_2x2: - case WL_11N_3x3: - /* force GMODE_AUTO if NMODE is ON */ - brcms_c_set_gmode(wlc, GMODE_AUTO, true); - if (nmode == WL_11N_3x3) - wlc->pub->_n_enab = SUPPORT_HT; - else - wlc->pub->_n_enab = SUPPORT_11N; - 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; + if (wlc->stf->txstreams == WL_11N_3x3) + nmode = WL_11N_3x3; + else + nmode = WL_11N_2x2; - default: - break; - } + /* force GMODE_AUTO if NMODE is ON */ + brcms_c_set_gmode(wlc, GMODE_AUTO, true); + if (nmode == WL_11N_3x3) + wlc->pub->_n_enab = SUPPORT_HT; + else + wlc->pub->_n_enab = SUPPORT_11N; + 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); - return err; + return 0; } static int diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h index 8815042e4487..e4589167f6d7 100644 --- a/drivers/staging/brcm80211/brcmsmac/main.h +++ b/drivers/staging/brcm80211/brcmsmac/main.h @@ -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 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, struct brcms_bss_cfg *bsscfg, u8 mimops_mode);