summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2009-11-23 01:28:12 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2009-11-23 01:28:12 +0000
commita25a111db6a5fdbc1444fb27ec537c4393c713d7 (patch)
tree757b43f06a7712cd8d61719e880d220037122f4d /sys/dev/pci
parentc77c5a37b9f7607a16a880f936c638a50304b06d (diff)
PCI suspend/resume plumbing. This code is currently not called.
ok kettenis@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/pci.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index a0eae5a59cd..1a972470d63 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci.c,v 1.68 2009/11/05 20:30:47 kettenis Exp $ */
+/* $OpenBSD: pci.c,v 1.69 2009/11/23 01:28:11 mlarkin Exp $ */
/* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */
/*
@@ -49,6 +49,7 @@ int pcimatch(struct device *, void *, void *);
void pciattach(struct device *, struct device *, void *);
int pcidetach(struct device *, int);
void pcipower(int, void *);
+int pciactivate(struct device *, int);
#define NMAPREG ((PCI_MAPREG_END - PCI_MAPREG_START) / \
sizeof(pcireg_t))
@@ -67,7 +68,7 @@ extern int allowaperture;
#endif
struct cfattach pci_ca = {
- sizeof(struct pci_softc), pcimatch, pciattach, pcidetach
+ sizeof(struct pci_softc), pcimatch, pciattach, pcidetach, pciactivate
};
struct cfdriver pci_cd = {
@@ -175,6 +176,22 @@ pcidetach(struct device *self, int flags)
return pci_detach_devices((struct pci_softc *)self, flags);
}
+int
+pciactivate(struct device *self, int act)
+{
+ int rv = 0;
+
+ switch (act) {
+ case DVACT_RESUME:
+ pcipower(PWR_RESUME, self);
+ break;
+ case DVACT_SUSPEND:
+ pcipower(PWR_SUSPEND, self);
+ break;
+ }
+ return (rv);
+}
+
/* save and restore the pci config space */
void
pcipower(int why, void *arg)