aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmsmac
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-04-28 20:50:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-05-16 12:45:25 -0400
commit2ffd795a5e8a1d8dce269c30c76d85f4db33c832 (patch)
treec736d79099a708aad8fb01a72f79de7cb60c7753 /drivers/net/wireless/brcm80211/brcmsmac
parent60dda6c0d26c1c84a4ca3b22aab8147bb431112f (diff)
brcmsmac: remove pcie_extendL1timer()
This is now done by calling bcma_core_pci_extend_L1time() Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Tested-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac')
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/aiutils.c6
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/nicpci.c72
2 files changed, 3 insertions, 75 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
index cafacb171f27..8df7cb5379c1 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
@@ -794,8 +794,7 @@ void ai_pci_up(struct si_pub *sih)
794 } 794 }
795 795
796 if (PCIE(sih)) 796 if (PCIE(sih))
797 pcicore_up(sii->pch, SI_PCIUP); 797 bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci, true);
798
799} 798}
800 799
801/* Unconfigure and/or apply various WARs when going down */ 800/* Unconfigure and/or apply various WARs when going down */
@@ -812,7 +811,8 @@ void ai_pci_down(struct si_pub *sih)
812 bcma_core_set_clockmode(cc, BCMA_CLKMODE_DYNAMIC); 811 bcma_core_set_clockmode(cc, BCMA_CLKMODE_DYNAMIC);
813 } 812 }
814 813
815 pcicore_down(sii->pch, SI_PCIDOWN); 814 if (PCIE(sih))
815 bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci, false);
816} 816}
817 817
818/* 818/*
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;