summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorguido <guido@FreeBSD.org>2001-12-05 10:34:07 +0000
committerguido <guido@FreeBSD.org>2001-12-05 10:34:07 +0000
commit4133536ce19bd88aa34ce4e2a9de5de955700eeb (patch)
treed17716bd0bfe1e355cf2d6a9b762c241c8a7010f /sys
parent13ccdfc0323d28925f6429c4ce4de5c70d7f56d8 (diff)
downloadFreeBSD-src-4133536ce19bd88aa34ce4e2a9de5de955700eeb.zip
FreeBSD-src-4133536ce19bd88aa34ce4e2a9de5de955700eeb.tar.gz
Add suspend/resume hooks to this driver; necessary to overcome
problems on HP Omnibook 500. MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r--sys/pci/if_xl.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c
index 3c0b28d..7378d83 100644
--- a/sys/pci/if_xl.c
+++ b/sys/pci/if_xl.c
@@ -239,6 +239,9 @@ static void xl_init __P((void *));
static void xl_stop __P((struct xl_softc *));
static void xl_watchdog __P((struct ifnet *));
static void xl_shutdown __P((device_t));
+static int xl_suspend __P((device_t));
+static int xl_resume __P((device_t));
+
static int xl_ifmedia_upd __P((struct ifnet *));
static void xl_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
@@ -285,6 +288,8 @@ static device_method_t xl_methods[] = {
DEVMETHOD(device_attach, xl_attach),
DEVMETHOD(device_detach, xl_detach),
DEVMETHOD(device_shutdown, xl_shutdown),
+ DEVMETHOD(device_suspend, xl_suspend),
+ DEVMETHOD(device_resume, xl_resume),
/* bus interface */
DEVMETHOD(bus_print_child, bus_generic_print_child),
@@ -2591,6 +2596,7 @@ static void xl_init(xsc)
printf("xl%d: initialization failed: no "
"memory for rx buffers\n", sc->xl_unit);
xl_stop(sc);
+ XL_UNLOCK(sc);
return;
}
@@ -3048,3 +3054,35 @@ static void xl_shutdown(dev)
return;
}
+
+static int xl_suspend(dev)
+ device_t dev;
+{
+ struct xl_softc *sc;
+
+ sc = device_get_softc(dev);
+
+ XL_LOCK(sc);
+ xl_stop(sc);
+ XL_UNLOCK(sc);
+
+ return(0);
+}
+
+static int xl_resume(dev)
+ device_t dev;
+{
+ struct xl_softc *sc;
+ struct ifnet *ifp;
+
+ sc = device_get_softc(dev);
+ XL_LOCK(sc);
+ ifp = &sc->arpcom.ac_if;
+
+ xl_reset(sc);
+ if (ifp->if_flags & IFF_UP)
+ xl_init(sc);
+
+ XL_UNLOCK(sc);
+ return(0);
+}
OpenPOWER on IntegriCloud