summaryrefslogtreecommitdiffstats
path: root/sys/dev/re
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/dev/re
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/dev/re')
-rw-r--r--sys/dev/re/if_re.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index c28728f..84d925f 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -2420,19 +2420,23 @@ static int
re_suspend(dev)
device_t dev;
{
+#ifndef BURN_BRIDGES
register int i;
+#endif
struct rl_softc *sc;
sc = device_get_softc(dev);
re_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;
@@ -2448,13 +2452,16 @@ static int
re_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);
@@ -2466,6 +2473,7 @@ re_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)
OpenPOWER on IntegriCloud