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: [PATCHv2 76/82] staging: brcm80211: removed void * from ai_ functions
Date: Mon, 8 Aug 2011 15:59:00 +0200 [thread overview]
Message-ID: <1312811946-16713-77-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1312811946-16713-1-git-send-email-arend@broadcom.com>
From: Roland Vossen <rvossen@broadcom.com>
Code cleanup. Replaced void * by less generic pointer types.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/staging/brcm80211/brcmsmac/aiutils.c | 46 +++++++++++++-------------
drivers/staging/brcm80211/brcmsmac/aiutils.h | 5 +--
drivers/staging/brcm80211/brcmsmac/pmu.c | 4 +-
3 files changed, 26 insertions(+), 29 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/aiutils.c b/drivers/staging/brcm80211/brcmsmac/aiutils.c
index 9cfb492..3d392a3 100644
--- a/drivers/staging/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/staging/brcm80211/brcmsmac/aiutils.c
@@ -483,16 +483,16 @@ static void ai_hwfixup(struct si_info *sii)
}
/* parse the enumeration rom to identify all cores */
-void ai_scan(struct si_pub *sih, void *regs)
+void ai_scan(struct si_pub *sih, struct chipcregs *cc)
{
struct si_info *sii = SI_INFO(sih);
- struct chipcregs *cc = (struct chipcregs *) regs;
u32 erombase, *eromptr, *eromlim;
+ void *regs = cc;
erombase = R_REG(&cc->eromptr);
/* Set wrappers address */
- sii->curwrap = (void *)((unsigned long)regs + SI_CORE_SIZE);
+ sii->curwrap = (void *)((unsigned long)cc + SI_CORE_SIZE);
/* Now point the window at the erom */
pci_write_config_dword(sii->pbus, PCI_BAR0_WIN, erombase);
@@ -671,7 +671,10 @@ void ai_scan(struct si_pub *sih, void *regs)
/*
* This function changes the logical "focus" to the indicated core.
- * Return the current core's virtual address.
+ * Return the current core's virtual address. Since each core starts with the
+ * same set of registers (BIST, clock control, etc), the returned address
+ * contains the first register of this 'common' register block (not to be
+ * confused with 'common core').
*/
void *ai_setcoreidx(struct si_pub *sih, uint coreidx)
{
@@ -864,8 +867,7 @@ static struct si_info *ai_doattach(struct si_info *sii, void *regs,
struct pci_dev *sdh,
char **vars, uint *varsz);
static bool ai_buscore_prep(struct si_info *sii);
-static bool ai_buscore_setup(struct si_info *sii, struct chipcregs *cc,
- u32 savewin, uint *origidx, void *regs);
+static bool ai_buscore_setup(struct si_info *sii, u32 savewin, uint *origidx);
static void ai_nvram_process(struct si_info *sii, char *pvars);
/* dev path concatenation util */
@@ -916,12 +918,12 @@ static bool ai_buscore_prep(struct si_info *sii)
}
static bool
-ai_buscore_setup(struct si_info *sii, struct chipcregs *cc, u32 savewin,
- uint *origidx, void *regs)
+ai_buscore_setup(struct si_info *sii, u32 savewin, uint *origidx)
{
bool pci, pcie;
uint i;
uint pciidx, pcieidx, pcirev, pcierev;
+ struct chipcregs *cc;
cc = ai_setcoreidx(&sii->pub, SI_CC_IDX);
@@ -977,7 +979,7 @@ ai_buscore_setup(struct si_info *sii, struct chipcregs *cc, u32 savewin,
/* find the core idx before entering this func. */
if ((savewin && (savewin == sii->coresba[i])) ||
- (regs == sii->regs[i]))
+ (cc == sii->regs[i]))
*origidx = i;
}
@@ -1003,9 +1005,8 @@ ai_buscore_setup(struct si_info *sii, struct chipcregs *cc, u32 savewin,
/* fixup necessary chip/core configurations */
if (SI_FAST(sii)) {
if (!sii->pch) {
- sii->pch = (void *)pcicore_init(
- &sii->pub, sii->pbus,
- (void *)PCIEREGS(sii));
+ sii->pch = pcicore_init(&sii->pub, sii->pbus,
+ (void *)PCIEREGS(sii));
if (sii->pch == NULL)
return false;
}
@@ -1108,7 +1109,7 @@ static struct si_info *ai_doattach(struct si_info *sii,
if (socitype == SOCI_AI) {
SI_MSG(("Found chip type AI (0x%08x)\n", w));
/* pass chipc address instead of original core base */
- ai_scan(&sii->pub, (void *)cc);
+ ai_scan(&sii->pub, cc);
} else {
SI_ERROR(("Found chip of unknown type (0x%08x)\n", w));
return NULL;
@@ -1120,13 +1121,13 @@ static struct si_info *ai_doattach(struct si_info *sii,
}
/* bus/core/clk setup */
origidx = SI_CC_IDX;
- if (!ai_buscore_setup(sii, cc, savewin, &origidx, regs)) {
+ if (!ai_buscore_setup(sii, savewin, &origidx)) {
SI_ERROR(("si_doattach: si_buscore_setup failed\n"));
goto exit;
}
/* Init nvram from sprom/otp if they exist */
- if (srom_var_init(&sii->pub, regs, vars, varsz)) {
+ if (srom_var_init(&sii->pub, cc, vars, varsz)) {
SI_ERROR(("si_doattach: srom_var_init failed: bad srom\n"));
goto exit;
}
@@ -1327,9 +1328,9 @@ void *ai_switch_core(struct si_pub *sih, uint coreid, uint *origidx,
*/
*origidx = coreid;
if (coreid == CC_CORE_ID)
- return (void *)CCREGS_FAST(sii);
+ return CCREGS_FAST(sii);
else if (coreid == sih->buscoretype)
- return (void *)PCIEREGS(sii);
+ return PCIEREGS(sii);
}
INTR_OFF(sii, *intr_val);
*origidx = sii->curidx;
@@ -1553,9 +1554,8 @@ ai_slowclk_freq(struct si_info *sii, bool max_freq, struct chipcregs *cc)
return 0;
}
-static void ai_clkctl_setdelay(struct si_info *sii, void *chipcregs)
+static void ai_clkctl_setdelay(struct si_info *sii, struct chipcregs *cc)
{
- struct chipcregs *cc = (struct chipcregs *) chipcregs;
uint slowmaxfreq, pll_delay, slowclk;
uint pll_on_delay, fref_sel_delay;
@@ -1611,7 +1611,7 @@ void ai_clkctl_init(struct si_pub *sih)
SET_REG(&cc->system_clk_ctl, SYCC_CD_MASK,
(ILP_DIV_1MHZ << SYCC_CD_SHIFT));
- ai_clkctl_setdelay(sii, (void *)cc);
+ ai_clkctl_setdelay(sii, cc);
if (!fast)
ai_setcoreidx(sih, origidx);
@@ -1979,7 +1979,7 @@ void ai_pci_down(struct si_pub *sih)
void ai_pci_setup(struct si_pub *sih, uint coremask)
{
struct si_info *sii;
- void *regs = NULL;
+ struct sbpciregs *regs = NULL;
u32 siflag = 0, w;
uint idx = 0;
@@ -2025,7 +2025,7 @@ void ai_pci_setup(struct si_pub *sih, uint coremask)
int ai_pci_fixcfg(struct si_pub *sih)
{
uint origidx;
- void *regs = NULL;
+ struct sbpciregs *regs = NULL;
struct si_info *sii = SI_INFO(sih);
@@ -2095,7 +2095,7 @@ void ai_epa_4313war(struct si_pub *sih)
sii = SI_INFO(sih);
origidx = ai_coreidx(sih);
- cc = (struct chipcregs *) ai_setcore(sih, CC_CORE_ID, 0);
+ cc = ai_setcore(sih, CC_CORE_ID, 0);
/* EPA Fix */
W_REG(&cc->gpiocontrol,
diff --git a/drivers/staging/brcm80211/brcmsmac/aiutils.h b/drivers/staging/brcm80211/brcmsmac/aiutils.h
index 101ab92..84c6901 100644
--- a/drivers/staging/brcm80211/brcmsmac/aiutils.h
+++ b/drivers/staging/brcm80211/brcmsmac/aiutils.h
@@ -468,7 +468,7 @@ struct si_info {
/* check if interrupts are enabled */
bool (*intrsenabled_fn) (void *intr_arg);
- void *pch; /* PCI/E core handle */
+ struct pcicore_info *pch; /* PCI/E core handle */
char *vars;
uint varsz;
@@ -495,15 +495,12 @@ struct si_info {
};
/* AMBA Interconnect exported externs */
-extern void ai_scan(struct si_pub *sih, void *regs);
-
extern uint ai_flag(struct si_pub *sih);
extern void ai_setint(struct si_pub *sih, int siflag);
extern uint ai_coreidx(struct si_pub *sih);
extern uint ai_corevendor(struct si_pub *sih);
extern uint ai_corerev(struct si_pub *sih);
extern bool ai_iscoreup(struct si_pub *sih);
-extern void *ai_setcoreidx(struct si_pub *sih, uint coreidx);
extern u32 ai_core_cflags(struct si_pub *sih, u32 mask, u32 val);
extern void ai_core_cflags_wo(struct si_pub *sih, u32 mask, u32 val);
extern u32 ai_core_sflags(struct si_pub *sih, u32 mask, u32 val);
diff --git a/drivers/staging/brcm80211/brcmsmac/pmu.c b/drivers/staging/brcm80211/brcmsmac/pmu.c
index f5e1085..cdeaa4e 100644
--- a/drivers/staging/brcm80211/brcmsmac/pmu.c
+++ b/drivers/staging/brcm80211/brcmsmac/pmu.c
@@ -320,8 +320,8 @@ void si_pmu_spuravoid(struct si_pub *sih, u8 spuravoid)
uint origidx, intr_val;
/* Remember original core before switch to chipc */
- cc = (struct chipcregs *) ai_switch_core(sih, CC_CORE_ID, &origidx,
- &intr_val);
+ cc = (struct chipcregs *)
+ ai_switch_core(sih, CC_CORE_ID, &origidx, &intr_val);
/* update the pll changes */
si_pmu_spuravoid_pllupdate(sih, cc, spuravoid);
--
1.7.4.1
next prev parent reply other threads:[~2011-08-08 13:59 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-08 13:57 [PATCHv2 00/82] staging: brcm80211: resubmit previously posted patches Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 01/82] staging: brcm80211: fix compile error on non-x86 archs since 3.0 kernel Arend van Spriel
2011-08-08 16:28 ` Arend van Spriel
2011-08-23 20:02 ` Greg KH
2011-08-08 13:57 ` [PATCHv2 02/82] staging: brcm80211: bugfix for len==0 parameter in 3 fullmac functions Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 03/82] staging: brcm80211: merged bmac.c into main.c Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 04/82] staging: brcm80211: shuffled sections in main.c Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 05/82] staging: brcm80211: removed function declaration typedefs from phy_int.h Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 06/82] staging: brcm80211: removed function declaration typedefs from aiutils.h Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 07/82] staging: brcm80211: removed function declaration typedefs from dma.h part 1 Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 08/82] staging: brcm80211: removed function declaration typedefs from dma.h part 2 Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 09/82] staging: brcm80211: removed function declaration typedefs from dma.h part 3 Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 10/82] staging: brcm80211: removed function declaration typedefs from dma.h part 4 Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 11/82] staging: brcm80211: removed function declaration typedefs from otp.c Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 12/82] staging: brcm80211: removed function declaration typedefs from main.h,pub.h Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 13/82] staging: brcm80211: removed function declaration typedefs from brcmutil Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 14/82] staging: brcm80211: replaced various typedefs Arend van Spriel
2011-08-08 13:57 ` [PATCHv2 15/82] staging: brcm80211: replaced typedef wlc_rateset_t Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 16/82] staging: brcm80211: replaced typedef wl_rateset_t by struct brcm_rateset Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 17/82] staging: brcm80211: replaced all volatile typedefs Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 18/82] staging: brcm80211: modify the FOREACH_BSS macro Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 19/82] staging: brcm80211: use mutex instead of semaphore in dhd_linux.c Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 20/82] staging: brcm80211: remove duplicated code from brcmf_init_iscan Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 21/82] staging: brcm80211: remove volatile keyword from driver sources Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 22/82] staging: brcm80211: use native error code in brcmf_c_pattern_atoh() Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 23/82] staging: brcm80211: fix for checkpatch 'avoid externs in c file' warning Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 24/82] staging: brcm80211: power save issue fixed in brcmfmac driver Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 25/82] staging: brcm80211: brcmfmac: Enabling FW roaming by default Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 26/82] staging: brcm80211: brcmfmac: Connect request made robust Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 27/82] staging: brcm80211: use mac_pton() instead of own implementation Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 28/82] staging: brcm80211: fix for 'remove unnecessary braces' checkpatch warning Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 29/82] staging: brcm80211: brcmfmac: Fixed issues with iscan Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 30/82] staging: brcm80211: brcmfmac: Roamed channel info passed to cfg80211 Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 31/82] staging: brcm80211: move sdio related variables to dhd_sdio.c Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 32/82] staging: brcm80211: move ioctl response wait code " Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 33/82] staging: brcm80211: replace semaphore by wait_queue for sysioc thread Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 34/82] staging: brcm80211: remove volatile keyword used in struct rte_console Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 35/82] staging: brcm80211: fix for checkpatch warnings in phy directory Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 36/82] staging: brcm80211: resolved checkpatch warnings in LCN phy Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 37/82] staging: brcm80211: resolved checkpatch warnings in N phy Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 38/82] staging: brcm80211: fixed build issue for big endian platforms Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 39/82] staging: brcm80211: remove MIPS specific 'sync' instruction in fullmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 40/82] staging: brcm80211: removed R_REG and OR_REG macro's from fullmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 41/82] staging: brcm80211: removed global variable from sdio fullmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 42/82] staging: brcm80211: replace simple_strtoul usage in brcmsmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 43/82] staging: brcm80211: remove private timeout functions in fullmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 44/82] staging: brcm80211: move brcmf_mmc_suspend to sdio layer " Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 45/82] staging: brcm80211: remove global wait queue head sdioh_spinwait_sleep Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 46/82] staging: brcm80211: remove code for unsupported chip Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 47/82] staging: brcm80211: get rid of sd debug message macro in fullmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 48/82] staging: brcm80211: remove structure sdio_hc in brcmfmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 49/82] staging: brcm80211: remove SDLX_MSG from brcmfmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 50/82] staging: brcm80211: remove BRCMF_SD_* debug macros " Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 51/82] staging: brcm80211: absorb brcmf_sdcard_attach into brcmf_sdio_probe Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 52/82] staging: brcm80211: absorb brcmf_sdcard_detach into brcmf_sdio_remove Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 53/82] staging: brcm80211: replace simple_strtoul usage in brcmfmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 54/82] staging: brcm80211: fixed checkpatch warnings for fullmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 55/82] staging: brcm80211: fixed checkpatch warnings for brcmutil dir Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 56/82] staging: brcm80211: fixed checkpatch warnings for 'include' dir Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 57/82] staging: brcm80211: use PCI_DEVICE() macro in device table Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 58/82] staging: brcm80211: remove unused rx status definitions Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 59/82] staging: brcm80211: reformat long lines in brcmsmac to 80 columns Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 60/82] staging: brcm80211: remove wl_alloc_dma_resources() function Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 61/82] staging: brcm80211: remove dma_addrwidth() function Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 62/82] staging: brcm80211: revert removal of atomic initialization Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 63/82] staging: brcm80211: cleaned up softmac DMA layer Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 64/82] staging: brcm80211: removed void * from softmac phy Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 65/82] staging: brcm80211: simplified register access macro's in softmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 66/82] staging: brcm80211: placed suspend flag in gInstance in brcmfmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 67/82] staging: brcm80211: remove struct brcmf_sdioh_driver from brcmfmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 68/82] staging: brcm80211: remove vendor and device id check " Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 69/82] staging: brcm80211: remove struct brcmf_sdio_card " Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 70/82] staging: brcm80211: remove dead code " Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 71/82] staging: brcm80211: remove dead client interrupt " Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 72/82] staging: brcm80211: remove function pointer of interrupt isr in brcmfmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 73/82] staging: brcm80211: cleanup to get rid of 'over 80 character' line Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 74/82] staging: brcm80211: removed unused bus code from softmac Arend van Spriel
2011-08-08 13:58 ` [PATCHv2 75/82] staging: brcm80211: replaced void *btparam into struct pci_dev *btparam Arend van Spriel
2011-08-08 13:59 ` Arend van Spriel [this message]
2011-08-08 13:59 ` [PATCHv2 77/82] staging: brcm80211: removed brcms_c_module_unregister() call in ampdu.c Arend van Spriel
2011-08-08 13:59 ` [PATCHv2 78/82] staging: brcm80211: removed watchdog function from softmac Arend van Spriel
2011-08-08 13:59 ` [PATCHv2 79/82] staging: brcm80211: SPARC build error fix Arend van Spriel
2011-08-08 13:59 ` [PATCHv2 80/82] staging: brcm80211: fix 'uninitialized usage' compiler warning Arend van Spriel
2011-08-08 13:59 ` [PATCHv2 81/82] staging: brcm80211: remove target platform limitations for drivers Arend van Spriel
2011-08-08 13:59 ` [PATCHv2 82/82] staging: brcm80211: updated TODO file Arend van Spriel
2011-08-08 14:29 ` [PATCHv2 00/82] staging: brcm80211: resubmit previously posted patches Sedat Dilek
2011-08-08 14:53 ` Dan Carpenter
2011-08-08 16:10 ` Arend van Spriel
2011-08-08 16:32 ` Greg KH
2011-08-08 16:38 ` Arend van Spriel
2011-08-23 20:01 ` Greg KH
2011-08-24 10:45 ` Arend van Spriel
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=1312811946-16713-77-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).