summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/if_ndis/if_ndis.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c
index 7bc343e..78431d0 100644
--- a/sys/dev/if_ndis/if_ndis.c
+++ b/sys/dev/if_ndis/if_ndis.c
@@ -95,6 +95,8 @@ static struct ndis_type ndis_devs[] = {
static int ndis_probe (device_t);
static int ndis_attach (device_t);
static int ndis_detach (device_t);
+static int ndis_suspend (device_t);
+static int ndis_resume (device_t);
static __stdcall void ndis_txeof (ndis_handle,
ndis_packet *, ndis_status);
@@ -138,6 +140,8 @@ static device_method_t ndis_methods[] = {
DEVMETHOD(device_attach, ndis_attach),
DEVMETHOD(device_detach, ndis_detach),
DEVMETHOD(device_shutdown, ndis_shutdown),
+ DEVMETHOD(device_suspend, ndis_suspend),
+ DEVMETHOD(device_resume, ndis_resume),
{ 0, 0 }
};
@@ -944,6 +948,38 @@ ndis_detach(dev)
return(0);
}
+static int
+ndis_suspend(dev)
+ device_t dev;
+{
+ struct ndis_softc *sc;
+ struct ifnet *ifp;
+
+ sc = device_get_softc(dev);
+ ifp = &sc->arpcom.ac_if;
+
+ if (ifp->if_flags & IFF_UP)
+ ndis_stop(sc);
+
+ return(0);
+}
+
+static int
+ndis_resume(dev)
+ device_t dev;
+{
+ struct ndis_softc *sc;
+ struct ifnet *ifp;
+
+ sc = device_get_softc(dev);
+ ifp = &sc->arpcom.ac_if;
+
+ if (ifp->if_flags & IFF_UP)
+ ndis_init(sc);
+
+ return(0);
+}
+
/*
* A frame has been uploaded: pass the resulting mbuf chain up to
* the higher level protocols.
OpenPOWER on IntegriCloud