diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-27 20:22:14 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-27 20:22:14 +0000 |
commit | 4b7266cd968e4fbbdcba7e125d21a79fcbc99c53 (patch) | |
tree | dde6ac703d750a7b619b7661f1026791a0d13d2f /sys/dev/ic | |
parent | 8e99b7c1fee6c34c77dfa1f5e507c1c07b32ad4d (diff) |
Move the activate function from pci to the the main driver, so that the
powerhook can use it
ok kettenis
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/rtl81x9.c | 27 | ||||
-rw-r--r-- | sys/dev/ic/rtl81x9reg.h | 3 |
2 files changed, 26 insertions, 4 deletions
diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index 3fe752fa6b3..e1ce7ab70a8 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9.c,v 1.71 2010/07/02 02:40:16 blambert Exp $ */ +/* $OpenBSD: rtl81x9.c,v 1.72 2010/08/27 20:22:13 deraadt Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1250,11 +1250,32 @@ rl_attach(struct rl_softc *sc) return (0); } +int +rl_activate(struct device *self, int act) +{ + struct rl_softc *sc = (struct rl_softc *)self; + struct ifnet *ifp = &sc->sc_arpcom.ac_if; + int rv = 0; + + switch (act) { + case DVACT_SUSPEND: + if (ifp->if_flags & IFF_RUNNING) + rl_stop(sc); + rv = config_activate_children(self, act); + break; + case DVACT_RESUME: + rv = config_activate_children(self, act); + if (ifp->if_flags & IFF_UP) + rl_init(sc); + break; + } + return rv; +} + void rl_powerhook(int why, void *arg) { - if (why == PWR_RESUME) - rl_init(arg); + rl_activate(arg, why); } int diff --git a/sys/dev/ic/rtl81x9reg.h b/sys/dev/ic/rtl81x9reg.h index a7af0ddb09a..45da5e01f49 100644 --- a/sys/dev/ic/rtl81x9reg.h +++ b/sys/dev/ic/rtl81x9reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9reg.h,v 1.68 2010/06/28 16:04:09 sthen Exp $ */ +/* $OpenBSD: rtl81x9reg.h,v 1.69 2010/08/27 20:22:13 deraadt Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1008,3 +1008,4 @@ extern int rl_attach(struct rl_softc *); extern int rl_intr(void *); extern void rl_setmulti(struct rl_softc *); int rl_detach(struct rl_softc *); +int rl_activate(struct device *, int); |