diff options
-rw-r--r-- | sys/dev/ic/xl.c | 25 | ||||
-rw-r--r-- | sys/dev/ic/xlreg.h | 4 |
2 files changed, 26 insertions, 3 deletions
diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c index 54623f5c489..a9971cdd015 100644 --- a/sys/dev/ic/xl.c +++ b/sys/dev/ic/xl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xl.c,v 1.28 2001/08/12 20:12:12 mickey Exp $ */ +/* $OpenBSD: xl.c,v 1.29 2001/08/19 01:45:55 jason Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -196,6 +196,28 @@ int xl_miibus_readreg __P((struct device *, int, int)); void xl_miibus_writereg __P((struct device *, int, int, int)); void xl_miibus_statchg __P((struct device *)); +void xl_power __P((int, void *)); + +void +xl_power(why, arg) + int why; + void *arg; +{ + struct xl_softc *sc = arg; + struct ifnet *ifp; + int s; + + s = splimp(); + if (why != PWR_RESUME) + xl_stop(sc); + else { + ifp = &sc->arpcom.ac_if; + if (ifp->if_flags & IFF_UP) + xl_reset(sc, 1); + } + splx(s); +} + /* * Murphy's law says that it's possible the chip can wedge and * the 'command in progress' bit may never clear. Hence, we wait @@ -2649,6 +2671,7 @@ xl_attach(sc) ether_ifattach(ifp); sc->sc_sdhook = shutdownhook_establish(xl_shutdown, sc); + sc->sc_pwrhook = powerhook_establish(xl_power, sc); } int diff --git a/sys/dev/ic/xlreg.h b/sys/dev/ic/xlreg.h index 3749426f22e..3632c16b5fc 100644 --- a/sys/dev/ic/xlreg.h +++ b/sys/dev/ic/xlreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: xlreg.h,v 1.8 2000/11/09 17:39:07 mickey Exp $ */ +/* $OpenBSD: xlreg.h,v 1.9 2001/08/19 01:45:55 jason Exp $ */ /* * Copyright (c) 1997, 1998 @@ -585,7 +585,7 @@ struct xl_softc { struct xl_chain_data xl_cdata; int xl_flags; void (*intr_ack) __P((struct xl_softc *)); - void * sc_sdhook; + void * sc_sdhook, *sc_pwrhook; }; #define xl_rx_goodframes(x) \ |