summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2004-05-24 19:39:23 +0000
committerjhb <jhb@FreeBSD.org>2004-05-24 19:39:23 +0000
commitb2fdc052fb12015ae97a1e413aabad716ebf5689 (patch)
treeaab7d44871ff19e5bfbf49b00a7dcb22fb4d2194 /sys/pci
parent34e1843cde92160b789d42513c51c9f151500916 (diff)
downloadFreeBSD-src-b2fdc052fb12015ae97a1e413aabad716ebf5689.zip
FreeBSD-src-b2fdc052fb12015ae97a1e413aabad716ebf5689.tar.gz
Wrap the code to save/restore PCI config registers on suspend/resume in
#ifndef BURN_BRIDGES. Noticed by: phk
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_rl.c8
-rw-r--r--sys/pci/if_rlreg.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index 5f0d0d2..7e3bd56 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -1916,19 +1916,23 @@ static int
rl_suspend(dev)
device_t dev;
{
+#ifndef BURN_BRIDGES
register int i;
+#endif
struct rl_softc *sc;
sc = device_get_softc(dev);
rl_stop(sc);
+#ifndef BURN_BRIDGES
for (i = 0; i < 5; i++)
sc->saved_maps[i] = pci_read_config(dev, PCIR_MAPS + i * 4, 4);
sc->saved_biosaddr = pci_read_config(dev, PCIR_BIOS, 4);
sc->saved_intline = pci_read_config(dev, PCIR_INTLINE, 1);
sc->saved_cachelnsz = pci_read_config(dev, PCIR_CACHELNSZ, 1);
sc->saved_lattimer = pci_read_config(dev, PCIR_LATTIMER, 1);
+#endif
sc->suspended = 1;
@@ -1944,13 +1948,16 @@ static int
rl_resume(dev)
device_t dev;
{
+#ifndef BURN_BRIDGES
register int i;
+#endif
struct rl_softc *sc;
struct ifnet *ifp;
sc = device_get_softc(dev);
ifp = &sc->arpcom.ac_if;
+#ifndef BURN_BRIDGES
/* better way to do this? */
for (i = 0; i < 5; i++)
pci_write_config(dev, PCIR_MAPS + i * 4, sc->saved_maps[i], 4);
@@ -1962,6 +1969,7 @@ rl_resume(dev)
/* reenable busmastering */
pci_enable_busmaster(dev);
pci_enable_io(dev, RL_RES);
+#endif
/* reinitialize interface if necessary */
if (ifp->if_flags & IFF_UP)
diff --git a/sys/pci/if_rlreg.h b/sys/pci/if_rlreg.h
index 8bf6ada..4603524 100644
--- a/sys/pci/if_rlreg.h
+++ b/sys/pci/if_rlreg.h
@@ -683,11 +683,13 @@ struct rl_softc {
int rxcycles;
#endif
+#ifndef BURN_BRIDGES
u_int32_t saved_maps[5]; /* pci data */
u_int32_t saved_biosaddr;
u_int8_t saved_intline;
u_int8_t saved_cachelnsz;
u_int8_t saved_lattimer;
+#endif
};
#define RL_LOCK(_sc) mtx_lock(&(_sc)->rl_mtx)
OpenPOWER on IntegriCloud