summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-07-26 22:22:00 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-07-26 22:22:00 +0000
commit3938b025073ccf75dbc45ff1cd6558b9f40081c0 (patch)
tree18e52e76b9ac255853f67bb8cf762c617bd4a055 /sys
parent672fc05b0d787fb85e320c4665610a3c659b0579 (diff)
ca_activate function brings eeepc701 network back after resume.
tested by oga
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_lii.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/sys/dev/pci/if_lii.c b/sys/dev/pci/if_lii.c
index eeab433449d..fd19da426dc 100644
--- a/sys/dev/pci/if_lii.c
+++ b/sys/dev/pci/if_lii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_lii.c,v 1.26 2010/02/08 12:28:42 jsing Exp $ */
+/* $OpenBSD: if_lii.c,v 1.27 2010/07/26 22:21:59 deraadt Exp $ */
/*
* Copyright (c) 2007 The NetBSD Foundation.
@@ -122,6 +122,7 @@ struct lii_softc {
int lii_match(struct device *, void *, void *);
void lii_attach(struct device *, struct device *, void *);
+int lii_activate(struct device *, int);
struct cfdriver lii_cd = {
0,
@@ -132,7 +133,9 @@ struct cfdriver lii_cd = {
struct cfattach lii_ca = {
sizeof(struct lii_softc),
lii_match,
- lii_attach
+ lii_attach,
+ NULL,
+ lii_activate
};
int lii_reset(struct lii_softc *);
@@ -284,6 +287,28 @@ unmap:
}
int
+lii_activate(struct device *self, int act)
+{
+ struct lii_softc *sc = (struct lii_softc *)self;
+ struct ifnet *ifp = &sc->sc_ac.ac_if;
+ int rv = 0;
+
+ switch (act) {
+ case DVACT_SUSPEND:
+ if (ifp->if_flags & IFF_RUNNING)
+ lii_stop(ifp);
+ rv = config_activate_children(self, act);
+ break;
+ case DVACT_RESUME:
+ rv = config_activate_children(self, act);
+ if (ifp->if_flags & IFF_UP)
+ lii_init(ifp);
+ break;
+ }
+ return rv;
+}
+
+int
lii_reset(struct lii_softc *sc)
{
int i;