Skip to content

Commit

Permalink
brcm80211: smac: move fields from struct si_pub to struct si_info
Browse files Browse the repository at this point in the history
The structure si_pub contained couple of fields that were only
used internally in aiutils.c. These have been moved to the
si_info structure.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Arend van Spriel authored and John W. Linville committed Dec 13, 2011
1 parent c9eb65a commit 2e397c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
24 changes: 13 additions & 11 deletions drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ ai_buscore_setup(struct si_info *sii, u32 savewin, uint *origidx)

/* get chipcommon chipstatus */
if (sii->pub.ccrev >= 11)
sii->pub.chipst = R_REG(&cc->chipstatus);
sii->chipst = R_REG(&cc->chipstatus);

/* get chipcommon capabilites */
sii->pub.cccaps = R_REG(&cc->capabilities);
Expand All @@ -942,7 +942,7 @@ ai_buscore_setup(struct si_info *sii, u32 savewin, uint *origidx)
/* figure out bus/orignal core idx */
sii->pub.buscoretype = NODEV_CORE_ID;
sii->pub.buscorerev = NOREV;
sii->pub.buscoreidx = BADIDX;
sii->buscoreidx = BADIDX;

pci = pcie = false;
pcirev = pcierev = NOREV;
Expand Down Expand Up @@ -980,11 +980,11 @@ ai_buscore_setup(struct si_info *sii, u32 savewin, uint *origidx)
if (pci) {
sii->pub.buscoretype = PCI_CORE_ID;
sii->pub.buscorerev = pcirev;
sii->pub.buscoreidx = pciidx;
sii->buscoreidx = pciidx;
} else if (pcie) {
sii->pub.buscoretype = PCIE_CORE_ID;
sii->pub.buscorerev = pcierev;
sii->pub.buscoreidx = pcieidx;
sii->buscoreidx = pcieidx;
}

/* fixup necessary chip/core configurations */
Expand Down Expand Up @@ -1034,7 +1034,7 @@ static struct si_info *ai_doattach(struct si_info *sii,

savewin = 0;

sih->buscoreidx = BADIDX;
sii->buscoreidx = BADIDX;

sii->curmap = regs;
sii->pbus = pbus;
Expand Down Expand Up @@ -1372,7 +1372,7 @@ uint ai_corereg(struct si_pub *sih, uint coreidx, uint regoff, uint mask,
fast = true;
r = (u32 __iomem *)((__iomem char *)sii->curmap +
PCI_16KB0_CCREGS_OFFSET + regoff);
} else if (sii->pub.buscoreidx == coreidx) {
} else if (sii->buscoreidx == coreidx) {
/*
* pci registers are at either in the last 2KB of
* an 8KB window or, in pcie and pci rev 13 at 8KB
Expand Down Expand Up @@ -1904,7 +1904,7 @@ void ai_pci_setup(struct si_pub *sih, uint coremask)
siflag = ai_flag(sih);

/* switch over to pci core */
regs = ai_setcoreidx(sih, sii->pub.buscoreidx);
regs = ai_setcoreidx(sih, sii->buscoreidx);
}

/*
Expand Down Expand Up @@ -2035,16 +2035,16 @@ bool ai_deviceremoved(struct si_pub *sih)

bool ai_is_sprom_available(struct si_pub *sih)
{
struct si_info *sii = (struct si_info *)sih;

if (sih->ccrev >= 31) {
struct si_info *sii;
uint origidx;
struct chipcregs __iomem *cc;
u32 sromctrl;

if ((sih->cccaps & CC_CAP_SROM) == 0)
return false;

sii = (struct si_info *)sih;
origidx = sii->curidx;
cc = ai_setcoreidx(sih, SI_CC_IDX);
sromctrl = R_REG(&cc->sromcontrol);
Expand All @@ -2054,17 +2054,19 @@ bool ai_is_sprom_available(struct si_pub *sih)

switch (sih->chip) {
case BCM4313_CHIP_ID:
return (sih->chipst & CST4313_SPROM_PRESENT) != 0;
return (sii->chipst & CST4313_SPROM_PRESENT) != 0;
default:
return true;
}
}

bool ai_is_otp_disabled(struct si_pub *sih)
{
struct si_info *sii = (struct si_info *)sih;

switch (sih->chip) {
case BCM4313_CHIP_ID:
return (sih->chipst & CST4313_OTP_PRESENT) == 0;
return (sii->chipst & CST4313_OTP_PRESENT) == 0;
/* These chips always have their OTP on */
case BCM43224_CHIP_ID:
case BCM43225_CHIP_ID:
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@
struct si_pub {
uint buscoretype; /* PCI_CORE_ID, PCIE_CORE_ID, PCMCIA_CORE_ID */
uint buscorerev; /* buscore rev */
uint buscoreidx; /* buscore index */
int ccrev; /* chip common core rev */
u32 cccaps; /* chip common capabilities */
int pmurev; /* pmu core rev */
Expand All @@ -156,7 +155,6 @@ struct si_pub {
uint chip; /* chip number */
uint chiprev; /* chip revision */
uint chippkg; /* chip package option */
u32 chipst; /* chip status */
};

struct pci_dev;
Expand Down Expand Up @@ -188,7 +186,9 @@ struct si_info {
void __iomem *curmap; /* current regs va */
void __iomem *regs[SI_MAXCORES]; /* other regs va */

u32 chipst; /* chip status */
uint curidx; /* current core index */
uint buscoreidx; /* buscore index */
uint numcores; /* # discovered cores */
uint coreid[SI_MAXCORES]; /* id of each core */
u32 coresba[SI_MAXCORES]; /* backplane address of each core */
Expand Down

0 comments on commit 2e397c3

Please sign in to comment.