diff options
author | Arend van Spriel <arend@broadcom.com> | 2011-12-08 18:06:44 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-13 15:31:36 -0500 |
commit | 2e397c303807fadcf65f4e070603107453db4352 (patch) | |
tree | 500938b6ed55f1455ab9e9cdf40dd34eab73d64e | |
parent | c9eb65a4865a915e93847be19a546d47816d88e4 (diff) |
brcm80211: smac: move fields from struct si_pub to struct si_info
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>
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/aiutils.h | 4 |
2 files changed, 15 insertions, 13 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c index 66c79f1aa081..8586ab78f891 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | |||
@@ -928,7 +928,7 @@ ai_buscore_setup(struct si_info *sii, u32 savewin, uint *origidx) | |||
928 | 928 | ||
929 | /* get chipcommon chipstatus */ | 929 | /* get chipcommon chipstatus */ |
930 | if (sii->pub.ccrev >= 11) | 930 | if (sii->pub.ccrev >= 11) |
931 | sii->pub.chipst = R_REG(&cc->chipstatus); | 931 | sii->chipst = R_REG(&cc->chipstatus); |
932 | 932 | ||
933 | /* get chipcommon capabilites */ | 933 | /* get chipcommon capabilites */ |
934 | sii->pub.cccaps = R_REG(&cc->capabilities); | 934 | sii->pub.cccaps = R_REG(&cc->capabilities); |
@@ -942,7 +942,7 @@ ai_buscore_setup(struct si_info *sii, u32 savewin, uint *origidx) | |||
942 | /* figure out bus/orignal core idx */ | 942 | /* figure out bus/orignal core idx */ |
943 | sii->pub.buscoretype = NODEV_CORE_ID; | 943 | sii->pub.buscoretype = NODEV_CORE_ID; |
944 | sii->pub.buscorerev = NOREV; | 944 | sii->pub.buscorerev = NOREV; |
945 | sii->pub.buscoreidx = BADIDX; | 945 | sii->buscoreidx = BADIDX; |
946 | 946 | ||
947 | pci = pcie = false; | 947 | pci = pcie = false; |
948 | pcirev = pcierev = NOREV; | 948 | pcirev = pcierev = NOREV; |
@@ -980,11 +980,11 @@ ai_buscore_setup(struct si_info *sii, u32 savewin, uint *origidx) | |||
980 | if (pci) { | 980 | if (pci) { |
981 | sii->pub.buscoretype = PCI_CORE_ID; | 981 | sii->pub.buscoretype = PCI_CORE_ID; |
982 | sii->pub.buscorerev = pcirev; | 982 | sii->pub.buscorerev = pcirev; |
983 | sii->pub.buscoreidx = pciidx; | 983 | sii->buscoreidx = pciidx; |
984 | } else if (pcie) { | 984 | } else if (pcie) { |
985 | sii->pub.buscoretype = PCIE_CORE_ID; | 985 | sii->pub.buscoretype = PCIE_CORE_ID; |
986 | sii->pub.buscorerev = pcierev; | 986 | sii->pub.buscorerev = pcierev; |
987 | sii->pub.buscoreidx = pcieidx; | 987 | sii->buscoreidx = pcieidx; |
988 | } | 988 | } |
989 | 989 | ||
990 | /* fixup necessary chip/core configurations */ | 990 | /* fixup necessary chip/core configurations */ |
@@ -1034,7 +1034,7 @@ static struct si_info *ai_doattach(struct si_info *sii, | |||
1034 | 1034 | ||
1035 | savewin = 0; | 1035 | savewin = 0; |
1036 | 1036 | ||
1037 | sih->buscoreidx = BADIDX; | 1037 | sii->buscoreidx = BADIDX; |
1038 | 1038 | ||
1039 | sii->curmap = regs; | 1039 | sii->curmap = regs; |
1040 | sii->pbus = pbus; | 1040 | sii->pbus = pbus; |
@@ -1372,7 +1372,7 @@ uint ai_corereg(struct si_pub *sih, uint coreidx, uint regoff, uint mask, | |||
1372 | fast = true; | 1372 | fast = true; |
1373 | r = (u32 __iomem *)((__iomem char *)sii->curmap + | 1373 | r = (u32 __iomem *)((__iomem char *)sii->curmap + |
1374 | PCI_16KB0_CCREGS_OFFSET + regoff); | 1374 | PCI_16KB0_CCREGS_OFFSET + regoff); |
1375 | } else if (sii->pub.buscoreidx == coreidx) { | 1375 | } else if (sii->buscoreidx == coreidx) { |
1376 | /* | 1376 | /* |
1377 | * pci registers are at either in the last 2KB of | 1377 | * pci registers are at either in the last 2KB of |
1378 | * an 8KB window or, in pcie and pci rev 13 at 8KB | 1378 | * an 8KB window or, in pcie and pci rev 13 at 8KB |
@@ -1904,7 +1904,7 @@ void ai_pci_setup(struct si_pub *sih, uint coremask) | |||
1904 | siflag = ai_flag(sih); | 1904 | siflag = ai_flag(sih); |
1905 | 1905 | ||
1906 | /* switch over to pci core */ | 1906 | /* switch over to pci core */ |
1907 | regs = ai_setcoreidx(sih, sii->pub.buscoreidx); | 1907 | regs = ai_setcoreidx(sih, sii->buscoreidx); |
1908 | } | 1908 | } |
1909 | 1909 | ||
1910 | /* | 1910 | /* |
@@ -2035,8 +2035,9 @@ bool ai_deviceremoved(struct si_pub *sih) | |||
2035 | 2035 | ||
2036 | bool ai_is_sprom_available(struct si_pub *sih) | 2036 | bool ai_is_sprom_available(struct si_pub *sih) |
2037 | { | 2037 | { |
2038 | struct si_info *sii = (struct si_info *)sih; | ||
2039 | |||
2038 | if (sih->ccrev >= 31) { | 2040 | if (sih->ccrev >= 31) { |
2039 | struct si_info *sii; | ||
2040 | uint origidx; | 2041 | uint origidx; |
2041 | struct chipcregs __iomem *cc; | 2042 | struct chipcregs __iomem *cc; |
2042 | u32 sromctrl; | 2043 | u32 sromctrl; |
@@ -2044,7 +2045,6 @@ bool ai_is_sprom_available(struct si_pub *sih) | |||
2044 | if ((sih->cccaps & CC_CAP_SROM) == 0) | 2045 | if ((sih->cccaps & CC_CAP_SROM) == 0) |
2045 | return false; | 2046 | return false; |
2046 | 2047 | ||
2047 | sii = (struct si_info *)sih; | ||
2048 | origidx = sii->curidx; | 2048 | origidx = sii->curidx; |
2049 | cc = ai_setcoreidx(sih, SI_CC_IDX); | 2049 | cc = ai_setcoreidx(sih, SI_CC_IDX); |
2050 | sromctrl = R_REG(&cc->sromcontrol); | 2050 | sromctrl = R_REG(&cc->sromcontrol); |
@@ -2054,7 +2054,7 @@ bool ai_is_sprom_available(struct si_pub *sih) | |||
2054 | 2054 | ||
2055 | switch (sih->chip) { | 2055 | switch (sih->chip) { |
2056 | case BCM4313_CHIP_ID: | 2056 | case BCM4313_CHIP_ID: |
2057 | return (sih->chipst & CST4313_SPROM_PRESENT) != 0; | 2057 | return (sii->chipst & CST4313_SPROM_PRESENT) != 0; |
2058 | default: | 2058 | default: |
2059 | return true; | 2059 | return true; |
2060 | } | 2060 | } |
@@ -2062,9 +2062,11 @@ bool ai_is_sprom_available(struct si_pub *sih) | |||
2062 | 2062 | ||
2063 | bool ai_is_otp_disabled(struct si_pub *sih) | 2063 | bool ai_is_otp_disabled(struct si_pub *sih) |
2064 | { | 2064 | { |
2065 | struct si_info *sii = (struct si_info *)sih; | ||
2066 | |||
2065 | switch (sih->chip) { | 2067 | switch (sih->chip) { |
2066 | case BCM4313_CHIP_ID: | 2068 | case BCM4313_CHIP_ID: |
2067 | return (sih->chipst & CST4313_OTP_PRESENT) == 0; | 2069 | return (sii->chipst & CST4313_OTP_PRESENT) == 0; |
2068 | /* These chips always have their OTP on */ | 2070 | /* These chips always have their OTP on */ |
2069 | case BCM43224_CHIP_ID: | 2071 | case BCM43224_CHIP_ID: |
2070 | case BCM43225_CHIP_ID: | 2072 | case BCM43225_CHIP_ID: |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h index 1da9759eb7d8..f049179846e6 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h | |||
@@ -146,7 +146,6 @@ | |||
146 | struct si_pub { | 146 | struct si_pub { |
147 | uint buscoretype; /* PCI_CORE_ID, PCIE_CORE_ID, PCMCIA_CORE_ID */ | 147 | uint buscoretype; /* PCI_CORE_ID, PCIE_CORE_ID, PCMCIA_CORE_ID */ |
148 | uint buscorerev; /* buscore rev */ | 148 | uint buscorerev; /* buscore rev */ |
149 | uint buscoreidx; /* buscore index */ | ||
150 | int ccrev; /* chip common core rev */ | 149 | int ccrev; /* chip common core rev */ |
151 | u32 cccaps; /* chip common capabilities */ | 150 | u32 cccaps; /* chip common capabilities */ |
152 | int pmurev; /* pmu core rev */ | 151 | int pmurev; /* pmu core rev */ |
@@ -156,7 +155,6 @@ struct si_pub { | |||
156 | uint chip; /* chip number */ | 155 | uint chip; /* chip number */ |
157 | uint chiprev; /* chip revision */ | 156 | uint chiprev; /* chip revision */ |
158 | uint chippkg; /* chip package option */ | 157 | uint chippkg; /* chip package option */ |
159 | u32 chipst; /* chip status */ | ||
160 | }; | 158 | }; |
161 | 159 | ||
162 | struct pci_dev; | 160 | struct pci_dev; |
@@ -188,7 +186,9 @@ struct si_info { | |||
188 | void __iomem *curmap; /* current regs va */ | 186 | void __iomem *curmap; /* current regs va */ |
189 | void __iomem *regs[SI_MAXCORES]; /* other regs va */ | 187 | void __iomem *regs[SI_MAXCORES]; /* other regs va */ |
190 | 188 | ||
189 | u32 chipst; /* chip status */ | ||
191 | uint curidx; /* current core index */ | 190 | uint curidx; /* current core index */ |
191 | uint buscoreidx; /* buscore index */ | ||
192 | uint numcores; /* # discovered cores */ | 192 | uint numcores; /* # discovered cores */ |
193 | uint coreid[SI_MAXCORES]; /* id of each core */ | 193 | uint coreid[SI_MAXCORES]; /* id of each core */ |
194 | u32 coresba[SI_MAXCORES]; /* backplane address of each core */ | 194 | u32 coresba[SI_MAXCORES]; /* backplane address of each core */ |