mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
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.
This commit is contained in:
parent
d74c903a6f
commit
a6ef105236
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124822
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user