diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-27 15:56:10 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-27 15:56:10 +0000 |
commit | e9774e1b179ec2eedc9ec274dddd9c21aec1846f (patch) | |
tree | c170d2e8cd534898c7e119f7fefd28e7d564ccb5 /sys | |
parent | f8f82a1aed6fc747cb9d6e8689741ffcde9d3850 (diff) |
Have the em powerhook call the activate function, which does a way better
job of taking the chip up and down.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_em.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index eb14257cd78..afc810ed9c7 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.244 2010/08/08 12:53:16 kettenis Exp $ */ +/* $OpenBSD: if_em.c,v 1.245 2010/08/27 15:56:09 deraadt Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -170,8 +170,8 @@ void em_attach(struct device *, struct device *, void *); void em_defer_attach(struct device*); int em_detach(struct device *, int); int em_activate(struct device *, int); +void em_powerhook(int, void *); int em_intr(void *); -void em_power(int, void *); void em_start(struct ifnet *); int em_ioctl(struct ifnet *, u_long, caddr_t); void em_watchdog(struct ifnet *); @@ -507,7 +507,7 @@ em_attach(struct device *parent, struct device *self, void *aux) sc->hw.icp_xxxx_is_link_up = FALSE; INIT_DEBUGOUT("em_attach: end"); - sc->sc_powerhook = powerhook_establish(em_power, sc); + sc->sc_powerhook = powerhook_establish(em_powerhook, sc); return; err_mac_addr: @@ -520,19 +520,6 @@ err_pci: em_free_pci_resources(sc); } -void -em_power(int why, void *arg) -{ - struct em_softc *sc = (struct em_softc *)arg; - struct ifnet *ifp; - - if (why == PWR_RESUME) { - ifp = &sc->interface_data.ac_if; - if (ifp->if_flags & IFF_UP) - em_init(sc); - } -} - /********************************************************************* * Transmit entry point * @@ -1908,6 +1895,12 @@ em_activate(struct device *self, int act) return rv; } +void +em_powerhook(int why, void *arg) +{ + em_activate(arg, why); +} + /********************************************************************* * * Workaround for SmartSpeed on 82541 and 82547 controllers |