linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: gregkh@suse.de
Cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org,
	"Roland Vossen" <rvossen@broadcom.com>,
	"Arend van Spriel" <arend@broadcom.com>
Subject: [PATCH 01/26] staging: brcm80211: cleaned up struct brcms_bss_cfg
Date: Tue, 4 Oct 2011 23:18:47 +0200	[thread overview]
Message-ID: <1317763152-17607-2-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1317763152-17607-1-git-send-email-arend@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

Several fields were unused or were only set once. They have been
removed. Uncalled functions that relied on these constants have been
removed as well.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/main.c |  132 +----------------------------
 drivers/staging/brcm80211/brcmsmac/main.h |   38 --------
 2 files changed, 3 insertions(+), 167 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index de5f5c0..efc6682 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -1741,34 +1741,6 @@ void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw)
 		brcms_b_clkctl_clk(wlc_hw, CLK_DYNAMIC);
 }
 
-static void
-brcms_c_write_hw_bcntemplate0(struct brcms_hardware *wlc_hw, u16 bcn[],
-			      int len)
-{
-	struct d11regs __iomem *regs = wlc_hw->regs;
-
-	brcms_b_write_template_ram(wlc_hw, T_BCN0_TPL_BASE, (len + 3) & ~3,
-				    bcn);
-	/* write beacon length to SCR */
-	brcms_b_write_shm(wlc_hw, M_BCN0_FRM_BYTESZ, (u16) len);
-	/* mark beacon0 valid */
-	OR_REG(&regs->maccommand, MCMD_BCN0VLD);
-}
-
-static void
-brcms_c_write_hw_bcntemplate1(struct brcms_hardware *wlc_hw, u16 bcn[],
-			      int len)
-{
-	struct d11regs __iomem *regs = wlc_hw->regs;
-
-	brcms_b_write_template_ram(wlc_hw, T_BCN1_TPL_BASE, (len + 3) & ~3,
-				    bcn);
-	/* write beacon length to SCR */
-	brcms_b_write_shm(wlc_hw, M_BCN1_FRM_BYTESZ, (u16) len);
-	/* mark beacon1 valid */
-	OR_REG(&regs->maccommand, MCMD_BCN1VLD);
-}
-
 static void brcms_b_upd_synthpu(struct brcms_hardware *wlc_hw)
 {
 	u16 v;
@@ -3288,8 +3260,7 @@ bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
 		if (!cfg->BSS)
 			return false;
 
-		if (!cfg->dtim_programmed)
-			return false;
+		return false;
 	}
 
 	return true;
@@ -3791,9 +3762,6 @@ void brcms_c_init(struct brcms_c_info *wlc)
 	/* update beacon listen interval */
 	brcms_c_bcn_li_upd(wlc);
 
-	/* the world is new again, so is our reported rate */
-	brcms_c_reprate_init(wlc);
-
 	/* write ethernet address to core */
 	brcms_c_set_mac(wlc->bsscfg);
 	brcms_c_set_bssid(wlc->bsscfg);
@@ -4054,17 +4022,12 @@ brcms_b_set_chanspec(struct brcms_hardware *wlc_hw, u16 chanspec,
 static void brcms_c_setband(struct brcms_c_info *wlc,
 					   uint bandunit)
 {
-	struct brcms_bss_cfg *cfg = wlc->bsscfg;
-
 	wlc->band = wlc->bandstate[bandunit];
 
 	if (!wlc->pub->up)
 		return;
 
 	/* wait for at least one beacon before entering sleeping state */
-	if (cfg->associated)
-		cfg->PMawakebcn = true;
-
 	brcms_c_set_ps_ctrl(wlc);
 
 	/* band-specific initializations */
@@ -5357,7 +5320,6 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
 		goto fail;
 	}
 
-	wlc->bsscfg->_idx = 0;
 	wlc->bsscfg->wlc = wlc;
 
 	wlc->mimoft = FT_HT;
@@ -8763,82 +8725,6 @@ int brcms_c_get_header_len(void)
 	return TXOFF;
 }
 
