summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_xl_pci.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-08-06 02:45:55 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-08-06 02:45:55 +0000
commit1f54e2b1f3e6d6a9b94afb7516a9e81fc156caac (patch)
treed9e593d8910d5df8b6ccf820452b1eb8a342e470 /sys/dev/pci/if_xl_pci.c
parent58d93f88937e55e9aa70fe99129b66265f549a74 (diff)
ca_activate function for suspend/resume
tested by mlarkin
Diffstat (limited to 'sys/dev/pci/if_xl_pci.c')
-rw-r--r--sys/dev/pci/if_xl_pci.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/sys/dev/pci/if_xl_pci.c b/sys/dev/pci/if_xl_pci.c
index b950efa9aaa..c01e9ea77c4 100644
--- a/sys/dev/pci/if_xl_pci.c
+++ b/sys/dev/pci/if_xl_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_xl_pci.c,v 1.29 2010/04/08 00:23:53 tedu Exp $ */
+/* $OpenBSD: if_xl_pci.c,v 1.30 2010/08/06 02:45:54 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -91,6 +91,7 @@
int xl_pci_match(struct device *, void *, void *);
void xl_pci_attach(struct device *, struct device *, void *);
int xl_pci_detach(struct device *, int);
+int xl_pci_activate(struct device *, int);
void xl_pci_intr_ack(struct xl_softc *);
struct xl_pci_softc {
@@ -101,7 +102,8 @@ struct xl_pci_softc {
};
struct cfattach xl_pci_ca = {
- sizeof(struct xl_pci_softc), xl_pci_match, xl_pci_attach, xl_pci_detach
+ sizeof(struct xl_pci_softc), xl_pci_match, xl_pci_attach, xl_pci_detach,
+ xl_pci_activate
};
const struct pci_matchid xl_pci_devices[] = {
@@ -335,6 +337,28 @@ xl_pci_detach(struct device *self, int flags)
return (0);
}
+int
+xl_pci_activate(struct device *self, int act)
+{
+ struct xl_pci_softc *psc = (void *)self;
+ struct xl_softc *sc = &psc->psc_softc;
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+
+ switch (act) {
+ case DVACT_SUSPEND:
+ if (ifp->if_flags & IFF_RUNNING)
+ xl_stop(sc);
+ config_activate_children(self, act);
+ break;
+ case DVACT_RESUME:
+ config_activate_children(self, act);
+ if (ifp->if_flags & IFF_UP)
+ xl_init(sc);
+ break;
+ }
+ return (0);
+}
+
void
xl_pci_intr_ack(struct xl_softc *sc)
{