summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-12-08 15:41:47 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-12-08 15:41:47 +0000
commit4155548520035a94c89443f3e00a92585b44774a (patch)
tree7e90bd8c2632061d7f438296ab32ecff1b7b364c
parentc73e622f28acec07f8143f693f4d1ea5d7ce58cb (diff)
powerhook: em_init on resume
-rw-r--r--sys/dev/pci/if_em.c19
-rw-r--r--sys/dev/pci/if_em.h4
2 files changed, 20 insertions, 3 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index ae6fa93f8a2..babaf18c2ab 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
-/* $OpenBSD: if_em.c,v 1.33 2004/12/08 04:28:40 brad Exp $ */
+/* $OpenBSD: if_em.c,v 1.34 2004/12/08 15:41:46 markus Exp $ */
#include "bpfilter.h"
#include "vlan.h"
@@ -208,6 +208,7 @@ void em_intr(void *);
int em_probe(struct device *, void *, void *);
void em_attach(struct device *, struct device *, void *);
int em_intr(void *);
+void em_power(int, void *);
#endif /* __OpenBSD__ */
void em_start(struct ifnet *);
void em_start_locked(struct ifnet *);
@@ -661,6 +662,7 @@ em_attach(struct device *parent, struct device *self, void *aux)
return(0);
#endif
#ifdef __OpenBSD__
+ sc->sc_powerhook = powerhook_establish(em_power, sc);
return;
#endif
@@ -680,6 +682,21 @@ err_sysctl:
}
+#ifdef __OpenBSD__
+void
+em_power(int why, void *arg)
+{
+ struct em_softc *sc = (struct em_softc *)arg;
+ struct ifnet *ifp;
+
+ if (why == PWR_RESUME) {
+ ifp = &sc->interface_data.ac_if;
+ if (ifp->if_flags & IFF_UP)
+ em_init(sc);
+ }
+}
+#endif
+
/*********************************************************************
* Device removal routine
*
diff --git a/sys/dev/pci/if_em.h b/sys/dev/pci/if_em.h
index e4123398fcf..f1d157a42ac 100644
--- a/sys/dev/pci/if_em.h
+++ b/sys/dev/pci/if_em.h
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
/* $FreeBSD: if_em.h,v 1.26 2004/09/01 23:22:41 pdeuskar Exp $ */
-/* $OpenBSD: if_em.h,v 1.8 2004/11/16 14:39:14 brad Exp $ */
+/* $OpenBSD: if_em.h,v 1.9 2004/12/08 15:41:46 markus Exp $ */
#ifndef _EM_H_DEFINED_
#define _EM_H_DEFINED_
@@ -326,7 +326,7 @@ struct em_softc {
struct timeout em_intr_enable;
struct timeout timer_handle;
struct timeout tx_fifo_timer_handle;
-
+ void *sc_powerhook;
#endif /* __OpenBSD__ */
#ifdef __STRICT_ALIGNMENT