diff options
| author | Matthew N. Dodd <mdodd@FreeBSD.org> | 2003-01-14 23:19:32 +0000 |
|---|---|---|
| committer | Matthew N. Dodd <mdodd@FreeBSD.org> | 2003-01-14 23:19:32 +0000 |
| commit | c94b6ebc2794e6387fbae2ad291ad3f28a7fbec8 (patch) | |
| tree | fd7f8e549d1e3f3e7c4a2324808c7fdd47ee74ec | |
| parent | e22514406d209415eab38b8e06e3a3b33b1157d4 (diff) | |
Notes
| -rw-r--r-- | sys/dev/wi/if_wi.c | 3 | ||||
| -rw-r--r-- | sys/dev/wi/if_wi_pci.c | 34 | ||||
| -rw-r--r-- | sys/dev/wi/if_wivar.h | 1 |
3 files changed, 36 insertions, 2 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 7340a1cf68c8..700c7203ac98 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -111,7 +111,6 @@ static void wi_reset(struct wi_softc *); static int wi_ioctl(struct ifnet *, u_long, caddr_t); static void wi_init(void *); static void wi_start(struct ifnet *); -static void wi_stop(struct wi_softc *); static void wi_watchdog(struct ifnet *); static void wi_rxeof(struct wi_softc *); static void wi_txeof(struct wi_softc *, int); @@ -2459,7 +2458,7 @@ wi_mgmt_xmit(sc, data, len) return(0); } -static void +void wi_stop(sc) struct wi_softc *sc; { diff --git a/sys/dev/wi/if_wi_pci.c b/sys/dev/wi/if_wi_pci.c index 13d7a825fe15..7dd2536f99ba 100644 --- a/sys/dev/wi/if_wi_pci.c +++ b/sys/dev/wi/if_wi_pci.c @@ -69,6 +69,8 @@ static int wi_pci_probe(device_t); static int wi_pci_attach(device_t); +static int wi_pci_suspend(device_t); +static int wi_pci_resume(device_t); static device_method_t wi_pci_methods[] = { /* Device interface */ @@ -76,6 +78,8 @@ static device_method_t wi_pci_methods[] = { DEVMETHOD(device_attach, wi_pci_attach), DEVMETHOD(device_detach, wi_generic_detach), DEVMETHOD(device_shutdown, wi_shutdown), + DEVMETHOD(device_suspend, wi_pci_suspend), + DEVMETHOD(device_resume, wi_pci_resume), { 0, 0 } }; @@ -233,3 +237,33 @@ wi_pci_attach(device_t dev) return (0); } + +static int +wi_pci_suspend (device_t dev) +{ + struct wi_softc *sc; + sc = device_get_softc(dev); + + wi_stop(sc); + + return (0); +} + +static int +wi_pci_resume (device_t dev) +{ + struct wi_softc *sc; + struct ifnet *ifp; + sc = device_get_softc(dev); + ifp = &sc->arpcom.ac_if; + + if (sc->wi_bus_type != WI_BUS_PCI_NATIVE) + return (0); + + ifp->if_init(ifp->if_softc); + if (ifp->if_flags & IFF_UP) { + ifp->if_start(ifp); + } + + return (0); +} diff --git a/sys/dev/wi/if_wivar.h b/sys/dev/wi/if_wivar.h index 92d908dca719..fee4460ad7ea 100644 --- a/sys/dev/wi/if_wivar.h +++ b/sys/dev/wi/if_wivar.h @@ -221,6 +221,7 @@ int wi_generic_detach(device_t); void wi_shutdown(device_t); int wi_alloc(device_t, int); void wi_free(device_t); +void wi_stop(struct wi_softc *); extern devclass_t wi_devclass; int wi_mgmt_xmit(struct wi_softc *, caddr_t, int); int wi_symbol_load_firm(struct wi_softc *, const void *, int, const void *, int); |
