summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-07-27 00:03:04 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-07-27 00:03:04 +0000
commitbd1c1a2863ae8c9e74fac4d3c47674b573d1d3be (patch)
tree99d88ff67e28de1835a01bbfc43db972c045fe1d /sys
parent18ddcc873d7b9e9274372883a3f2f71c02fb5ee2 (diff)
ca_activate function brings eeepc 1000HE back after resume.
tested by krw
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_ale.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/sys/dev/pci/if_ale.c b/sys/dev/pci/if_ale.c
index 1a3920c3f82..b579bc15e40 100644
--- a/sys/dev/pci/if_ale.c
+++ b/sys/dev/pci/if_ale.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ale.c,v 1.13 2010/05/19 14:39:07 oga Exp $ */
+/* $OpenBSD: if_ale.c,v 1.14 2010/07/27 00:03:03 deraadt Exp $ */
/*-
* Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
* All rights reserved.
@@ -81,6 +81,7 @@
int ale_match(struct device *, void *, void *);
void ale_attach(struct device *, struct device *, void *);
int ale_detach(struct device *, int);
+int ale_activate(struct device *, int);
int ale_miibus_readreg(struct device *, int, int);
void ale_miibus_writereg(struct device *, int, int, int);
@@ -123,7 +124,8 @@ const struct pci_matchid ale_devices[] = {
};
struct cfattach ale_ca = {
- sizeof (struct ale_softc), ale_match, ale_attach
+ sizeof (struct ale_softc), ale_match, ale_attach, NULL,
+ ale_activate
};
struct cfdriver ale_cd = {
@@ -597,6 +599,27 @@ ale_detach(struct device *self, int flags)
return (0);
}
+int
+ale_activate(struct device *self, int act)
+{
+ struct ale_softc *sc = (struct ale_softc *)self;
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ int rv = 0;
+
+ switch (act) {
+ case DVACT_SUSPEND:
+ if (ifp->if_flags & IFF_RUNNING)
+ ale_stop(sc);
+ rv = config_activate_children(self, act);
+ break;
+ case DVACT_RESUME:
+ rv = config_activate_children(self, act);
+ if (ifp->if_flags & IFF_UP)
+ ale_init(ifp);
+ break;
+ }
+ return rv;
+}
int
ale_dma_alloc(struct ale_softc *sc)