Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268237
b: refs/heads/master
c: b9b1ce7
h: refs/heads/master
i:
  268235: 5e52db5
v: v3
  • Loading branch information
Roland Vossen authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent 1beb672 commit 67b289e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 45 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33988fc3f9a82ea909764b7bd564b3c2568cbc68
refs/heads/master: b9b1ce791baf3d55fad6273c4a7478c645e2d92d
80 changes: 41 additions & 39 deletions trunk/drivers/staging/brcm80211/brcmsmac/aiutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ static void ai_hwfixup(struct si_info *sii)
/* parse the enumeration rom to identify all cores */
static void ai_scan(struct si_pub *sih, struct chipcregs *cc)
{
struct si_info *sii = SI_INFO(sih);
struct si_info *sii = (struct si_info *)sih;

u32 erombase, *eromptr, *eromlim;
void *regs = cc;

Expand Down Expand Up @@ -678,7 +679,7 @@ static void ai_scan(struct si_pub *sih, struct chipcregs *cc)
*/
void *ai_setcoreidx(struct si_pub *sih, uint coreidx)
{
struct si_info *sii = SI_INFO(sih);
struct si_info *sii = (struct si_info *)sih;
u32 addr = sii->coresba[coreidx];
u32 wrap = sii->wrapba[coreidx];

Expand Down Expand Up @@ -706,7 +707,7 @@ u32 ai_addrspace(struct si_pub *sih, uint asidx)
struct si_info *sii;
uint cidx;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
cidx = sii->curidx;

if (asidx == 0)
Expand All @@ -726,7 +727,7 @@ u32 ai_addrspacesize(struct si_pub *sih, uint asidx)
struct si_info *sii;
uint cidx;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
cidx = sii->curidx;

if (asidx == 0)
Expand All @@ -745,7 +746,7 @@ uint ai_flag(struct si_pub *sih)
struct si_info *sii;
struct aidmp *ai;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
ai = sii->curwrap;

return R_REG(&ai->oobselouta30) & 0x1f;
Expand All @@ -760,7 +761,7 @@ uint ai_corevendor(struct si_pub *sih)
struct si_info *sii;
u32 cia;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
cia = sii->cia[sii->curidx];
return (cia & CIA_MFG_MASK) >> CIA_MFG_SHIFT;
}
Expand All @@ -770,7 +771,7 @@ uint ai_corerev(struct si_pub *sih)
struct si_info *sii;
u32 cib;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
cib = sii->cib[sii->curidx];
return (cib & CIB_REV_MASK) >> CIB_REV_SHIFT;
}
Expand All @@ -780,7 +781,7 @@ bool ai_iscoreup(struct si_pub *sih)
struct si_info *sii;
struct aidmp *ai;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
ai = sii->curwrap;

