aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmsmac/nicpci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac/nicpci.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/nicpci.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/nicpci.c b/drivers/net/wireless/brcm80211/brcmsmac/nicpci.c
index 2d615cbcd903..9a3e03bc1fd0 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/nicpci.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/nicpci.c
@@ -240,78 +240,6 @@ void pcicore_deinit(struct pcicore_info *pch)
240 kfree(pch); 240 kfree(pch);
241} 241}
242 242
243/* ***** Register Access API */
244static uint
245pcie_readreg(struct bcma_device *core, uint addrtype, uint offset)
246{
247 uint retval = 0xFFFFFFFF;
248
249 switch (addrtype) {
250 case PCIE_CONFIGREGS:
251 bcma_write32(core, PCIEREGOFFS(configaddr), offset);
252 (void)bcma_read32(core, PCIEREGOFFS(configaddr));
253 retval = bcma_read32(core, PCIEREGOFFS(configdata));
254 break;
255 case PCIE_PCIEREGS:
256 bcma_write32(core, PCIEREGOFFS(pcieindaddr), offset);
257 (void)bcma_read32(core, PCIEREGOFFS(pcieindaddr));
258 retval = bcma_read32(core, PCIEREGOFFS(pcieinddata));
259 break;
260 }
261
262 return retval;
263}
264
265static uint pcie_writereg(struct bcma_device *core, uint addrtype,
266 uint offset, uint val)
267{
268 switch (addrtype) {
269 case PCIE_CONFIGREGS:
270 bcma_write32(core, PCIEREGOFFS(configaddr), offset);
271 bcma_write32(core, PCIEREGOFFS(configdata), val);
272 break;
273 case PCIE_PCIEREGS:
274 bcma_write32(core, PCIEREGOFFS(pcieindaddr), offset);
275 bcma_write32(core, PCIEREGOFFS(pcieinddata), val);
276 break;
277 default:
278 break;
279 }
280 return 0;
281}
282
283/* ***** Support functions ***** */
284static void pcie_extendL1timer(struct pcicore_info *pi, bool extend)
285{
286 u32 w;
287
288 w = pcie_readreg(pi->core, PCIE_PCIEREGS, PCIE_DLLP_PMTHRESHREG);
289 if (extend)
290 w |= PCIE_ASPMTIMER_EXTEND;
291 else
292 w &= ~PCIE_ASPMTIMER_EXTEND;
293 pcie_writereg(pi->core, PCIE_PCIEREGS, PCIE_DLLP_PMTHRESHREG, w);
294 w = pcie_readreg(pi->core, PCIE_PCIEREGS, PCIE_DLLP_PMTHRESHREG);
295}
296
297void pcicore_up(struct pcicore_info *pi, int state)
298{
299 if (!pi || ai_get_buscoretype(pi->sih) != PCIE_CORE_ID)
300 return;
301
302 /* Restore L1 timer for better performance */
303 pcie_extendL1timer(pi, true);
304}
305
306void pcicore_down(struct pcicore_info *pi, int state)
307{
308 if (!pi || ai_get_buscoretype(pi->sih) != PCIE_CORE_ID)
309 return;
310
311 /* Reduce L1 timer for better power savings */
312 pcie_extendL1timer(pi, false);
313}
314
315void pcicore_fixcfg(struct pcicore_info *pi) 243void pcicore_fixcfg(struct pcicore_info *pi)
316{ 244{
317 struct bcma_device *core = pi->core; 245 struct bcma_device *core = pi->core;