diff options
| author | Bill Paul <wpaul@FreeBSD.org> | 2004-01-22 03:00:59 +0000 |
|---|---|---|
| committer | Bill Paul <wpaul@FreeBSD.org> | 2004-01-22 03:00:59 +0000 |
| commit | a6ef1052360132db26949ca4946c6cfdc510109e (patch) | |
| tree | 94ad6977512fac22032fd468df36998bd119170b /sys/dev/if_ndis | |
| parent | d74c903a6fc2d9bee2f00a758bd236c8036004f0 (diff) | |
Notes
Diffstat (limited to 'sys/dev/if_ndis')
| -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 7bc343e7e10ed..78431d08a3a92 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. |
