Skip to content

Commit

Permalink
staging: brcm80211: remove usage of struct osl_info from util sources
Browse files Browse the repository at this point in the history
Most of the util source files do not need the osl_info anymore due
to previous patches so usage of it has been removed.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Brett Rudley <brudley@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Arend van Spriel authored and Greg Kroah-Hartman committed Mar 1, 2011
1 parent ff31c54 commit 26bcc18
Show file tree
Hide file tree
Showing 16 changed files with 207 additions and 257 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2283,7 +2283,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_SVAL(IOV_SDIOD_DRIVE):
dhd_sdiod_drive_strength = int_val;
si_sdiod_drive_strength_init(bus->sih, bus->dhd->osh,
si_sdiod_drive_strength_init(bus->sih,
dhd_sdiod_drive_strength);
break;

Expand Down Expand Up @@ -3329,7 +3329,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
F2SYNC, bus->dataptr,
dlen, NULL, NULL, NULL);
sublen =
(u16) pktfrombuf(osh, pfirst, 0, dlen,
(u16) pktfrombuf(pfirst, 0, dlen,
bus->dataptr);
if (sublen != dlen) {
DHD_ERROR(("%s: FAILED TO COPY, dlen %d sublen %d\n",
Expand Down Expand Up @@ -5317,7 +5317,7 @@ dhdsdio_probe_attach(struct dhd_bus *bus, struct osl_info *osh, void *sdh,
#endif /* DHD_DEBUG */

/* si_attach() will provide an SI handle and scan the backplane */
bus->sih = si_attach((uint) devid, osh, regsva, DHD_BUS, sdh,
bus->sih = si_attach((uint) devid, regsva, DHD_BUS, sdh,
&bus->vars, &bus->varsz);
if (!(bus->sih)) {
DHD_ERROR(("%s: si_attach failed!\n", __func__));
Expand All @@ -5332,7 +5332,7 @@ dhdsdio_probe_attach(struct dhd_bus *bus, struct osl_info *osh, void *sdh,
goto fail;
}

si_sdiod_drive_strength_init(bus->sih, osh, dhd_sdiod_drive_strength);
si_sdiod_drive_strength_init(bus->sih, dhd_sdiod_drive_strength);

/* Get info on the ARM and SOCRAM cores... */
if (!DHD_NOPMU(bus)) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c
Original file line number Diff line number Diff line change
Expand Up @@ -19082,10 +19082,10 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,

if ((pi->sh->chip == BCM4716_CHIP_ID) ||
(pi->sh->chip == BCM47162_CHIP_ID)) {
si_pmu_spuravoid(pi->sh->sih, pi->sh->osh, spuravoid);
si_pmu_spuravoid(pi->sh->sih, spuravoid);
} else {
wlapi_bmac_core_phypll_ctl(pi->sh->physhim, false);
si_pmu_spuravoid(pi->sh->sih, pi->sh->osh, spuravoid);
si_pmu_spuravoid(pi->sh->sih, spuravoid);
wlapi_bmac_core_phypll_ctl(pi->sh->physhim, true);
}

Expand Down
4 changes: 1 addition & 3 deletions drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ wlc_sendampdu(struct ampdu_info *ampdu, struct wlc_txq_info *qi,
struct sk_buff **pdu, int prec)
{
struct wlc_info *wlc;
struct osl_info *osh;
struct sk_buff *p, *pkt[AMPDU_MAX_MPDU];
u8 tid, ndelim;
int err = 0;
Expand Down Expand Up @@ -526,7 +525,6 @@ wlc_sendampdu(struct ampdu_info *ampdu, struct wlc_txq_info *qi,
u16 qlen;

wlc = ampdu->wlc;
osh = wlc->osh;
p = *pdu;

ASSERT(p);
Expand Down Expand Up @@ -1070,7 +1068,7 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
wlc->pub->unit, txs->phyerr);

if (WL_ERROR_ON()) {
prpkt("txpkt (AMPDU)", wlc->osh, p);
prpkt("txpkt (AMPDU)", p);
wlc_print_txdesc((d11txh_t *) p->data);
}
wlc_print_txstatus(txs);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/brcm80211/brcmsmac/wlc_bmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
* Also initialize software state that depends on the particular hardware
* we are running.
*/
wlc_hw->sih = si_attach((uint) device, osh, regsva, bustype, btparam,
wlc_hw->sih = si_attach((uint) device, regsva, bustype, btparam,
&wlc_hw->vars, &wlc_hw->vars_size);
if (wlc_hw->sih == NULL) {
WL_ERROR("wl%d: wlc_bmac_attach: si_attach failed\n", unit);
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/brcm80211/include/bcmsrom.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

/* Prototypes */
extern int srom_var_init(si_t *sih, uint bus, void *curmap,
struct osl_info *osh, char **vars, uint *count);
char **vars, uint *count);

extern int srom_read(si_t *sih, uint bus, void *curmap, struct osl_info *osh,
extern int srom_read(si_t *sih, uint bus, void *curmap,
uint byteoff, uint nbytes, u16 *buf, bool check_crc);

/* parse standard PCMCIA cis, normally used by SB/PCMCIA/SDIO/SPI/OTP
* and extract from it into name=value pairs
*/
extern int srom_parsecis(struct osl_info *osh, u8 **pcis, uint ciscnt,
extern int srom_parsecis(u8 **pcis, uint ciscnt,
char **vars, uint *count);
#endif /* _bcmsrom_h_ */
7 changes: 3 additions & 4 deletions drivers/staging/brcm80211/include/bcmutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);

/* externs */
/* packet */
extern uint pktfrombuf(struct osl_info *osh, struct sk_buff *p,
extern uint pktfrombuf(struct sk_buff *p,
uint offset, int len, unsigned char *buf);
extern uint pkttotlen(struct sk_buff *p);

Expand All @@ -155,10 +155,9 @@ extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
extern char *getvar(char *vars, const char *name);
extern int getintvar(char *vars, const char *name);
#ifdef BCMDBG
extern void prpkt(const char *msg, struct osl_info *osh,
struct sk_buff *p0);
extern void prpkt(const char *msg, struct sk_buff *p0);
#else
#define prpkt(a, b, c)
#define prpkt(a, b)
#endif /* BCMDBG */

#define bcm_perf_enable()
Expand Down
47 changes: 22 additions & 25 deletions drivers/staging/brcm80211/include/hndpmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,44 +28,41 @@
#define SET_LDO_VOLTAGE_LNLDO1 9
#define SET_LDO_VOLTAGE_LNLDO2_SEL 10

extern void si_pmu_init(si_t *sih, struct osl_info *osh);
extern void si_pmu_chip_init(si_t *sih, struct osl_info *osh);
extern void si_pmu_pll_init(si_t *sih, struct osl_info *osh, u32 xtalfreq);
extern void si_pmu_res_init(si_t *sih, struct osl_info *osh);
extern void si_pmu_swreg_init(si_t *sih, struct osl_info *osh);
extern void si_pmu_init(si_t *sih);
extern void si_pmu_chip_init(si_t *sih);
extern void si_pmu_pll_init(si_t *sih, u32 xtalfreq);
extern void si_pmu_res_init(si_t *sih);
extern void si_pmu_swreg_init(si_t *sih);

extern u32 si_pmu_force_ilp(si_t *sih, struct osl_info *osh, bool force);
extern u32 si_pmu_force_ilp(si_t *sih, bool force);

extern u32 si_pmu_si_clock(si_t *sih, struct osl_info *osh);
extern u32 si_pmu_cpu_clock(si_t *sih, struct osl_info *osh);
extern u32 si_pmu_mem_clock(si_t *sih, struct osl_info *osh);
extern u32 si_pmu_alp_clock(si_t *sih, struct osl_info *osh);
extern u32 si_pmu_ilp_clock(si_t *sih, struct osl_info *osh);
extern u32 si_pmu_si_clock(si_t *sih);
extern u32 si_pmu_cpu_clock(si_t *sih);
extern u32 si_pmu_mem_clock(si_t *sih);
extern u32 si_pmu_alp_clock(si_t *sih);
extern u32 si_pmu_ilp_clock(si_t *sih);

extern void si_pmu_set_switcher_voltage(si_t *sih, struct osl_info *osh,
extern void si_pmu_set_switcher_voltage(si_t *sih,
u8 bb_voltage, u8 rf_voltage);
extern void si_pmu_set_ldo_voltage(si_t *sih, struct osl_info *osh, u8 ldo,
u8 voltage);
extern u16 si_pmu_fast_pwrup_delay(si_t *sih, struct osl_info *osh);
extern void si_pmu_rcal(si_t *sih, struct osl_info *osh);
extern void si_pmu_set_ldo_voltage(si_t *sih, u8 ldo, u8 voltage);
extern u16 si_pmu_fast_pwrup_delay(si_t *sih);
extern void si_pmu_rcal(si_t *sih);
extern void si_pmu_pllupd(si_t *sih);
extern void si_pmu_spuravoid(si_t *sih, struct osl_info *osh, u8 spuravoid);
extern void si_pmu_spuravoid(si_t *sih, u8 spuravoid);

extern bool si_pmu_is_otp_powered(si_t *sih, struct osl_info *osh);
extern u32 si_pmu_measure_alpclk(si_t *sih, struct osl_info *osh);
extern bool si_pmu_is_otp_powered(si_t *sih);
extern u32 si_pmu_measure_alpclk(si_t *sih);

extern u32 si_pmu_chipcontrol(si_t *sih, uint reg, u32 mask, u32 val);
extern u32 si_pmu_regcontrol(si_t *sih, uint reg, u32 mask, u32 val);
extern u32 si_pmu_pllcontrol(si_t *sih, uint reg, u32 mask, u32 val);
extern void si_pmu_pllupd(si_t *sih);
extern void si_pmu_sprom_enable(si_t *sih, struct osl_info *osh, bool enable);
extern void si_pmu_sprom_enable(si_t *sih, bool enable);

extern void si_pmu_radio_enable(si_t *sih, bool enable);
extern u32 si_pmu_waitforclk_on_backplane(si_t *sih, struct osl_info *osh,
u32 clk, u32 delay);
extern u32 si_pmu_waitforclk_on_backplane(si_t *sih, u32 clk, u32 delay);

extern void si_pmu_otp_power(si_t *sih, struct osl_info *osh, bool on);
extern void si_sdiod_drive_strength_init(si_t *sih, struct osl_info *osh,
u32 drivestrength);
extern void si_pmu_otp_power(si_t *sih, bool on);
extern void si_sdiod_drive_strength_init(si_t *sih, u32 drivestrength);

#endif /* _hndpmu_h_ */
6 changes: 3 additions & 3 deletions drivers/staging/brcm80211/include/nicpci.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ struct sbpcieregs;

extern u8 pcicore_find_pci_capability(void *dev, u8 req_cap_id,
unsigned char *buf, u32 *buflen);
extern uint pcie_readreg(struct osl_info *osh, struct sbpcieregs *pcieregs,
extern uint pcie_readreg(struct sbpcieregs *pcieregs,
uint addrtype, uint offset);
extern uint pcie_writereg(struct osl_info *osh, struct sbpcieregs *pcieregs,
extern uint pcie_writereg(struct sbpcieregs *pcieregs,
uint addrtype, uint offset, uint val);

extern u8 pcie_clkreq(void *pch, u32 mask, u32 val);
extern u32 pcie_lcreg(void *pch, u32 mask, u32 val);

extern void *pcicore_init(si_t *sih, struct osl_info *osh, void *regs);
extern void *pcicore_init(si_t *sih, void *pdev, void *regs);
extern void pcicore_deinit(void *pch);
extern void pcicore_attach(void *pch, char *pvars, int state);
extern void pcicore_hwup(void *pch);
Expand Down
6 changes: 2 additions & 4 deletions drivers/staging/brcm80211/include/siutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ typedef void (*gpio_handler_t) (u32 stat, void *arg);
#define GPIO_CTRL_EPA_EN_MASK 0x40

/* === exported functions === */
extern si_t *si_attach(uint pcidev, struct osl_info *osh, void *regs,
uint bustype, void *sdh, char **vars, uint *varsz);
extern si_t *si_attach(uint pcidev, void *regs, uint bustype,
void *sdh, char **vars, uint *varsz);

extern void si_detach(si_t *sih);
extern bool si_pci_war16165(si_t *sih);
Expand All @@ -128,7 +128,6 @@ extern uint si_coreid(si_t *sih);
extern uint si_flag(si_t *sih);
extern uint si_coreidx(si_t *sih);
extern uint si_corerev(si_t *sih);
struct osl_info *si_osh(si_t *sih);
extern uint si_corereg(si_t *sih, uint coreidx, uint regoff, uint mask,
uint val);
extern void si_write_wrapperreg(si_t *sih, u32 offset, u32 val);
Expand Down Expand Up @@ -213,7 +212,6 @@ typedef struct gpioh_item {
/* misc si info needed by some of the routines */
typedef struct si_info {
struct si_pub pub; /* back plane public state (must be first) */
struct osl_info *osh; /* osl os handle */
void *pbus; /* handle to bus (pci/sdio/..) */
uint dev_coreid; /* the core provides driver functions */
void *intr_arg; /* interrupt callback function arg */
Expand Down
15 changes: 2 additions & 13 deletions drivers/staging/brcm80211/util/bcmotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ typedef struct {
uint ccrev; /* chipc revision */
otp_fn_t *fn; /* OTP functions */
si_t *sih; /* Saved sb handle */
struct osl_info *osh;

#ifdef BCMIPXOTP
/* IPX OTP section */
Expand Down Expand Up @@ -569,44 +568,37 @@ static int hndotp_size(void *oh)

static u16 hndotp_otpr(void *oh, chipcregs_t *cc, uint wn)
{
#ifdef BCMDBG
otpinfo_t *oi = (otpinfo_t *) oh;
struct osl_info *osh;
#endif
volatile u16 *ptr;

ASSERT(wn < ((oi->size / 2) + OTP_RC_LIM_OFF));
ASSERT(cc != NULL);

osh = si_osh(oi->sih);

ptr = (volatile u16 *)((volatile char *)cc + CC_SROM_OTP);
return R_REG(&ptr[wn]);
}

static u16 hndotp_otproff(void *oh, chipcregs_t *cc, int woff)
{
otpinfo_t *oi = (otpinfo_t *) oh;
struct osl_info *osh;
volatile u16 *ptr;

ASSERT(woff >= (-((int)oi->size / 2)));
ASSERT(woff < OTP_LIM_OFF);
ASSERT(cc != NULL);

osh = si_osh(oi->sih);

ptr = (volatile u16 *)((volatile char *)cc + CC_SROM_OTP);

return R_REG(&ptr[(oi->size / 2) + woff]);
}

static u16 hndotp_read_bit(void *oh, chipcregs_t *cc, uint idx)
{
otpinfo_t *oi = (otpinfo_t *) oh;
uint k, row, col;
u32 otpp, st;
struct osl_info *osh;

osh = si_osh(oi->sih);
row = idx / 65;
col = idx % 65;

Expand Down Expand Up @@ -637,12 +629,10 @@ static void *hndotp_init(si_t *sih)
otpinfo_t *oi;
u32 cap = 0, clkdiv, otpdiv = 0;
void *ret = NULL;
struct osl_info *osh;

oi = &otpinfo;

idx = si_coreidx(sih);
osh = si_osh(oi->sih);

/* Check for otp */
cc = si_setcoreidx(sih, SI_CC_IDX);
Expand Down Expand Up @@ -920,7 +910,6 @@ void *otp_init(si_t *sih)
}

oi->sih = sih;
oi->osh = si_osh(oi->sih);

ret = (oi->fn->init) (sih);

Expand Down
Loading

0 comments on commit 26bcc18

Please sign in to comment.