return (((R_REG(&ai->ioctrl) & (SICF_FGC | SICF_CLOCK_EN)) ==
Expand All @@ -794,7 +795,7 @@ void ai_core_cflags_wo(struct si_pub *sih, u32 mask, u32 val)
struct aidmp *ai;
u32 w;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

ai = sii->curwrap;

Expand All @@ -810,7 +811,7 @@ u32 ai_core_cflags(struct si_pub *sih, u32 mask, u32 val)
struct aidmp *ai;
u32 w;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
ai = sii->curwrap;

if (mask || val) {
Expand Down Expand Up @@ -849,7 +850,7 @@ u32 ai_core_sflags(struct si_pub *sih, u32 mask, u32 val)
struct aidmp *ai;
u32 w;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
ai = sii->curwrap;

if (mask || val) {
Expand Down Expand Up @@ -1184,7 +1185,7 @@ void ai_detach(struct si_pub *sih)
struct si_pub *si_local = NULL;
memcpy(&si_local, &sih, sizeof(struct si_pub **));

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

if (sii == NULL)
return;
Expand All @@ -1205,7 +1206,7 @@ ai_register_intr_callback(struct si_pub *sih, void *intrsoff_fn,
{
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
sii->intr_arg = intr_arg;
sii->intrsoff_fn = (u32 (*)(void *)) intrsoff_fn;
sii->intrsrestore_fn = (void (*) (void *, u32)) intrsrestore_fn;
Expand All @@ -1220,23 +1221,23 @@ void ai_deregister_intr_callback(struct si_pub *sih)
{
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
sii->intrsoff_fn = NULL;
}

uint ai_coreid(struct si_pub *sih)
{
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
return sii->coreid[sii->curidx];
}

uint ai_coreidx(struct si_pub *sih)
{
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
return sii->curidx;
}

Expand All @@ -1252,7 +1253,7 @@ uint ai_findcoreidx(struct si_pub *sih, uint coreid, uint coreunit)
uint found;
uint i;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

found = 0;

Expand Down Expand Up @@ -1290,7 +1291,7 @@ void *ai_switch_core(struct si_pub *sih, uint coreid, uint *origidx,
void *cc;
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

if (SI_FAST(sii)) {
/* Overloading the origidx variable to remember the coreid,
Expand All @@ -1314,7 +1315,7 @@ void ai_restore_core(struct si_pub *sih, uint coreid, uint intr_val)
{
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
if (SI_FAST(sii)
&& ((coreid == CC_CORE_ID) || (coreid == sih->buscoretype)))
return;
Expand All @@ -1325,7 +1326,7 @@ void ai_restore_core(struct si_pub *sih, uint coreid, uint intr_val)

void ai_write_wrapperreg(struct si_pub *sih, u32 offset, u32 val)
{
struct si_info *sii = SI_INFO(sih);
struct si_info *sii = (struct si_info *)sih;
u32 *w = (u32 *) sii->curwrap;
W_REG(w + (offset / 4), val);
return;
Expand All @@ -1351,7 +1352,7 @@ uint ai_corereg(struct si_pub *sih, uint coreidx, uint regoff, uint mask,
bool fast = false;
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

if (coreidx >= SI_MAXCORES)
return 0;
Expand Down Expand Up @@ -1418,7 +1419,7 @@ void ai_core_disable(struct si_pub *sih, u32 bits)
u32 dummy;
struct aidmp *ai;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

ai = sii->curwrap;

Expand All @@ -1445,7 +1446,7 @@ void ai_core_reset(struct si_pub *sih, u32 bits, u32 resetbits)
struct aidmp *ai;
u32 dummy;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
ai = sii->curwrap;

/*
Expand Down Expand Up @@ -1564,7 +1565,7 @@ void ai_clkctl_init(struct si_pub *sih)
if (!CCCTL_ENAB(sih))
return;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
fast = SI_FAST(sii);
if (!fast) {
origidx = sii->curidx;
Expand Down Expand Up @@ -1602,7 +1603,7 @@ u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih)
uint intr_val = 0;
bool fast;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
if (PMUCTL_ENAB(sih)) {
INTR_OFF(sii, intr_val);
fpdelay = si_pmu_fast_pwrup_delay(sih);
Expand Down Expand Up @@ -1645,7 +1646,7 @@ int ai_clkctl_xtal(struct si_pub *sih, uint what, bool on)
struct si_info *sii;
u32 in, out, outen;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

/* pcie core doesn't have any mapping to control the xtal pu */
if (PCIE(sii))
Expand Down Expand Up @@ -1800,7 +1801,7 @@ bool ai_clkctl_cc(struct si_pub *sih, uint mode)
{
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

/* chipcommon cores prior to rev6 don't support dynamic clock control */
if (sih->ccrev < 6)
Expand All @@ -1821,8 +1822,9 @@ int ai_devpath(struct si_pub *sih, char *path, int size)
return -1;

slen = snprintf(path, (size_t) size, "pci/%u/%u/",
(((SI_INFO(sih))->pbus))->bus->number,
PCI_SLOT(((struct pci_dev *)((SI_INFO(sih))->pbus))->devfn));
((struct si_info *)sih)->pbus->bus->number,
PCI_SLOT(((struct pci_dev *)
(((struct si_info *)(sih))->pbus))->devfn));

if (slen < 0 || slen >= size) {
path[0] = '\0';
Expand Down Expand Up @@ -1886,7 +1888,7 @@ bool ai_pci_war16165(struct si_pub *sih)
{
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

return PCI(sii) && (sih->buscorerev <= 10);
}
Expand All @@ -1895,7 +1897,7 @@ void ai_pci_up(struct si_pub *sih)
{
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

if (PCI_FORCEHT(sii))
_ai_clkctl_cc(sii, CLK_FAST);
Expand All @@ -1910,7 +1912,7 @@ void ai_pci_sleep(struct si_pub *sih)
{
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

pcicore_sleep(sii->pch);
}
Expand All @@ -1920,7 +1922,7 @@ void ai_pci_down(struct si_pub *sih)
{
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

/* release FORCEHT since chip is going to "down" state */
if (PCI_FORCEHT(sii))
Expand All @@ -1940,7 +1942,7 @@ void ai_pci_setup(struct si_pub *sih, uint coremask)
u32 siflag = 0, w;
uint idx = 0;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

if (PCI(sii)) {
/* get current core index */
Expand Down Expand Up @@ -1983,7 +1985,7 @@ int ai_pci_fixcfg(struct si_pub *sih)
{
uint origidx;
void *regs = NULL;
struct si_info *sii = SI_INFO(sih);
struct si_info *sii = (struct si_info *)sih;

/* Fixup PI in SROM shadow area to enable the correct PCI core access */
/* save the current index */
Expand Down Expand Up @@ -2019,7 +2021,7 @@ void ai_chipcontrl_epa4331(struct si_pub *sih, bool on)
uint origidx;
u32 val;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
origidx = ai_coreidx(sih);

cc = (struct chipcregs *) ai_setcore(sih, CC_CORE_ID, 0);
Expand Down Expand Up @@ -2051,7 +2053,7 @@ void ai_epa_4313war(struct si_pub *sih)
struct chipcregs *cc;
uint origidx;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
origidx = ai_coreidx(sih);

cc = ai_setcore(sih, CC_CORE_ID, 0);
Expand All @@ -2069,7 +2071,7 @@ bool ai_deviceremoved(struct si_pub *sih)
u32 w;
struct si_info *sii;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;

pci_read_config_dword(sii->pbus, PCI_VENDOR_ID, &w);
if ((w & 0xFFFF) != PCI_VENDOR_ID_BROADCOM)
Expand All @@ -2089,7 +2091,7 @@ bool ai_is_sprom_available(struct si_pub *sih)
if ((sih->cccaps & CC_CAP_SROM) == 0)
return false;

sii = SI_INFO(sih);
sii = (struct si_info *)sih;
origidx = sii->curidx;
cc = ai_setcoreidx(sih, SI_CC_IDX);
sromctrl = R_REG(&cc->sromcontrol);
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/staging/brcm80211/brcmsmac/aiutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,6 @@
#define BCM47162_CHIP_ID 47162 /* 47162 chipcommon chipid */
#define BCM4748_CHIP_ID 0x4748 /* 4716 chipcommon chipid (OTP, RBBU) */


#define SI_INFO(sih) ((struct si_info *)sih)

#define GOODCOREADDR(x, b) \
(((x) >= (b)) && ((x) < ((b) + SI_MAXCORES * SI_CORE_SIZE)) && \
IS_ALIGNED((x), SI_CORE_SIZE))
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/brcm80211/brcmsmac/nicpci.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ void pcicore_down(struct pcicore_info *pi, int state)
/* precondition: current core is sii->buscoretype */
static void pcicore_fixcfg(struct pcicore_info *pi, u16 *reg16)
{
struct si_info *sii = SI_INFO(pi->sih);
struct si_info *sii = (struct si_info *)(pi->sih);
u16 val16;
uint pciidx;

Expand Down Expand Up @@ -814,7 +814,7 @@ void pcicore_pci_setup(struct pcicore_info *pi, struct sbpciregs *pciregs)

OR_REG(&pciregs->sbtopci2, SBTOPCI_PREF | SBTOPCI_BURST);

if (SI_INFO(pi->sih)->pub.buscorerev >= 11) {
if (((struct si_info *)(pi->sih))->pub.buscorerev >= 11) {
OR_REG(&pciregs->sbtopci2, SBTOPCI_RC_READMULTI);
w = R_REG(&pciregs->clkrun);
W_REG(&pciregs->clkrun, w | PCI_CLKRUN_DSBL);
Expand Down

0 comments on commit 67b289e

Please sign in to comment.