diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-07-27 17:34:27 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-07-27 17:34:27 +0000 |
commit | 85b3bf36ca4e52654aa0395601d18a6472e55676 (patch) | |
tree | faafcb713b010a5ae2ae4ee9dcbca4b7fe3f8a40 /sys/dev/pci/if_rl_pci.c | |
parent | ca2246f7206f312d3507d148d8fca7b5028c4088 (diff) |
ca_activate function for suspend/resume
tested by mlarkin
Diffstat (limited to 'sys/dev/pci/if_rl_pci.c')
-rw-r--r-- | sys/dev/pci/if_rl_pci.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/sys/dev/pci/if_rl_pci.c b/sys/dev/pci/if_rl_pci.c index fb7180e9094..060f86a6823 100644 --- a/sys/dev/pci/if_rl_pci.c +++ b/sys/dev/pci/if_rl_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rl_pci.c,v 1.18 2009/12/21 18:14:51 naddy Exp $ */ +/* $OpenBSD: if_rl_pci.c,v 1.19 2010/07/27 17:34:26 deraadt Exp $ */ /* * Copyright (c) 1997, 1998 @@ -85,6 +85,7 @@ int rl_pci_match(struct device *, void *, void *); void rl_pci_attach(struct device *, struct device *, void *); int rl_pci_detach(struct device *, int); +int rl_pci_activate(struct device *, int); struct rl_pci_softc { struct rl_softc psc_softc; @@ -93,7 +94,8 @@ struct rl_pci_softc { }; struct cfattach rl_pci_ca = { - sizeof(struct rl_pci_softc), rl_pci_match, rl_pci_attach, rl_pci_detach + sizeof(struct rl_pci_softc), rl_pci_match, rl_pci_attach, rl_pci_detach, + rl_pci_activate }; const struct pci_matchid rl_pci_devices[] = { @@ -202,3 +204,27 @@ rl_pci_detach(struct device *self, int flags) return (0); } +int +rl_pci_activate(struct device *self, int act) +{ + struct rl_pci_softc *psc = (struct rl_pci_softc *)self; + struct rl_softc *sc = &psc->psc_softc; + struct ifnet *ifp = &sc->sc_arpcom.ac_if; + int rv = 0; + extern void rl_stop(struct rl_softc *); + extern void rl_init(struct rl_softc *); + + 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; +} |