diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-31 17:13:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-31 17:13:49 +0000 |
commit | 9da4ff9be0005fda5ba6d021ccff292caaca62f6 (patch) | |
tree | b3bdf7cd5c66003daeb0f71ac899d004c887677e /sys/dev/pci | |
parent | f4451ac9824b3e8c645bc2be6cfca6659bf11fcc (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/pci')
-rw-r--r-- | sys/dev/pci/ahci.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/auich.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/azalia.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/if_alc.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/if_ale.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/if_bge.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/if_em.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/if_lii.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/if_msk.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/if_nfe.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/if_sis.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/pci.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/pciide.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/ppb.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/sili_pci.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/vga_pci.c | 5 |
16 files changed, 71 insertions, 24 deletions
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 |