linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Franky Lin" <frankyl@broadcom.com>
To: gregkh@suse.de
Cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org
Subject: [PATCH 20/20] staging: brcm80211: removed functionality to disable N mode
Date: Sun, 2 Oct 2011 10:14:45 -0700	[thread overview]
Message-ID: <1317575685-3156-21-git-send-email-frankyl@broadcom.com> (raw)
In-Reply-To: <1317575685-3156-1-git-send-email-frankyl@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

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>
---
 drivers/staging/brcm80211/brcmsmac/channel.c |    2 +-
 drivers/staging/brcm80211/brcmsmac/main.c    |   85 +++++++-------------------
 drivers/staging/brcm80211/brcmsmac/main.h    |    2 +-
 3 files changed, 24 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/channel.c b/drivers/staging/brcm80211/brcmsmac/channel.c
index 7fe005a..2127c27 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 e4dd2d4..de5f5c0 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 8815042..e458916 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);
-- 
1.7.1



  parent reply	other threads:[~2011-10-02 17:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-02 17:14 [PATCH 00/20] staging: brcm80211: code clean up Franky Lin
2011-10-02 17:14 ` [PATCH 01/20] staging: brmc80211: removed some unused fmac variable declarations Franky Lin
2011-10-02 17:14 ` [PATCH 02/20] staging: brcm80211: removed unused smac tx ampdu packet queue Franky Lin
2011-10-02 17:14 ` [PATCH 03/20] staging: brcm80211: cleaning up tx rate control code in softmac Franky Lin
2011-10-02 17:14 ` [PATCH 04/20] staging: brcm80211: various __iomem additions to softmac Franky Lin
2011-10-10 14:23   ` Rafał Miłecki
2011-10-10 17:45     ` Dan Carpenter
2011-10-02 17:14 ` [PATCH 05/20] staging: brcm80211: reduced softmac sparse warnings Franky Lin
2011-10-02 17:14 ` [PATCH 06/20] staging: brcm80211: added __iomem qualifier to softmac main.c Franky Lin
2011-10-02 17:14 ` [PATCH 07/20] staging: brcm80211: added __iomem qualifier to softmac dma.c Franky Lin
2011-10-02 17:14 ` [PATCH 08/20] staging: brcm80211: added __iomem qualifier to softmac phy Franky Lin
2011-10-02 17:14 ` [PATCH 09/20] staging: brcm80211: only allow one call to add_interface callback Franky Lin
2011-10-02 17:14 ` [PATCH 10/20] staging: brcm80211: reduce indentation level in dhd_sdio.c #1 Franky Lin
2011-10-02 17:14 ` [PATCH 11/20] staging: brcm80211: reduce indentation level in dhd_sdio.c #2 Franky Lin
2011-10-02 17:14 ` [PATCH 12/20] staging: brcm80211: reduce indentation level in dhd_sdio.c #3 Franky Lin
2011-10-02 17:14 ` [PATCH 13/20] staging: brcm80211: reducing indentation levels in bcmsdh_sdmmc.c Franky Lin
2011-10-02 17:14 ` [PATCH 14/20] staging: brcm80211: removed unused fullmac spinlock Franky Lin
2011-10-02 17:14 ` [PATCH 15/20] staging: brcm80211: removed unused softmac mimo disable code Franky Lin
2011-10-02 17:14 ` [PATCH 16/20] staging: brcm80211: removed fullmac function brcmf_bus_devreset() Franky Lin
2011-10-02 17:14 ` [PATCH 17/20] staging: brcm80211: removed 'enforce_mutex' parameter in fullmac Franky Lin
2011-10-02 17:14 ` [PATCH 18/20] staging: brcm80211: renamed ioctl functions/structs to dcmd Franky Lin
2011-10-02 17:14 ` [PATCH 19/20] staging: brcm80211: cleaned up buffer len defines in fullmac Franky Lin
2011-10-02 17:14 ` Franky Lin [this message]
2011-10-03 23:23 ` [PATCH 00/20] staging: brcm80211: code clean up Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317575685-3156-21-git-send-email-frankyl@broadcom.com \
    --to=frankyl@broadcom.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).