-/* mac is assumed to be suspended at this point */
-static void
-brcms_b_write_hw_bcntemplates(struct brcms_hardware *wlc_hw, u16 bcn[],
-			      int len, bool both)
-{
-	struct d11regs __iomem *regs = wlc_hw->regs;
-
-	if (both) {
-		brcms_c_write_hw_bcntemplate0(wlc_hw, bcn, len);
-		brcms_c_write_hw_bcntemplate1(wlc_hw, bcn, len);
-	} else {
-		/* bcn 0 */
-		if (!(R_REG(&regs->maccommand) & MCMD_BCN0VLD))
-			brcms_c_write_hw_bcntemplate0(wlc_hw, bcn, len);
-		/* bcn 1 */
-		else if (!
-			 (R_REG(&regs->maccommand) & MCMD_BCN1VLD))
-			brcms_c_write_hw_bcntemplate1(wlc_hw, bcn, len);
-	}
-}
-
-static void brcms_c_write_hw_bcntemplates(struct brcms_c_info *wlc, u16 bcn[],
-					  int len, bool both)
-{
-	brcms_b_write_hw_bcntemplates(wlc->hw, bcn, len, both);
-}
-
-/*
- * Update a beacon for a particular BSS
- * For MBSS, this updates the software template and sets "latest" to
- * the index of the template updated. Otherwise, it updates the hardware
- * template.
- */
-void brcms_c_bss_update_beacon(struct brcms_c_info *wlc,
-			       struct brcms_bss_cfg *cfg)
-{
-	int len = BCN_TMPL_LEN;
-
-	/* Clear the soft intmask */
-	wlc->defmacintmask &= ~MI_BCNTPL;
-
-	if (!cfg->up)
-		/* Only allow updates on an UP bss */
-		return;
-
-	/* Optimize:  Some of if/else could be combined */
-	if ((cfg->flags & BRCMS_BSSCFG_HW_BCN) != 0) {
-		/* Hardware beaconing for this config */
-		u16 bcn[BCN_TMPL_LEN / 2];
-		u32 both_valid = MCMD_BCN0VLD | MCMD_BCN1VLD;
-		struct d11regs __iomem *regs = wlc->regs;
-
-		/* Check if both templates are in use, if so sched. an interrupt
-		 *      that will call back into this routine
-		 */
-		if ((R_REG(&regs->maccommand) & both_valid) == both_valid)
-			/* clear any previous status */
-			W_REG(&regs->macintstatus, MI_BCNTPL);
-
-		/* Check that after scheduling the interrupt both of the
-		 *      templates are still busy. if not clear the int. & remask
-		 */
-		if ((R_REG(&regs->maccommand) & both_valid) == both_valid) {
-			wlc->defmacintmask |= MI_BCNTPL;
-			return;
-		}
-
-		wlc->bcn_rspec =
-		    brcms_c_lowest_basic_rspec(wlc, &cfg->current_bss->rateset);
-		/* update the template and ucode shm */
-		brcms_c_bcn_prb_template(wlc, IEEE80211_STYPE_BEACON,
-				     wlc->bcn_rspec, cfg, bcn, &len);
-		brcms_c_write_hw_bcntemplates(wlc, bcn, len, false);
-	}
-}
-
 /*
  * Update all beacons for the system.
  */
@@ -8847,7 +8733,8 @@ void brcms_c_update_beacon(struct brcms_c_info *wlc)
 	struct brcms_bss_cfg *bsscfg = wlc->bsscfg;
 
 	if (bsscfg->up && !bsscfg->BSS)
-		brcms_c_bss_update_beacon(wlc, bsscfg);
+		/* Clear the soft intmask */
+		wlc->defmacintmask &= ~MI_BCNTPL;
 }
 
 /* Write ssid into shared memory */
@@ -8946,19 +8833,6 @@ int brcms_c_prep_pdu(struct brcms_c_info *wlc, struct sk_buff *pdu, uint *fifop)
 	return 0;
 }
 
