mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Add suspend/resume hooks to this driver; necessary to overcome
problems on HP Omnibook 500. MFC after: 1 week
This commit is contained in:
parent
8c992b7f0d
commit
7145906dd6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87392
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user