diff options
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_fxp_pci.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/sys/dev/pci/if_fxp_pci.c b/sys/dev/pci/if_fxp_pci.c index 9166c3a4656..6afc8ca4062 100644 --- a/sys/dev/pci/if_fxp_pci.c +++ b/sys/dev/pci/if_fxp_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_fxp_pci.c,v 1.52 2009/10/15 17:54:56 deraadt Exp $ */ +/* $OpenBSD: if_fxp_pci.c,v 1.53 2010/08/06 14:11:48 deraadt Exp $ */ /* * Copyright (c) 1995, David Greenman @@ -81,6 +81,7 @@ int fxp_pci_match(struct device *, void *, void *); void fxp_pci_attach(struct device *, struct device *, void *); int fxp_pci_detach(struct device *, int); +int fxp_pci_activate(struct device *, int); struct fxp_pci_softc { struct fxp_softc psc_softc; @@ -90,7 +91,7 @@ struct fxp_pci_softc { struct cfattach fxp_pci_ca = { sizeof(struct fxp_pci_softc), fxp_pci_match, fxp_pci_attach, - fxp_pci_detach + fxp_pci_detach, fxp_pci_activate }; const struct pci_matchid fxp_pci_devices[] = { @@ -276,3 +277,24 @@ fxp_pci_detach(struct device *self, int flags) return (0); } + +int +fxp_pci_activate(struct device *self, int act) +{ + struct fxp_softc *sc = (struct fxp_softc *)self; + struct ifnet *ifp = &sc->sc_arpcom.ac_if; + + switch (act) { + case DVACT_SUSPEND: + if (ifp->if_flags & IFF_RUNNING) + fxp_stop(sc, 1, 1); + config_activate_children(self, act); + break; + case DVACT_RESUME: + config_activate_children(self, act); + if (ifp->if_flags & IFF_UP) + fxp_init(ifp); + break; + } + return (0); +} |