aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/brcm80211/util/aiutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/brcm80211/util/aiutils.c')
-rw-r--r--drivers/staging/brcm80211/util/aiutils.c66
1 files changed, 29 insertions, 37 deletions
diff --git a/drivers/staging/brcm80211/util/aiutils.c b/drivers/staging/brcm80211/util/aiutils.c
index ddd2f9d64c20..570869032d88 100644
--- a/drivers/staging/brcm80211/util/aiutils.c
+++ b/drivers/staging/brcm80211/util/aiutils.c
@@ -18,10 +18,6 @@
#include <linux/kernel.h>
#include <linux/string.h>
#include <bcmdefs.h>
-#ifdef BRCM_FULLMAC
-#include <linux/netdevice.h>
-#endif
-#include <osl.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <bcmutils.h>
@@ -44,7 +40,7 @@ get_erom_ent(si_t *sih, u32 **eromptr, u32 mask, u32 match)
uint inv = 0, nom = 0;
while (true) {
- ent = R_REG(si_osh(sih), *eromptr);
+ ent = R_REG(*eromptr);
(*eromptr)++;
if (mask == 0)
@@ -118,7 +114,7 @@ void ai_scan(si_t *sih, void *regs, uint devid)
chipcregs_t *cc = (chipcregs_t *) regs;
u32 erombase, *eromptr, *eromlim;
- erombase = R_REG(sii->osh, &cc->eromptr);
+ erombase = R_REG(&cc->eromptr);
switch (sih->bustype) {
case SI_BUS:
@@ -130,14 +126,12 @@ void ai_scan(si_t *sih, void *regs, uint devid)
sii->curwrap = (void *)((unsigned long)regs + SI_CORE_SIZE);
/* Now point the window at the erom */
- pci_write_config_dword(sii->osh->pdev, PCI_BAR0_WIN, erombase);
+ pci_write_config_dword(sii->pbus, PCI_BAR0_WIN, erombase);
eromptr = regs;
break;
-#ifdef BCMSDIO
case SPI_BUS:
case SDIO_BUS:
-#endif /* BCMSDIO */
eromptr = (u32 *)(unsigned long)erombase;
break;
@@ -352,16 +346,14 @@ void *ai_setcoreidx(si_t *sih, uint coreidx)
case PCI_BUS:
/* point bar0 window */
- pci_write_config_dword(sii->osh->pdev, PCI_BAR0_WIN, addr);
+ pci_write_config_dword(sii->pbus, PCI_BAR0_WIN, addr);
regs = sii->curmap;
/* point bar0 2nd 4KB window */
- pci_write_config_dword(sii->osh->pdev, PCI_BAR0_WIN2, wrap);
+ pci_write_config_dword(sii->pbus, PCI_BAR0_WIN2, wrap);
break;
-#ifdef BCMSDIO
case SPI_BUS:
case SDIO_BUS:
-#endif /* BCMSDIO */
sii->curmap = regs = (void *)(unsigned long)addr;
sii->curwrap = (void *)(unsigned long)wrap;
break;
@@ -434,7 +426,7 @@ uint ai_flag(si_t *sih)
}
ai = sii->curwrap;
- return R_REG(sii->osh, &ai->oobselouta30) & 0x1f;
+ return R_REG(&ai->oobselouta30) & 0x1f;
}
void ai_setint(si_t *sih, int siflag)
@@ -445,7 +437,7 @@ void ai_write_wrap_reg(si_t *sih, u32 offset, u32 val)
{
si_info_t *sii = SI_INFO(sih);
u32 *w = (u32 *) sii->curwrap;
- W_REG(sii->osh, w + (offset / 4), val);
+ W_REG(w + (offset / 4), val);
return;
}
@@ -477,9 +469,9 @@ bool ai_iscoreup(si_t *sih)
sii = SI_INFO(sih);
ai = sii->curwrap;
- return (((R_REG(sii->osh, &ai->ioctrl) & (SICF_FGC | SICF_CLOCK_EN)) ==
+ return (((R_REG(&ai->ioctrl) & (SICF_FGC | SICF_CLOCK_EN)) ==
SICF_CLOCK_EN)
- && ((R_REG(sii->osh, &ai->resetctrl) & AIRC_RESET) == 0));
+ && ((R_REG(&ai->resetctrl) & AIRC_RESET) == 0));
}
/*
@@ -560,12 +552,12 @@ uint ai_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val)
/* mask and set */
if (mask || val) {
- w = (R_REG(sii->osh, r) & ~mask) | val;
- W_REG(sii->osh, r, w);
+ w = (R_REG(r) & ~mask) | val;
+ W_REG(r, w);
}
/* readback */
- w = R_REG(sii->osh, r);
+ w = R_REG(r);
if (!fast) {
/* restore core index */
@@ -590,14 +582,14 @@ void ai_core_disable(si_t *sih, u32 bits)
ai = sii->curwrap;
/* if core is already in reset, just return */
- if (R_REG(sii->osh, &ai->resetctrl) & AIRC_RESET)
+ if (R_REG(&ai->resetctrl) & AIRC_RESET)
return;
- W_REG(sii->osh, &ai->ioctrl, bits);
- dummy = R_REG(sii->osh, &ai->ioctrl);
+ W_REG(&ai->ioctrl, bits);
+ dummy = R_REG(&ai->ioctrl);
udelay(10);
- W_REG(sii->osh, &ai->resetctrl, AIRC_RESET);
+ W_REG(&ai->resetctrl, AIRC_RESET);
udelay(1);
}
@@ -624,13 +616,13 @@ void ai_core_reset(si_t *sih, u32 bits, u32 resetbits)
/*
* Now do the initialization sequence.
*/
- W_REG(sii->osh, &ai->ioctrl, (bits | SICF_FGC | SICF_CLOCK_EN));
- dummy = R_REG(sii->osh, &ai->ioctrl);
- W_REG(sii->osh, &ai->resetctrl, 0);
+ W_REG(&ai->ioctrl, (bits | SICF_FGC | SICF_CLOCK_EN));
+ dummy = R_REG(&ai->ioctrl);
+ W_REG(&ai->resetctrl, 0);
udelay(1);
- W_REG(sii->osh, &ai->ioctrl, (bits | SICF_CLOCK_EN));
- dummy = R_REG(sii->osh, &ai->ioctrl);
+ W_REG(&ai->ioctrl, (bits | SICF_CLOCK_EN));
+ dummy = R_REG(&ai->ioctrl);
udelay(1);
}
@@ -654,8 +646,8 @@ void ai_core_cflags_wo(si_t *sih, u32 mask, u32 val)
ASSERT((val & ~mask) == 0);
if (mask || val) {
- w = ((R_REG(sii->osh, &ai->ioctrl) & ~mask) | val);
- W_REG(sii->osh, &ai->ioctrl, w);
+ w = ((R_REG(&ai->ioctrl) & ~mask) | val);
+ W_REG(&ai->ioctrl, w);
}
}
@@ -678,11 +670,11 @@ u32 ai_core_cflags(si_t *sih, u32 mask, u32 val)
ASSERT((val & ~mask) == 0);
if (mask || val) {
- w = ((R_REG(sii->osh, &ai->ioctrl) & ~mask) | val);
- W_REG(sii->osh, &ai->ioctrl, w);
+ w = ((R_REG(&ai->ioctrl) & ~mask) | val);
+ W_REG(&ai->ioctrl, w);
}
- return R_REG(sii->osh, &ai->ioctrl);
+ return R_REG(&ai->ioctrl);
}
u32 ai_core_sflags(si_t *sih, u32 mask, u32 val)
@@ -704,10 +696,10 @@ u32 ai_core_sflags(si_t *sih, u32 mask, u32 val)
ASSERT((mask & ~SISF_CORE_BITS) == 0);
if (mask || val) {
- w = ((R_REG(sii->osh, &ai->iostatus) & ~mask) | val);
- W_REG(sii->osh, &ai->iostatus, w);
+ w = ((R_REG(&ai->iostatus) & ~mask) | val);
+ W_REG(&ai->iostatus, w);
}
- return R_REG(sii->osh, &ai->iostatus);
+ return R_REG(&ai->iostatus);
}