summaryrefslogtreecommitdiffstats
path: root/sys/dev/wi
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2003-01-14 23:19:32 +0000
committermdodd <mdodd@FreeBSD.org>2003-01-14 23:19:32 +0000
commit678fc82bcf2ec81eca4ecd9233b9a9031acd9b96 (patch)
treefd7f8e549d1e3f3e7c4a2324808c7fdd47ee74ec /sys/dev/wi
parent519d68956b6ba2d8ebddcb3046454e9c7957f93b (diff)
downloadFreeBSD-src-678fc82bcf2ec81eca4ecd9233b9a9031acd9b96.zip
FreeBSD-src-678fc82bcf2ec81eca4ecd9233b9a9031acd9b96.tar.gz
Suspend/resume support (mostly for MiniPCI Prism2.5 boards).
Reviewed by: imp
Diffstat (limited to 'sys/dev/wi')
-rw-r--r--sys/dev/wi/if_wi.c3
-rw-r--r--sys/dev/wi/if_wi_pci.c34
-rw-r--r--sys/dev/wi/if_wivar.h1
3 files changed, 36 insertions, 2 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 7340a1c..700c720 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 13d7a82..7dd2536 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 92d908d..fee4460 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);
OpenPOWER on IntegriCloud