diff options
author | Arend van Spriel <arend@broadcom.com> | 2011-12-13 03:15:10 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-14 00:48:30 +0400 |
commit | 99559f136559e6822f20fcf1b63e6910df126941 (patch) | |
tree | 1686bf90851e763a7d27df41a919f4c0d581c6df /drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | |
parent | 3b758a68402fc5b1c2dbc246595dbdc062bf0da9 (diff) | |
download | linux-99559f136559e6822f20fcf1b63e6910df126941.tar.xz |
brcm80211: smac: cleanup si_info structure definition
Number of fields are no longer needed as the BCMA provides it
or makes them redundant. These have been removed.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@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>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac/aiutils.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | 51 |
1 files changed, 11 insertions, 40 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c index f78350a668df..34a5e022509e 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c @@ -454,29 +454,6 @@ struct aidmp { u32 componentid3; /* 0xffc */ }; -/* parse the enumeration rom to identify all cores */ -static void ai_scan(struct si_pub *sih, struct bcma_bus *bus) -{ - struct si_info *sii = (struct si_info *)sih; - struct bcma_device *core; - uint idx; - - list_for_each_entry(core, &bus->cores, list) { - idx = core->core_index; - sii->cia[idx] = core->id.manuf << CIA_MFG_SHIFT; - sii->cia[idx] |= core->id.id << CIA_CID_SHIFT; - sii->cia[idx] |= core->id.class << CIA_CCL_SHIFT; - sii->cib[idx] = core->id.rev << CIB_REV_SHIFT; - sii->coreid[idx] = core->id.id; - sii->coresba[idx] = core->addr; - sii->coresba_size[idx] = 0x1000; - sii->coresba2[idx] = 0; - sii->coresba2_size[idx] = 0; - sii->wrapba[idx] = core->wrap; - sii->numcores++; - } -} - /* return true if PCIE capability exists in the pci config space */ static bool ai_ispcie(struct si_info *sii) { @@ -502,10 +479,16 @@ static bool ai_buscore_prep(struct si_info *sii) static bool ai_buscore_setup(struct si_info *sii, struct bcma_device *cc) { + struct bcma_device *core; bool pci, pcie; uint i; uint pciidx, pcieidx, pcirev, pcierev; + + /* no cores found, bail out */ + if (cc->bus->nr_cores == 0) + return false; + /* get chipcommon rev */ sii->pub.ccrev = cc->id.rev; @@ -532,11 +515,11 @@ ai_buscore_setup(struct si_info *sii, struct bcma_device *cc) pcirev = pcierev = NOREV; pciidx = pcieidx = BADIDX; - for (i = 0; i < sii->numcores; i++) { + list_for_each_entry(core, &cc->bus->cores, list) { uint cid, crev; - cid = sii->coreid[i]; - crev = (sii->cib[i] & CIB_REV_MASK) >> CIB_REV_SHIFT; + cid = core->id.id; + crev = core->id.rev; if (cid == PCI_CORE_ID) { pciidx = i; @@ -596,7 +579,6 @@ static __used void ai_nvram_process(struct si_info *sii) static struct si_info *ai_doattach(struct si_info *sii, struct bcma_bus *pbus) { - void __iomem *regs = pbus->mmio; struct si_pub *sih = &sii->pub; u32 w, savewin; struct bcma_device *cc; @@ -609,8 +591,6 @@ static struct si_info *ai_doattach(struct si_info *sii, sii->icbus = pbus; sii->buscoreidx = BADIDX; sii->pcibus = pbus->host_pci; - sii->curmap = regs; - sii->curwrap = sii->curmap + SI_CORE_SIZE; /* switch to Chipcommon core */ cc = pbus->drv_cc.core; @@ -634,19 +614,10 @@ static struct si_info *ai_doattach(struct si_info *sii, sih->chippkg = (w & CID_PKG_MASK) >> CID_PKG_SHIFT; /* scan for cores */ - 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, pbus); - } else { - /* Found chip of unknown type */ - return NULL; - } - /* no cores found, bail out */ - if (sii->numcores == 0) + if (socitype != SOCI_AI) return NULL; - /* bus/core/clk setup */ + SI_MSG("Found chip type AI (0x%08x)\n", w); if (!ai_buscore_setup(sii, cc)) goto exit; |