summaryrefslogtreecommitdiffstats
path: root/sys/dev/an
diff options
context:
space:
mode:
authorambrisko <ambrisko@FreeBSD.org>2003-02-05 03:37:42 +0000
committerambrisko <ambrisko@FreeBSD.org>2003-02-05 03:37:42 +0000
commit9a4fb866c26c0f486cf7978f3d00a047ad58c4f3 (patch)
tree29481a893cd0d42c222d159a9eb7cc631d66f870 /sys/dev/an
parent914d9fc8a8a96b9270275e4aa0a60882ba661e91 (diff)
downloadFreeBSD-src-9a4fb866c26c0f486cf7978f3d00a047ad58c4f3.zip
FreeBSD-src-9a4fb866c26c0f486cf7978f3d00a047ad58c4f3.tar.gz
Support for suspend/resume in laptops. Loosely based on the wi(4) patches
but not quite. The memory descriptors and most of the card parameters need to be writen to the card. MFC in: 3 days
Diffstat (limited to 'sys/dev/an')
-rw-r--r--sys/dev/an/if_an.c20
-rw-r--r--sys/dev/an/if_an_pci.c20
-rw-r--r--sys/dev/an/if_anreg.h1
3 files changed, 41 insertions, 0 deletions
diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c
index 1197012..7179943 100644
--- a/sys/dev/an/if_an.c
+++ b/sys/dev/an/if_an.c
@@ -2832,6 +2832,26 @@ an_shutdown(dev)
return;
}
+void
+an_resume(dev)
+ device_t dev;
+{
+ struct an_softc *sc;
+ struct ifnet *ifp;
+ sc = device_get_softc(dev);
+ ifp = &sc->arpcom.ac_if;
+
+ an_reset(sc);
+ if (sc->mpi350)
+ an_init_mpi350_desc(sc);
+ an_init(sc);
+
+ if (ifp->if_flags & IFF_UP)
+ an_start(ifp);
+
+ return;
+}
+
#ifdef ANCACHE
/* Aironet signal strength cache code.
* store signal/noise/quality on per MAC src basis in
diff --git a/sys/dev/an/if_an_pci.c b/sys/dev/an/if_an_pci.c
index 2fe45e0..c219024 100644
--- a/sys/dev/an/if_an_pci.c
+++ b/sys/dev/an/if_an_pci.c
@@ -116,6 +116,8 @@ static struct an_type an_devs[] = {
static int an_probe_pci (device_t);
static int an_attach_pci (device_t);
static int an_detach_pci (device_t);
+static int an_suspend_pci (device_t);
+static int an_resume_pci (device_t);
static int
an_probe_pci(device_t dev)
@@ -261,12 +263,30 @@ an_detach_pci(device_t dev)
return (0);
}
+static int
+an_suspend_pci(device_t dev)
+{
+ an_shutdown(dev);
+
+ return (0);
+}
+
+static int
+an_resume_pci(device_t dev)
+{
+ an_resume(dev);
+
+ return (0);
+}
+
static device_method_t an_pci_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, an_probe_pci),
DEVMETHOD(device_attach, an_attach_pci),
DEVMETHOD(device_detach, an_detach_pci),
DEVMETHOD(device_shutdown, an_shutdown),
+ DEVMETHOD(device_suspend, an_suspend_pci),
+ DEVMETHOD(device_resume, an_resume_pci),
{ 0, 0 }
};
diff --git a/sys/dev/an/if_anreg.h b/sys/dev/an/if_anreg.h
index 20ed9bb..165f760 100644
--- a/sys/dev/an/if_anreg.h
+++ b/sys/dev/an/if_anreg.h
@@ -503,6 +503,7 @@ int an_alloc_aux_memory (device_t, int, int);
int an_alloc_irq (device_t, int, int);
int an_probe (device_t);
void an_shutdown (device_t);
+void an_resume (device_t);
int an_attach (struct an_softc *, int, int);
void an_stop (struct an_softc *);
OpenPOWER on IntegriCloud