diff options
author | wpaul <wpaul@FreeBSD.org> | 2004-01-22 03:00:59 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2004-01-22 03:00:59 +0000 |
commit | c46d660722de95a66d3a3aa25acf3ae9c8d641cf (patch) | |
tree | 94ad6977512fac22032fd468df36998bd119170b /sys | |
parent | 39e6c1e2a7a40825b080ad4ee521e7d313733cc5 (diff) | |
download | FreeBSD-src-c46d660722de95a66d3a3aa25acf3ae9c8d641cf.zip FreeBSD-src-c46d660722de95a66d3a3aa25acf3ae9c8d641cf.tar.gz |
Add suspend and resume methods. I'm not certain this work correctly
since I can't easily test them on my laptop right now, but they
should do the right thing.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/if_ndis/if_ndis.c | 36 |
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. |