summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-10-15 16:02:11 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-10-15 16:02:11 +0000
commit7dfa421f150e9212026a34452e39bafa6e044d24 (patch)
tree89b4a2df2c9e67b048d6e06b53a296be0a63e7ac /sys/dev
parent7cefa15aea00c58a956a54add36db7aa67316c37 (diff)
re-init the hw on resume, from grendel@zeitbombe.org
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/rtl81x9.c17
-rw-r--r--sys/dev/ic/rtl81x9reg.h3
2 files changed, 17 insertions, 3 deletions
diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c
index 1e1ee05de86..22a8d7cb742 100644
--- a/sys/dev/ic/rtl81x9.c
+++ b/sys/dev/ic/rtl81x9.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9.c,v 1.18 2002/07/02 19:38:55 nate Exp $ */
+/* $OpenBSD: rtl81x9.c,v 1.19 2002/10/15 16:02:10 mickey Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -133,6 +133,7 @@
void rl_tick(void *);
void rl_shutdown(void *);
+void rl_powerhook(int, void *);
int rl_encap(struct rl_softc *, struct mbuf * );
@@ -1302,6 +1303,7 @@ rl_attach(sc)
ether_ifattach(ifp);
sc->sc_sdhook = shutdownhook_establish(rl_shutdown, sc);
+ sc->sc_pwrhook = powerhook_establish(rl_powerhook, sc);
return (0);
}
@@ -1326,11 +1328,13 @@ rl_detach(sc)
if_detach(ifp);
shutdownhook_disestablish(sc->sc_sdhook);
+ powerhook_disestablish(sc->sc_pwrhook);
return (0);
}
-void rl_shutdown(arg)
+void
+rl_shutdown(arg)
void *arg;
{
struct rl_softc *sc = (struct rl_softc *)arg;
@@ -1338,6 +1342,15 @@ void rl_shutdown(arg)
rl_stop(sc);
}
+void
+rl_powerhook(why, arg)
+ int why;
+ void *arg;
+{
+ if (why == PWR_RESUME)
+ rl_init(arg);
+}
+
int
rl_miibus_readreg(self, phy, reg)
struct device *self;
diff --git a/sys/dev/ic/rtl81x9reg.h b/sys/dev/ic/rtl81x9reg.h
index 613bd81c085..58b475dfbba 100644
--- a/sys/dev/ic/rtl81x9reg.h
+++ b/sys/dev/ic/rtl81x9reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9reg.h,v 1.6 2002/06/09 03:14:18 todd Exp $ */
+/* $OpenBSD: rtl81x9reg.h,v 1.7 2002/10/15 16:02:10 mickey Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -369,6 +369,7 @@ struct rl_softc {
struct mii_data sc_mii; /* MII information */
u_int8_t rl_type;
void *sc_sdhook; /* shutdownhook */
+ void *sc_pwrhook;
int rl_txthresh;
struct rl_chain_data rl_cdata;
struct timeout sc_tick_tmo;