summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-08-31 17:13:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-08-31 17:13:49 +0000
commit9da4ff9be0005fda5ba6d021ccff292caaca62f6 (patch)
treeb3bdf7cd5c66003daeb0f71ac899d004c887677e /sys/dev
parentf4451ac9824b3e8c645bc2be6cfca6659bf11fcc (diff)
Add DVACT_QUIECE support. This is called before splhigh() and before
DVACT_SUSPEND, therefore DVACT_QUIECE can do standard sleeping operations to get ready. Discussed quite a while back with kettenis and jakemsr, oga suddenly needed it as well and wrote half of it, so it was time to finish it. proofread by miod.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpi.c3
-rw-r--r--sys/dev/ic/dc.c7
-rw-r--r--sys/dev/ic/fxp.c5
-rw-r--r--sys/dev/ic/rtl81x9.c7
-rw-r--r--sys/dev/ic/xl.c5
-rw-r--r--sys/dev/pci/ahci.c6
-rw-r--r--sys/dev/pci/auich.c5
-rw-r--r--sys/dev/pci/azalia.c5
-rw-r--r--sys/dev/pci/if_alc.c7
-rw-r--r--sys/dev/pci/if_ale.c7
-rw-r--r--sys/dev/pci/if_bge.c5
-rw-r--r--sys/dev/pci/if_em.c7
-rw-r--r--sys/dev/pci/if_lii.c7
-rw-r--r--sys/dev/pci/if_msk.c10
-rw-r--r--sys/dev/pci/if_nfe.c5
-rw-r--r--sys/dev/pci/if_sis.c5
-rw-r--r--sys/dev/pci/pci.c5
-rw-r--r--sys/dev/pci/pciide.c5
-rw-r--r--sys/dev/pci/ppb.c5
-rw-r--r--sys/dev/pci/sili_pci.c6
-rw-r--r--sys/dev/pci/vga_pci.c5
-rw-r--r--sys/dev/pcmcia/pcmcia.c15
-rw-r--r--sys/dev/pcmcia/wdc_pcmcia.c5
-rw-r--r--sys/dev/sdmmc/sdhc.c5
-rw-r--r--sys/dev/usb/ehci.c13
25 files changed, 115 insertions, 45 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 43b482aff85..dc9f8fb1d6e 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.211 2010/08/29 18:41:12 jasper Exp $ */
+/* $OpenBSD: acpi.c,v 1.212 2010/08/31 17:13:46 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -1912,6 +1912,7 @@ acpi_prepare_sleep_state(struct acpi_softc *sc, int state)
#endif /* NWSDISPLAY > 0 */
bufq_quiesce();
+ config_suspend(TAILQ_FIRST(&alldevs), DVACT_QUIESCE);
acpi_saved_spl = splhigh();
disable_intr();
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c
index d4e5fc52e0c..50b0776f493 100644
--- a/sys/dev/ic/dc.c
+++ b/sys/dev/ic/dc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dc.c,v 1.118 2010/08/30 23:25:15 deraadt Exp $ */
+/* $OpenBSD: dc.c,v 1.119 2010/08/31 17:13:46 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -3132,6 +3132,9 @@ dc_activate(struct device *self, int act)
int rv;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
if (ifp->if_flags & IFF_RUNNING)
dc_stop(sc, 0);
@@ -3143,7 +3146,7 @@ dc_activate(struct device *self, int act)
dc_init(sc);
break;
}
- return rv;
+ return (rv);
}
void
diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c
index 8cbb5f45dfa..e6e389afd31 100644
--- a/sys/dev/ic/fxp.c
+++ b/sys/dev/ic/fxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxp.c,v 1.104 2010/08/31 16:29:10 deraadt Exp $ */
+/* $OpenBSD: fxp.c,v 1.105 2010/08/31 17:13:46 deraadt Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
@@ -297,6 +297,9 @@ fxp_activate(struct device *self, int act)
int rv;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
if (ifp->if_flags & IFF_RUNNING)
fxp_stop(sc, 1, 0);
diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c
index e1ce7ab70a8..73573128526 100644
--- a/sys/dev/ic/rtl81x9.c
+++ b/sys/dev/ic/rtl81x9.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9.c,v 1.72 2010/08/27 20:22:13 deraadt Exp $ */
+/* $OpenBSD: rtl81x9.c,v 1.73 2010/08/31 17:13:47 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -1258,6 +1258,9 @@ rl_activate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
if (ifp->if_flags & IFF_RUNNING)
rl_stop(sc);
@@ -1269,7 +1272,7 @@ rl_activate(struct device *self, int act)
rl_init(sc);
break;
}
- return rv;
+ return (rv);
}
void
diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c
index 2be0cce4e09..b087ee9f42d 100644
--- a/sys/dev/ic/xl.c
+++ b/sys/dev/ic/xl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xl.c,v 1.93 2010/08/31 16:29:56 deraadt Exp $ */
+/* $OpenBSD: xl.c,v 1.94 2010/08/31 17:13:47 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -203,6 +203,9 @@ xl_activate(struct device *self, int act)
int rv;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
if (ifp->if_flags & IFF_RUNNING) {
xl_reset(sc);
diff --git a/sys/dev/pci/ahci.c b/sys/dev/pci/ahci.c
index c4d9445183e..319b210f521 100644
--- a/sys/dev/pci/ahci.c
+++ b/sys/dev/pci/ahci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ahci.c,v 1.168 2010/07/03 00:23:36 kettenis Exp $ */
+/* $OpenBSD: ahci.c,v 1.169 2010/08/31 17:13:44 deraadt Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -855,6 +855,9 @@ ahci_pci_activate(struct device *self, int act)
int i, rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
rv = config_activate_children(self, act);
for (i = 0; i < AHCI_MAX_PORTS; i++) {
@@ -880,7 +883,6 @@ ahci_pci_activate(struct device *self, int act)
rv = config_activate_children(self, act);
break;
}
-
return (rv);
}
diff --git a/sys/dev/pci/auich.c b/sys/dev/pci/auich.c
index 54e6ec73e8c..a27ce5b68cb 100644
--- a/sys/dev/pci/auich.c
+++ b/sys/dev/pci/auich.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auich.c,v 1.88 2010/08/31 06:12:28 deraadt Exp $ */
+/* $OpenBSD: auich.c,v 1.89 2010/08/31 17:13:44 deraadt Exp $ */
/*
* Copyright (c) 2000,2001 Michael Shalayeff
@@ -570,6 +570,9 @@ auich_activate(struct device *self, int act)
switch (act) {
case DVACT_ACTIVATE:
break;
+ case DVACT_QUIESCE:
+ /* XXX to be filled by jakemsr */
+ break;
case DVACT_SUSPEND:
auich_suspend(sc);
break;
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c
index d4166acf547..f46f20f5649 100644
--- a/sys/dev/pci/azalia.c
+++ b/sys/dev/pci/azalia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia.c,v 1.184 2010/08/31 06:12:28 deraadt Exp $ */
+/* $OpenBSD: azalia.c,v 1.185 2010/08/31 17:13:44 deraadt Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
/*-
@@ -542,6 +542,9 @@ azalia_pci_activate(struct device *self, int act)
switch (act) {
case DVACT_ACTIVATE:
break;
+ case DVACT_QUIESCE:
+ /* XXX to be filled by jakemsr */
+ break;
case DVACT_SUSPEND:
azalia_suspend(sc);
break;
diff --git a/sys/dev/pci/if_alc.c b/sys/dev/pci/if_alc.c
index 83805995029..068f2ed1a04 100644
--- a/sys/dev/pci/if_alc.c
+++ b/sys/dev/pci/if_alc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_alc.c,v 1.7 2010/08/27 17:08:00 jsg Exp $ */
+/* $OpenBSD: if_alc.c,v 1.8 2010/08/31 17:13:44 deraadt Exp $ */
/*-
* Copyright (c) 2009, Pyun YongHyeon <yongari@FreeBSD.org>
* All rights reserved.
@@ -684,6 +684,9 @@ alc_activate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
if (ifp->if_flags & IFF_RUNNING)
alc_stop(sc);
@@ -695,7 +698,7 @@ alc_activate(struct device *self, int act)
alc_init(ifp);
break;
}
- return rv;
+ return (rv);
}
int
diff --git a/sys/dev/pci/if_ale.c b/sys/dev/pci/if_ale.c
index 0107de767a4..db2218336d6 100644
--- a/sys/dev/pci/if_ale.c
+++ b/sys/dev/pci/if_ale.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ale.c,v 1.15 2010/08/27 17:08:00 jsg Exp $ */
+/* $OpenBSD: if_ale.c,v 1.16 2010/08/31 17:13:44 deraadt Exp $ */
/*-
* Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
* All rights reserved.
@@ -606,6 +606,9 @@ ale_activate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
if (ifp->if_flags & IFF_RUNNING)
ale_stop(sc);
@@ -617,7 +620,7 @@ ale_activate(struct device *self, int act)
ale_init(ifp);
break;
}
- return rv;
+ return (rv);
}
int
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 53ca5156013..9a79cfe9275 100644
--- a/sys/dev/pci/if_bge.c
+++ b/sys/dev/pci/if_bge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bge.c,v 1.300 2010/08/31 16:27:36 deraadt Exp $ */
+/* $OpenBSD: if_bge.c,v 1.301 2010/08/31 17:13:44 deraadt Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -2296,6 +2296,9 @@ bge_activate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
rv = config_activate_children(self, act);
if (ifp->if_flags & IFF_RUNNING)
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index afc810ed9c7..10991235aed 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.245 2010/08/27 15:56:09 deraadt Exp $ */
+/* $OpenBSD: if_em.c,v 1.246 2010/08/31 17:13:44 deraadt Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -1880,6 +1880,9 @@ em_activate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
if (ifp->if_flags & IFF_RUNNING)
em_stop(sc, 0);
@@ -1892,7 +1895,7 @@ em_activate(struct device *self, int act)
em_init(sc);
break;
}
- return rv;
+ return (rv);
}
void
diff --git a/sys/dev/pci/if_lii.c b/sys/dev/pci/if_lii.c
index 1b9bb2562ab..018b112239b 100644
--- a/sys/dev/pci/if_lii.c
+++ b/sys/dev/pci/if_lii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_lii.c,v 1.28 2010/08/27 17:08:00 jsg Exp $ */
+/* $OpenBSD: if_lii.c,v 1.29 2010/08/31 17:13:44 deraadt Exp $ */
/*
* Copyright (c) 2007 The NetBSD Foundation.
@@ -293,6 +293,9 @@ lii_activate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
if (ifp->if_flags & IFF_RUNNING)
lii_stop(ifp);
@@ -304,7 +307,7 @@ lii_activate(struct device *self, int act)
lii_init(ifp);
break;
}
- return rv;
+ return (rv);
}
int
diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c
index b6123841892..184d5058371 100644
--- a/sys/dev/pci/if_msk.c
+++ b/sys/dev/pci/if_msk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_msk.c,v 1.87 2010/05/19 15:27:35 oga Exp $ */
+/* $OpenBSD: if_msk.c,v 1.88 2010/08/31 17:13:44 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -1049,6 +1049,9 @@ msk_activate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
rv = config_activate_children(self, act);
break;
@@ -1059,7 +1062,6 @@ msk_activate(struct device *self, int act)
msk_init(sc_if);
break;
}
-
return (rv);
}
@@ -1404,6 +1406,9 @@ mskc_activate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
rv = config_activate_children(self, act);
break;
@@ -1412,7 +1417,6 @@ mskc_activate(struct device *self, int act)
rv = config_activate_children(self, act);
break;
}
-
return (rv);
}
diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c
index c1920c0593f..f5217dfa714 100644
--- a/sys/dev/pci/if_nfe.c
+++ b/sys/dev/pci/if_nfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nfe.c,v 1.94 2010/08/31 16:27:09 deraadt Exp $ */
+/* $OpenBSD: if_nfe.c,v 1.95 2010/08/31 17:13:44 deraadt Exp $ */
/*-
* Copyright (c) 2006, 2007 Damien Bergamini <damien.bergamini@free.fr>
@@ -182,6 +182,9 @@ nfe_activate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
if (ifp->if_flags & IFF_RUNNING)
nfe_stop(ifp, 0);
diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c
index 7069bee550f..e423a87eff1 100644
--- a/sys/dev/pci/if_sis.c
+++ b/sys/dev/pci/if_sis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sis.c,v 1.100 2010/08/31 16:26:19 deraadt Exp $ */
+/* $OpenBSD: if_sis.c,v 1.101 2010/08/31 17:13:44 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -1161,6 +1161,9 @@ sis_activate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
if (ifp->if_flags & IFF_RUNNING)
sis_stop(sc);
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 2bd608f1a98..1698fd846f5 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci.c,v 1.82 2010/08/27 20:31:55 kettenis Exp $ */
+/* $OpenBSD: pci.c,v 1.83 2010/08/31 17:13:44 deraadt Exp $ */
/* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */
/*
@@ -197,6 +197,9 @@ pciactivate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
rv = config_activate_children(self, act);
pci_suspend((struct pci_softc *)self);
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c
index 40aa5ed9cb0..be172ec0cd2 100644
--- a/sys/dev/pci/pciide.c
+++ b/sys/dev/pci/pciide.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciide.c,v 1.320 2010/08/31 16:02:25 deraadt Exp $ */
+/* $OpenBSD: pciide.c,v 1.321 2010/08/31 17:13:44 deraadt Exp $ */
/* $NetBSD: pciide.c,v 1.127 2001/08/03 01:31:08 tsutsui Exp $ */
/*
@@ -1407,6 +1407,9 @@ pciide_activate(struct device *self, int act)
int i;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
rv = config_activate_children(self, act);
diff --git a/sys/dev/pci/ppb.c b/sys/dev/pci/ppb.c
index 39e9a8c4a36..39c2d634b26 100644
--- a/sys/dev/pci/ppb.c
+++ b/sys/dev/pci/ppb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ppb.c,v 1.44 2010/08/17 19:14:52 kettenis Exp $ */
+/* $OpenBSD: ppb.c,v 1.45 2010/08/31 17:13:44 deraadt Exp $ */
/* $NetBSD: ppb.c,v 1.16 1997/06/06 23:48:05 thorpej Exp $ */
/*
@@ -350,6 +350,9 @@ ppbactivate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
rv = config_activate_children(self, act);
diff --git a/sys/dev/pci/sili_pci.c b/sys/dev/pci/sili_pci.c
index 199fb6c21be..2be1405924d 100644
--- a/sys/dev/pci/sili_pci.c
+++ b/sys/dev/pci/sili_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sili_pci.c,v 1.11 2010/08/05 20:21:36 kettenis Exp $ */
+/* $OpenBSD: sili_pci.c,v 1.12 2010/08/31 17:13:44 deraadt Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -206,6 +206,9 @@ sili_pci_activate(struct device *self, int act)
int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
rv = config_activate_children(self, act);
break;
@@ -214,6 +217,5 @@ sili_pci_activate(struct device *self, int act)
rv = config_activate_children(self, act);
break;
}
-
return (rv);
}
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c
index 316eed9af32..6cd967437b3 100644
--- a/sys/dev/pci/vga_pci.c
+++ b/sys/dev/pci/vga_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vga_pci.c,v 1.63 2010/08/08 19:33:35 miod Exp $ */
+/* $OpenBSD: vga_pci.c,v 1.64 2010/08/31 17:13:44 deraadt Exp $ */
/* $NetBSD: vga_pci.c,v 1.3 1998/06/08 06:55:58 thorpej Exp $ */
/*
@@ -311,6 +311,9 @@ vga_pci_activate(struct device *self, int act)
#endif
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
rv = config_activate_children(self, act);
#if !defined(SMALL_KERNEL) && NACPI > 0
diff --git a/sys/dev/pcmcia/pcmcia.c b/sys/dev/pcmcia/pcmcia.c
index 08dc0476296..489144d1880 100644
--- a/sys/dev/pcmcia/pcmcia.c
+++ b/sys/dev/pcmcia/pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmcia.c,v 1.40 2010/08/30 20:33:18 deraadt Exp $ */
+/* $OpenBSD: pcmcia.c,v 1.41 2010/08/31 17:13:47 deraadt Exp $ */
/* $NetBSD: pcmcia.c,v 1.9 1998/08/13 02:10:55 eeh Exp $ */
/*
@@ -143,27 +143,28 @@ pcmcia_activate(struct device *self, int act)
case DVACT_ACTIVATE:
/* No children yet */
break;
- case DVACT_DEACTIVATE:
+ case DVACT_QUIESCE:
+ case DVACT_SUSPEND:
+ case DVACT_RESUME:
for (pf = SIMPLEQ_FIRST(&sc->card.pf_head); pf != NULL;
pf = SIMPLEQ_NEXT(pf, pf_list)) {
if (SIMPLEQ_FIRST(&pf->cfe_head) == NULL ||
pf->child == NULL)
continue;
- config_deactivate(pf->child);
+ config_suspend(pf->child, act);
}
break;
- case DVACT_SUSPEND:
- case DVACT_RESUME:
+ case DVACT_DEACTIVATE:
for (pf = SIMPLEQ_FIRST(&sc->card.pf_head); pf != NULL;
pf = SIMPLEQ_NEXT(pf, pf_list)) {
if (SIMPLEQ_FIRST(&pf->cfe_head) == NULL ||
pf->child == NULL)
continue;
- config_suspend(pf->child, act);
+ config_deactivate(pf->child);
}
break;
}
- return 0;
+ return (0);
}
void
diff --git a/sys/dev/pcmcia/wdc_pcmcia.c b/sys/dev/pcmcia/wdc_pcmcia.c
index 97d29d4ed10..b4d10b57bd3 100644
--- a/sys/dev/pcmcia/wdc_pcmcia.c
+++ b/sys/dev/pcmcia/wdc_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc_pcmcia.c,v 1.23 2010/08/30 20:33:18 deraadt Exp $ */
+/* $OpenBSD: wdc_pcmcia.c,v 1.24 2010/08/31 17:13:47 deraadt Exp $ */
/* $NetBSD: wdc_pcmcia.c,v 1.19 1999/02/19 21:49:43 abs Exp $ */
/*-
@@ -442,6 +442,9 @@ wdc_pcmcia_activate(self, act)
}
rv = config_activate_children(self, act);
break;
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
rv = config_activate_children(self, act);
if (sc->sc_ih)
diff --git a/sys/dev/sdmmc/sdhc.c b/sys/dev/sdmmc/sdhc.c
index e2704bb6547..2a4d5f21a1b 100644
--- a/sys/dev/sdmmc/sdhc.c
+++ b/sys/dev/sdmmc/sdhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhc.c,v 1.31 2010/08/31 16:25:28 deraadt Exp $ */
+/* $OpenBSD: sdhc.c,v 1.32 2010/08/31 17:13:47 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -256,6 +256,9 @@ sdhc_activate(struct device *self, int act)
int n, i, rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
/* XXX poll for command completion or suspend command
* in progress */
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c
index adedd16a391..38bc81d01e1 100644
--- a/sys/dev/usb/ehci.c
+++ b/sys/dev/usb/ehci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci.c,v 1.108 2010/08/30 21:30:15 deraadt Exp $ */
+/* $OpenBSD: ehci.c,v 1.109 2010/08/31 17:13:47 deraadt Exp $ */
/* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */
/*
@@ -1035,10 +1035,8 @@ ehci_activate(struct device *self, int act)
switch (act) {
case DVACT_ACTIVATE:
break;
- case DVACT_DEACTIVATE:
- if (sc->sc_child != NULL)
- rv = config_deactivate(sc->sc_child);
- sc->sc_dying = 1;
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
break;
case DVACT_SUSPEND:
sc->sc_bus.use_polling++;
@@ -1134,6 +1132,11 @@ ehci_activate(struct device *self, int act)
sc->sc_bus.use_polling--;
rv = config_activate_children(self, act);
break;
+ case DVACT_DEACTIVATE:
+ if (sc->sc_child != NULL)
+ rv = config_deactivate(sc->sc_child);
+ sc->sc_dying = 1;
+ break;
}
return (rv);
}