-/* init tx reported rate mechanism */
-void brcms_c_reprate_init(struct brcms_c_info *wlc)
-{
-	brcms_c_bsscfg_reprate_init(wlc->bsscfg);
-}
-
-/* per bsscfg init tx reported rate mechanism */
-void brcms_c_bsscfg_reprate_init(struct brcms_bss_cfg *bsscfg)
-{
-	bsscfg->txrspecidx = 0;
-	memset((char *)bsscfg->txrspec, 0, sizeof(bsscfg->txrspec));
-}
-
 void brcms_default_rateset(struct brcms_c_info *wlc, struct brcms_c_rateset *rs)
 {
 	brcms_c_rateset_default(rs, NULL, wlc->band->phytype,
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index e458916..9e1575c 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -634,35 +634,18 @@ struct antsel_info {
  * enable: is this configuration enabled
  * associated: is BSS in ASSOCIATED state
  * BSS: infraustructure or adhoc
- * dtim_programmed:
  * SSID_len: the length of SSID
  * SSID: SSID string
- * bcmc_scb: one bcmc_scb per band
- * _idx: the index of this bsscfg, assigned at wlc_bsscfg_alloc()
  *
  *
  * BSSID: BSSID (associated)
  * cur_etheraddr: h/w address
- * bcmc_fid: the last BCMC FID queued to TX_BCMC_FIFO
- * bcmc_fid_shm: the last BCMC FID written to shared mem
  * flags: BSSCFG flags; see below
- * bcn: AP beacon
- * bcn_len: AP beacon length
- * ar_disassoc: disassociated in associated recreation
  *
  * current_bss: BSS parms in ASSOCIATED state
  *
- * PM states
- * ---------
- * PMawakebcn: bcn recvd during current waking state
- * PMpending: waiting for tx status with PM indicated set
- * priorPMstate: Detecting PM state transitions
- * PSpoll: flags there is an outstanding PS-Poll frame
  *
  * ID: 'unique' ID of this bsscfg, assigned at bsscfg allocation
- *
- * txrspecidx: index into tx rate circular buffer
- * txrspec: circular buffer of prev MPDUs tx rates
  */
 struct brcms_bss_cfg {
 	struct brcms_c_info *wlc;
@@ -670,27 +653,11 @@ struct brcms_bss_cfg {
 	bool enable;
 	bool associated;
 	bool BSS;
-	bool dtim_programmed;
 	u8 SSID_len;
 	u8 SSID[IEEE80211_MAX_SSID_LEN];
-	struct scb *bcmc_scb[MAXBANDS];
-	s8 _idx;
 	u8 BSSID[ETH_ALEN];
 	u8 cur_etheraddr[ETH_ALEN];
-	u16 bcmc_fid;
-	u16 bcmc_fid_shm;
-	u32 flags;
-	u8 *bcn;
-	uint bcn_len;
-	bool ar_disassoc;
 	struct brcms_bss_info *current_bss;
-	bool PMawakebcn;
-	bool PMpending;
-	bool priorPMstate;
-	bool PSpoll;
-	u16 ID;
-	uint txrspecidx;
-	u32 txrspec[NTXRATE][2];
 };
 
 extern void brcms_c_fatal_error(struct brcms_c_info *wlc);
@@ -765,9 +732,6 @@ extern void brcms_c_inval_dma_pkts(struct brcms_hardware *hw,
 			       struct ieee80211_sta *sta,
 			       void (*dma_callback_fn));
 
-extern void brcms_c_reprate_init(struct brcms_c_info *wlc);
-extern void brcms_c_bsscfg_reprate_init(struct brcms_bss_cfg *bsscfg);
-
 /* Shared memory access */
 extern void brcms_c_write_shm(struct brcms_c_info *wlc, uint offset, u16 v);
 extern u16 brcms_c_read_shm(struct brcms_c_info *wlc, uint offset);
@@ -775,8 +739,6 @@ extern void brcms_c_copyto_shm(struct brcms_c_info *wlc, uint offset,
 			       const void *buf, int len);
 
 extern void brcms_c_update_beacon(struct brcms_c_info *wlc);
-extern void brcms_c_bss_update_beacon(struct brcms_c_info *wlc,
-				  struct brcms_bss_cfg *bsscfg);
 
 extern void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend);
 extern void brcms_c_bss_update_probe_resp(struct brcms_c_info *wlc,
-- 
1.7.4.1



  reply	other threads:[~2011-10-04 21:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 21:18 [PATCH 00/26] various cleanup changes for brcmfmac and brcmsmac Arend van Spriel
2011-10-04 21:18 ` Arend van Spriel [this message]
2011-10-04 21:18 ` [PATCH 02/26] staging: brcm80211: remove setting ssn to zero upon AMPDU_TX_START Arend van Spriel
2011-10-04 21:18 ` [PATCH 03/26] staging: brcm80211: remove filtering of received frames Arend van Spriel
2011-10-04 21:18 ` [PATCH 04/26] staging: brcm80211: remove brcmu_bprintf and related functions Arend van Spriel
2011-10-04 21:18 ` [PATCH 05/26] staging: brcm80211: replace brcmu_bitcount with hweight8 Arend van Spriel
2011-10-04 21:18 ` [PATCH 06/26] staging: brcm80211: fullmac: fixed double #include Arend van Spriel
2011-10-04 21:18 ` [PATCH 07/26] staging: brcm80211: clean up rtnl_lock in fullmac Arend van Spriel
2011-10-04 21:18 ` [PATCH 08/26] staging: brcm80211: remove fullmac module_param for intr/poll mode Arend van Spriel
2011-10-04 21:18 ` [PATCH 09/26] staging: brcm80211: stop using assigned thread priority in fullmac Arend van Spriel
2011-10-04 21:18 ` [PATCH 10/26] staging: brcm80211: fixed checkpatch warnings Arend van Spriel
2011-10-04 21:18 ` [PATCH 11/26] staging: brcm80211: removed accessor functions for band type and etheraddress Arend van Spriel
2011-10-04 21:18 ` [PATCH 12/26] staging: brcm80211: fixed function returns Arend van Spriel
2011-10-04 21:18 ` [PATCH 13/26] staging: brcm80211: made NULL ethernet address const Arend van Spriel
2011-10-04 21:19 ` [PATCH 14/26] staging: brcm80211: removed empty brcms_c_reset_bmac_done callback function Arend van Spriel
2011-10-04 21:19 ` [PATCH 15/26] staging: brcm80211: decreased indentation level of brcms_c_wme_setparams function Arend van Spriel
2011-10-04 21:19 ` [PATCH 16/26] staging: brcm80211: removed redundant code from brcms_c_set_gmode Arend van Spriel
2011-10-04 21:19 ` [PATCH 17/26] staging: brcm80211: cleanup of shared memory related wrapper functions Arend van Spriel
2011-10-04 21:19 ` [PATCH 18/26] staging: brcm80211: cleanup of transmit buffer size related wrapper function Arend van Spriel
2011-10-04 21:19 ` [PATCH 19/26] staging: brcm80211: cleanup of several wrapper functions Arend van Spriel
2011-10-04 21:19 ` [PATCH 20/26] staging: brcm80211: removed unneeded call to brcms_b_tx_fifo_suspended Arend van Spriel
2011-10-04 21:19 ` [PATCH 21/26] staging: brcm80211: removed synchronisation of wlc->machwcap field Arend van Spriel
2011-10-04 21:19 ` [PATCH 22/26] staging: brcm80211: remove brcms_b_dotxstatus wrapper function Arend van Spriel
2011-10-04 21:19 ` [PATCH 23/26] staging: brcm80211: combined if statements Arend van Spriel
2011-10-04 21:19 ` [PATCH 24/26] staging: brcm80211: remove N mode validation function Arend van Spriel
2011-10-04 21:19 ` [PATCH 25/26] staging: brcm80211: softmac: added event tracing Arend van Spriel
2011-10-04 21:19 ` [PATCH 26/26] staging: brcm80211: smac: fix for 64 bit systems Arend van Spriel
2011-10-05 20:40 ` [PATCH 00/26] various cleanup changes for brcmfmac and brcmsmac 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=1317763152-17607-2-git-send-email-arend@broadcom.com \
    --to=arend@broadcom.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rvossen@broadcom.com \
    /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).