diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2006-11-20 23:30:07 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2006-11-20 23:30:07 +0000 |
| commit | 6daee769f4277fe356aee26fa3f0154b0a982b63 (patch) | |
| tree | ae2cffb6baca5b69c4b1ff10374489960422d347 /sys/dev/bfe | |
| parent | 8cc7b0f93db56404b56025bd67338f874ace3e3f (diff) | |
Notes
Diffstat (limited to 'sys/dev/bfe')
| -rw-r--r-- | sys/dev/bfe/if_bfe.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sys/dev/bfe/if_bfe.c b/sys/dev/bfe/if_bfe.c index 3aa99ee985da..dc24da9860e1 100644 --- a/sys/dev/bfe/if_bfe.c +++ b/sys/dev/bfe/if_bfe.c @@ -87,6 +87,8 @@ static struct bfe_type bfe_devs[] = { static int bfe_probe (device_t); static int bfe_attach (device_t); static int bfe_detach (device_t); +static int bfe_suspend (device_t); +static int bfe_resume (device_t); static void bfe_release_resources (struct bfe_softc *); static void bfe_intr (void *); static void bfe_start (struct ifnet *); @@ -136,6 +138,8 @@ static device_method_t bfe_methods[] = { DEVMETHOD(device_attach, bfe_attach), DEVMETHOD(device_detach, bfe_detach), DEVMETHOD(device_shutdown, bfe_shutdown), + DEVMETHOD(device_suspend, bfe_suspend), + DEVMETHOD(device_resume, bfe_resume), /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), @@ -480,6 +484,40 @@ bfe_shutdown(device_t dev) } static int +bfe_suspend(device_t dev) +{ + struct bfe_softc *sc; + + sc = device_get_softc(dev); + BFE_LOCK(sc); + bfe_stop(sc); + BFE_UNLOCK(sc); + + return (0); +} + +static int +bfe_resume(device_t dev) +{ + struct bfe_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + ifp = sc->bfe_ifp; + BFE_LOCK(sc); + bfe_chip_reset(sc); + if (ifp->if_flags & IFF_UP) { + bfe_init_locked(sc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + bfe_start_locked(ifp); + } + BFE_UNLOCK(sc); + + return (0); +} + +static int bfe_miibus_readreg(device_t dev, int phy, int reg) { struct bfe_softc *sc; |
