summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2010-07-01 18:08:17 +0000
committerderaadt <deraadt@openbsd.org>2010-07-01 18:08:17 +0000
commitae2d6720e4fd05677dac9fa4fd0324bfa4a9c52b (patch)
treecb2d0df61a3cb9f88bf6c3fd3cad530bd61d506a
parentsync (diff)
downloadwireguard-openbsd-ae2d6720e4fd05677dac9fa4fd0324bfa4a9c52b.tar.xz
wireguard-openbsd-ae2d6720e4fd05677dac9fa4fd0324bfa4a9c52b.zip
suspend/resume to the same level as apm machines. note: that is kind
of broken since it does not detach+reattach the card (which it has to) ok mlarkin
-rw-r--r--sys/dev/pci/sdhc_pci.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/dev/pci/sdhc_pci.c b/sys/dev/pci/sdhc_pci.c
index 0e04a2baf51..1c290a3741a 100644
--- a/sys/dev/pci/sdhc_pci.c
+++ b/sys/dev/pci/sdhc_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhc_pci.c,v 1.7 2007/10/30 18:13:45 chl Exp $ */
+/* $OpenBSD: sdhc_pci.c,v 1.8 2010/07/01 18:08:17 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -46,10 +46,12 @@ struct sdhc_pci_softc {
int sdhc_pci_match(struct device *, void *, void *);
void sdhc_pci_attach(struct device *, struct device *, void *);
+int sdhc_pci_activate(struct device *, int act);
void sdhc_takecontroller(struct pci_attach_args *);
struct cfattach sdhc_pci_ca = {
- sizeof(struct sdhc_pci_softc), sdhc_pci_match, sdhc_pci_attach
+ sizeof(struct sdhc_pci_softc), sdhc_pci_match, sdhc_pci_attach,
+ NULL, sdhc_pci_activate
};
int
@@ -148,6 +150,20 @@ sdhc_pci_attach(struct device *parent, struct device *self, void *aux)
(void)shutdownhook_establish(sdhc_shutdown, &sc->sc);
}
+int
+sdhc_pci_activate(struct device *self, int act)
+{
+ switch (act) {
+ case DVACT_SUSPEND:
+ sdhc_power(PWR_SUSPEND, self);
+ break;
+ case DVACT_RESUME:
+ sdhc_power(PWR_RESUME, self);
+ break;
+ }
+ return (0);
+}
+
void
sdhc_takecontroller(struct pci_attach_args *pa)
{