summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-09-07 16:21:48 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-09-07 16:21:48 +0000
commit0909b33ee356b8b24e8cfd8ef9abfcce75eac449 (patch)
tree60b4dbc9eaed4dfda443b0bf3fa9ec06a75b03ad /sys
parent06c96fb315950bff13bd7a73d355ebdc21e85191 (diff)
remove the powerhook code. All architectures now use the ca_activate tree
traversal code to suspend/resume ok oga kettenis blambert
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/arm/xscale/pxa27x_udc.c15
-rw-r--r--sys/arch/arm/xscale/pxa27x_udc.h1
-rw-r--r--sys/arch/arm/xscale/pxa2x0_apm.c4
-rw-r--r--sys/arch/arm/xscale/pxa2x0_com.c11
-rw-r--r--sys/arch/arm/xscale/pxa2x0_ohci.c23
-rw-r--r--sys/arch/beagle/dev/omap_com.c6
-rw-r--r--sys/arch/beagle/dev/omdisplay.c14
-rw-r--r--sys/arch/beagle/dev/omehci.c27
-rw-r--r--sys/arch/beagle/dev/omohci.c19
-rw-r--r--sys/arch/loongson/dev/ohci_voyager.c7
-rw-r--r--sys/arch/zaurus/dev/zaurus_apm.c6
-rw-r--r--sys/arch/zaurus/dev/zaurus_audio.c24
-rw-r--r--sys/arch/zaurus/dev/zaurus_kbd.c16
-rw-r--r--sys/arch/zaurus/dev/zaurus_scoop.c15
-rw-r--r--sys/arch/zaurus/dev/zaurus_ssp.c13
-rw-r--r--sys/arch/zaurus/dev/zts.c21
-rw-r--r--sys/arch/zaurus/zaurus/zaurus_lcd.c12
-rw-r--r--sys/dev/cardbus/if_re_cardbus.c22
-rw-r--r--sys/dev/cardbus/ohci_cardbus.c7
-rw-r--r--sys/dev/ic/ath.c16
-rw-r--r--sys/dev/ic/athvar.h4
-rw-r--r--sys/dev/ic/atw.c20
-rw-r--r--sys/dev/ic/atwvar.h4
-rw-r--r--sys/dev/ic/dc.c15
-rw-r--r--sys/dev/ic/dcreg.h3
-rw-r--r--sys/dev/ic/fxp.c20
-rw-r--r--sys/dev/ic/fxpvar.h3
-rw-r--r--sys/dev/ic/pgt.c16
-rw-r--r--sys/dev/ic/rt2560.c30
-rw-r--r--sys/dev/ic/rt2560var.h3
-rw-r--r--sys/dev/ic/rt2661.c30
-rw-r--r--sys/dev/ic/rt2661var.h3
-rw-r--r--sys/dev/ic/rt2860.c30
-rw-r--r--sys/dev/ic/rt2860var.h3
-rw-r--r--sys/dev/ic/rtl81x9.c14
-rw-r--r--sys/dev/ic/rtl81x9reg.h3
-rw-r--r--sys/dev/ic/rtw.c37
-rw-r--r--sys/dev/ic/rtwvar.h8
-rw-r--r--sys/dev/ic/xl.c13
-rw-r--r--sys/dev/ic/xlreg.h4
-rw-r--r--sys/dev/isa/aps.c11
-rw-r--r--sys/dev/isa/i82365_isa.c3
-rw-r--r--sys/dev/isa/i82365_isapnp.c3
-rw-r--r--sys/dev/pci/arc.c4
-rw-r--r--sys/dev/pci/auacer.c14
-rw-r--r--sys/dev/pci/auglx.c14
-rw-r--r--sys/dev/pci/auich.c13
-rw-r--r--sys/dev/pci/autri.c11
-rw-r--r--sys/dev/pci/cs4280.c12
-rw-r--r--sys/dev/pci/cs4281.c13
-rw-r--r--sys/dev/pci/esa.c16
-rw-r--r--sys/dev/pci/esavar.h3
-rw-r--r--sys/dev/pci/eso.c14
-rw-r--r--sys/dev/pci/esovar.h3
-rw-r--r--sys/dev/pci/i82365_pci.c3
-rw-r--r--sys/dev/pci/if_bge.c10
-rw-r--r--sys/dev/pci/if_bgereg.h3
-rw-r--r--sys/dev/pci/if_bnxreg.h3
-rw-r--r--sys/dev/pci/if_em.c16
-rw-r--r--sys/dev/pci/if_em.h3
-rw-r--r--sys/dev/pci/if_ipw.c11
-rw-r--r--sys/dev/pci/if_ipwvar.h3
-rw-r--r--sys/dev/pci/if_iwi.c11
-rw-r--r--sys/dev/pci/if_iwivar.h3
-rw-r--r--sys/dev/pci/if_iwn.c15
-rw-r--r--sys/dev/pci/if_iwnvar.h3
-rw-r--r--sys/dev/pci/if_nfe.c11
-rw-r--r--sys/dev/pci/if_nfevar.h3
-rw-r--r--sys/dev/pci/if_re_pci.c6
-rw-r--r--sys/dev/pci/if_wi_pci.c13
-rw-r--r--sys/dev/pci/if_wpi.c15
-rw-r--r--sys/dev/pci/if_wpivar.h3
-rw-r--r--sys/dev/pci/maestro.c14
-rw-r--r--sys/dev/pci/neo.c14
-rw-r--r--sys/dev/pci/ohci_pci.c11
-rw-r--r--sys/dev/pci/pccbb.c11
-rw-r--r--sys/dev/pci/pci.c18
-rw-r--r--sys/dev/pci/pcivar.h3
-rw-r--r--sys/dev/pci/sdhc_pci.c5
-rw-r--r--sys/dev/pci/yds.c11
-rw-r--r--sys/dev/pci/ydsreg.h3
-rw-r--r--sys/dev/pcmcia/if_ray.c8
-rw-r--r--sys/dev/pcmcia/pcmcia.c10
-rw-r--r--sys/dev/sdmmc/sdhc.c8
-rw-r--r--sys/dev/sdmmc/sdhcvar.h3
-rw-r--r--sys/dev/usb/ehci.c14
-rw-r--r--sys/dev/usb/ehcivar.h3
-rw-r--r--sys/dev/usb/ohci.c15
-rw-r--r--sys/dev/usb/ohcivar.h4
-rw-r--r--sys/dev/usb/uhci.c21
-rw-r--r--sys/dev/usb/uhcivar.h3
-rw-r--r--sys/dev/vesa/vesafbvar.h3
-rw-r--r--sys/kern/kern_subr.c72
-rw-r--r--sys/scsi/cd.c35
-rw-r--r--sys/sys/systm.h9
95 files changed, 109 insertions, 1000 deletions
diff --git a/sys/arch/arm/xscale/pxa27x_udc.c b/sys/arch/arm/xscale/pxa27x_udc.c
index 9f2d4a014eb..23a06d39a6f 100644
--- a/sys/arch/arm/xscale/pxa27x_udc.c
+++ b/sys/arch/arm/xscale/pxa27x_udc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pxa27x_udc.c,v 1.26 2010/08/30 21:35:55 deraadt Exp $ */
+/* $OpenBSD: pxa27x_udc.c,v 1.27 2010/09/07 16:21:35 deraadt Exp $ */
/*
* Copyright (c) 2007 Dale Rahn <drahn@openbsd.org>
@@ -52,8 +52,6 @@ struct pxaudc_pipe {
// LIST_ENTRY(pxaudc_pipe) list;
};
-void pxaudc_powerhook(int, void *);
-
void pxaudc_enable(struct pxaudc_softc *);
void pxaudc_disable(struct pxaudc_softc *);
void pxaudc_read_ep0(struct pxaudc_softc *, usbf_xfer_handle);
@@ -200,8 +198,6 @@ pxaudc_attach(struct pxaudc_softc *sc, void *aux)
return;
}
- sc->sc_powerhook = powerhook_establish(pxaudc_powerhook, sc);
-
/* Set up the bus struct. */
sc->sc_bus.methods = &pxaudc_bus_methods;
sc->sc_bus.pipe_size = sizeof(struct pxaudc_pipe);
@@ -228,9 +224,6 @@ pxaudc_attach(struct pxaudc_softc *sc, void *aux)
int
pxaudc_detach(struct pxaudc_softc *sc, int flags)
{
- if (sc->sc_powerhook != NULL)
- powerhook_disestablish(sc->sc_powerhook);
-
if (sc->sc_conn_ih != NULL)
pxa2x0_gpio_intr_disestablish(sc->sc_conn_ih);
@@ -261,12 +254,6 @@ pxaudc_activate(struct pxaudc_softc *self, int act)
return 0;
}
-void
-pxaudc_powerhook(int why, void *arg)
-{
- pxaudc_activate(arg, why);
-}
-
/*
* Register manipulation
*/
diff --git a/sys/arch/arm/xscale/pxa27x_udc.h b/sys/arch/arm/xscale/pxa27x_udc.h
index 4dbe728af6f..c7a48149825 100644
--- a/sys/arch/arm/xscale/pxa27x_udc.h
+++ b/sys/arch/arm/xscale/pxa27x_udc.h
@@ -32,7 +32,6 @@ struct pxaudc_softc {
bus_size_t sc_size;
void *sc_ih;
void *sc_conn_ih;
- void *sc_powerhook;
SIMPLEQ_HEAD(,usbf_xfer) sc_free_xfers; /* recycled xfers */
u_int32_t sc_icr0; /* enabled EP interrupts */
u_int32_t sc_icr1; /* enabled EP interrupts */
diff --git a/sys/arch/arm/xscale/pxa2x0_apm.c b/sys/arch/arm/xscale/pxa2x0_apm.c
index 4ac3fe336c8..d9a153c6452 100644
--- a/sys/arch/arm/xscale/pxa2x0_apm.c
+++ b/sys/arch/arm/xscale/pxa2x0_apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pxa2x0_apm.c,v 1.34 2010/08/30 21:37:52 deraadt Exp $ */
+/* $OpenBSD: pxa2x0_apm.c,v 1.35 2010/09/07 16:21:35 deraadt Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@@ -342,7 +342,7 @@ apm_resume(struct pxa2x0_apm_softc *sc)
/*
* Clear the OTG Peripheral hold after running the pxaudc and pxaohci
- * powerhooks to re-enable their operation. See 3.8.1.2
+ * ca_activate to re-enable their operation. See 3.8.1.2
*/
/* XXX ifdef NPXAUDC > 0 */
bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PSSR, PSSR_OTGPH);
diff --git a/sys/arch/arm/xscale/pxa2x0_com.c b/sys/arch/arm/xscale/pxa2x0_com.c
index c14344ce10b..64a65bd880d 100644
--- a/sys/arch/arm/xscale/pxa2x0_com.c
+++ b/sys/arch/arm/xscale/pxa2x0_com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pxa2x0_com.c,v 1.11 2010/08/30 21:35:55 deraadt Exp $ */
+/* $OpenBSD: pxa2x0_com.c,v 1.12 2010/09/07 16:21:35 deraadt Exp $ */
/* $NetBSD: pxa2x0_com.c,v 1.4 2003/07/15 00:24:55 lukem Exp $ */
/*
@@ -64,7 +64,6 @@
int pxauart_match(struct device *, void *, void *);
void pxauart_attach(struct device *, struct device *, void *);
int pxauart_activate(struct device *, int);
-void pxauart_powerhook(int why, void *);
struct cfattach com_pxaip_ca = {
sizeof (struct com_softc), pxauart_match, pxauart_attach, NULL,
@@ -145,8 +144,6 @@ pxauart_attach(struct device *parent, struct device *self, void *aux)
(void)pxa2x0_intr_establish(pxa->pxa_intr, IPL_TTY, comintr,
sc, sc->sc_dev.dv_xname);
-
- (void)powerhook_establish(pxauart_powerhook, sc);
}
int
@@ -182,9 +179,3 @@ pxauart_activate(struct device *self, int act)
}
return 0;
}
-
-void
-pxauart_powerhook(int why, void *arg)
-{
- pxauart_activate(arg, why);
-}
diff --git a/sys/arch/arm/xscale/pxa2x0_ohci.c b/sys/arch/arm/xscale/pxa2x0_ohci.c
index 1ca904c5bab..74fb6b51c82 100644
--- a/sys/arch/arm/xscale/pxa2x0_ohci.c
+++ b/sys/arch/arm/xscale/pxa2x0_ohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pxa2x0_ohci.c,v 1.23 2010/08/30 21:30:15 deraadt Exp $ */
+/* $OpenBSD: pxa2x0_ohci.c,v 1.24 2010/09/07 16:21:35 deraadt Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -41,7 +41,6 @@ int pxaohci_match(struct device *, void *, void *);
void pxaohci_attach(struct device *, struct device *, void *);
int pxaohci_detach(struct device *, int);
int pxaohci_activate(struct device *, int);
-void pxaohci_powerhook(int, void *);
struct pxaohci_softc {
ohci_softc_t sc;
@@ -127,11 +126,6 @@ unsupported:
return;
}
- sc->sc.sc_powerhook = powerhook_establish(pxaohci_powerhook, sc);
- if (sc->sc.sc_powerhook == NULL)
- printf("%s: cannot establish powerhook\n",
- sc->sc.sc_bus.bdev.dv_xname);
-
sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
usbctlprint);
}
@@ -146,11 +140,6 @@ pxaohci_detach(struct device *self, int flags)
if (rv)
return (rv);
- if (sc->sc.sc_powerhook != NULL) {
- powerhook_disestablish(sc->sc.sc_powerhook);
- sc->sc.sc_powerhook = NULL;
- }
-
if (sc->sc_ih != NULL) {
pxa2x0_intr_disestablish(sc->sc_ih);
sc->sc_ih = NULL;
@@ -178,7 +167,7 @@ pxaohci_activate(struct device *self, int act)
switch (act) {
case DVACT_SUSPEND:
sc->sc.sc_bus.use_polling++;
- ohci_powerhook(act, &sc->sc);
+ ohci_activate((struct device *)&sc->sc, act);
pxa2x0_clkman_config(CKEN_USBHC, 0);
sc->sc.sc_bus.use_polling--;
break;
@@ -186,7 +175,7 @@ pxaohci_activate(struct device *self, int act)
sc->sc.sc_bus.use_polling++;
pxa2x0_clkman_config(CKEN_USBHC, 1);
pxaohci_enable(sc);
- ohci_powerhook(act, &sc->sc);
+ ohci_activate((struct device *)&sc->sc, act);
sc->sc.sc_bus.use_polling--;
break;
}
@@ -194,12 +183,6 @@ pxaohci_activate(struct device *self, int act)
}
void
-pxaohci_powerhook(int why, void *arg)
-{
- pxaohci_activate(arg, why);
-}
-
-void
pxaohci_enable(struct pxaohci_softc *sc)
{
u_int32_t hr;
diff --git a/sys/arch/beagle/dev/omap_com.c b/sys/arch/beagle/dev/omap_com.c
index c189293f524..5a83d057ed8 100644
--- a/sys/arch/beagle/dev/omap_com.c
+++ b/sys/arch/beagle/dev/omap_com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omap_com.c,v 1.3 2010/08/30 21:32:20 deraadt Exp $ */
+/* $OpenBSD: omap_com.c,v 1.4 2010/09/07 16:21:37 deraadt Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
* All rights reserved.
@@ -116,10 +116,6 @@ omapuart_attach(struct device *parent, struct device *self, void *aux)
(void)intc_intr_establish(aa->aa_intr, IPL_TTY, comintr,
sc, sc->sc_dev.dv_xname);
-
-#if 0
- (void)powerhook_establish(&omapuart_powerhook, sc);
-#endif
}
int
diff --git a/sys/arch/beagle/dev/omdisplay.c b/sys/arch/beagle/dev/omdisplay.c
index 85cdfdcca56..bf321881a60 100644
--- a/sys/arch/beagle/dev/omdisplay.c
+++ b/sys/arch/beagle/dev/omdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omdisplay.c,v 1.4 2010/08/30 21:32:20 deraadt Exp $ */
+/* $OpenBSD: omdisplay.c,v 1.5 2010/09/07 16:21:37 deraadt Exp $ */
/*
* Copyright (c) 2007 Dale Rahn <drahn@openbsd.org>
*
@@ -416,8 +416,6 @@ struct omdisplay_softc {
int sc_nscreens;
LIST_HEAD(,omdisplay_screen) sc_screens;
- void *sc_ph; /* powerhook */
-
struct omdisplay_panel_data *sc_geometry;
struct omdisplay_screen *sc_active;
};
@@ -441,7 +439,6 @@ void omdisplay_set_backlight(int on);
void omdisplay_blank(int blank);
void omdisplay_suspend(struct omdisplay_softc *sc);
void omdisplay_resume(struct omdisplay_softc *sc);
-void omdisplay_powerhook(int why, void *v);
void omdisplay_initialize(struct omdisplay_softc *sc,
struct omdisplay_panel_data *geom);
void omdisplay_setup_rasops(struct omdisplay_softc *sc,
@@ -573,9 +570,6 @@ omdisplay_attach(struct device *parent, struct device *self, void *args)
(void)config_found(self, &wsaa, wsemuldisplaydevprint);
/* backlight? */
-
- /* powerhook? */
- sc->sc_ph = powerhook_establish(omdisplay_powerhook, sc);
}
@@ -884,12 +878,6 @@ omdisplay_activate(struct device *self, int act)
}
void
-omdisplay_powerhook(int why, void *v)
-{
- return omdisplay_activate(v, why);
-}
-
-void
omdisplay_initialize(struct omdisplay_softc *sc,
struct omdisplay_panel_data *geom)
{
diff --git a/sys/arch/beagle/dev/omehci.c b/sys/arch/beagle/dev/omehci.c
index a4c2cd58bd0..98f81147f76 100644
--- a/sys/arch/beagle/dev/omehci.c
+++ b/sys/arch/beagle/dev/omehci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omehci.c,v 1.3 2010/08/30 21:32:20 deraadt Exp $ */
+/* $OpenBSD: omehci.c,v 1.4 2010/09/07 16:21:37 deraadt Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -41,7 +41,6 @@ int omehci_match(struct device *, void *, void *);
void omehci_attach(struct device *, struct device *, void *);
int omehci_detach(struct device *, int);
int omehci_activate(struct device *, int);
-void omehci_powerhook(int, void *);
struct omehci_softc {
ehci_softc_t sc;
@@ -137,11 +136,6 @@ omehci_attach(struct device *parent, struct device *self, void *aux)
return;
}
-#if 0
- sc->sc.sc_powerhook = powerhook_establish(omehci_powerhook, sc);
- if (sc->sc.sc_powerhook == NULL)
- printf("%s: cannot establish powerhook\n", devname);
-#endif
sc->sc.sc_shutdownhook = shutdownhook_establish(ehci_shutdown, &sc->sc);
sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
@@ -158,13 +152,6 @@ omehci_detach(struct device *self, int flags)
if (rv)
return (rv);
-#if 0
- if (sc->sc.sc_powerhook != NULL) {
- powerhook_disestablish(sc->sc.sc_powerhook);
- sc->sc.sc_powerhook = NULL;
- }
-#endif
-
if (sc->sc_ih != NULL) {
intc_intr_disestablish(sc->sc_ih);
sc->sc_ih = NULL;
@@ -192,7 +179,7 @@ omehci_activate(struct device *self, int act)
case DVACT_SUSPEND:
sc->sc.sc_bus.use_polling++;
#if 0
- ohci_powerhook(act, &sc->sc);
+ ohci_activate(&sc->sc, act);
prcm_disableclock(PRCM_CLK_EN_USB);
#endif
sc->sc.sc_bus.use_polling--;
@@ -202,7 +189,7 @@ omehci_activate(struct device *self, int act)
prcm_enableclock(PRCM_CLK_EN_USB);
#if 0
omehci_enable(sc);
- ohci_powerhook(act, &sc->sc);
+ ohci_activate(&sc->sc, act);
#endif
sc->sc.sc_bus.use_polling--;
break;
@@ -212,14 +199,6 @@ omehci_activate(struct device *self, int act)
#if 0
void
-omehci_powerhook(int why, void *arg)
-{
- omehci_activate(arg, why);
-}
-#endif
-
-#if 0
-void
omehci_enable(struct omehci_softc *sc)
{
u_int32_t hr;
diff --git a/sys/arch/beagle/dev/omohci.c b/sys/arch/beagle/dev/omohci.c
index 843f74778e7..94f0ce998e4 100644
--- a/sys/arch/beagle/dev/omohci.c
+++ b/sys/arch/beagle/dev/omohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omohci.c,v 1.3 2010/08/30 21:32:20 deraadt Exp $ */
+/* $OpenBSD: omohci.c,v 1.4 2010/09/07 16:21:37 deraadt Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -96,7 +96,6 @@ int omohci_match(struct device *, void *, void *);
void omohci_attach(struct device *, struct device *, void *);
int omohci_detach(struct device *, int);
int omohci_activate(struct device *, int);
-void omohci_powerhook(int, void *);
struct omohci_softc {
ohci_softc_t sc;
@@ -225,11 +224,6 @@ omohci_attach(struct device *parent, struct device *self, void *aux)
return;
}
- sc->sc.sc_powerhook = powerhook_establish(omohci_powerhook, sc);
- if (sc->sc.sc_powerhook == NULL)
- printf("%s: cannot establish powerhook\n",
- sc->sc.sc_bus.bdev.dv_xname);
-
sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
usbctlprint);
}
@@ -244,11 +238,6 @@ omohci_detach(struct device *self, int flags)
if (rv)
return (rv);
- if (sc->sc.sc_powerhook != NULL) {
- powerhook_disestablish(sc->sc.sc_powerhook);
- sc->sc.sc_powerhook = NULL;
- }
-
if (sc->sc_ih0 != NULL) {
intc_intr_disestablish(sc->sc_ih0);
intc_intr_disestablish(sc->sc_ih1);
@@ -308,12 +297,6 @@ omohci_activate(struct device *self, int act)
return 0;
}
-int
-omohci_powerhook(int why, void *arg)
-{
- omohci_activate(arg, why);
-}
-
void
omohci_enable(struct omohci_softc *sc)
{
diff --git a/sys/arch/loongson/dev/ohci_voyager.c b/sys/arch/loongson/dev/ohci_voyager.c
index 9bac45f83cd..be97de1054b 100644
--- a/sys/arch/loongson/dev/ohci_voyager.c
+++ b/sys/arch/loongson/dev/ohci_voyager.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci_voyager.c,v 1.2 2010/08/30 21:30:17 deraadt Exp $ */
+/* $OpenBSD: ohci_voyager.c,v 1.3 2010/09/07 16:21:38 deraadt Exp $ */
/* OpenBSD: ohci_pci.c,v 1.33 2008/06/26 05:42:17 ray Exp */
/* $NetBSD: ohci_pci.c,v 1.23 2002/10/02 16:51:47 thorpej Exp $ */
@@ -176,11 +176,6 @@ ohci_voyager_attach_deferred(struct device *self)
return;
}
- sc->sc.sc_powerhook = powerhook_establish(ohci_powerhook, &sc->sc);
- if (sc->sc.sc_powerhook == NULL)
- printf("%s: unable to establish powerhook\n",
- sc->sc.sc_bus.bdev.dv_xname);
-
splx(s);
/* Attach usb device. */
diff --git a/sys/arch/zaurus/dev/zaurus_apm.c b/sys/arch/zaurus/dev/zaurus_apm.c
index 976a95db3b3..fdcd91475f0 100644
--- a/sys/arch/zaurus/dev/zaurus_apm.c
+++ b/sys/arch/zaurus/dev/zaurus_apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_apm.c,v 1.19 2010/08/31 17:13:46 deraadt Exp $ */
+/* $OpenBSD: zaurus_apm.c,v 1.20 2010/09/07 16:21:41 deraadt Exp $ */
/*
* Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de>
@@ -561,7 +561,7 @@ zapm_power_info(struct pxa2x0_apm_softc *pxa_sc, struct apm_power_info *power)
}
/*
- * Called before suspending when all powerhooks are done.
+ * Called before suspending when all ca_activate functions are done.
*/
void
zapm_suspend(struct pxa2x0_apm_softc *pxa_sc)
@@ -588,7 +588,7 @@ zapm_suspend(struct pxa2x0_apm_softc *pxa_sc)
/*
* Called after wake-up from suspend with interrupts still disabled,
- * before any powerhooks are done.
+ * before any ca_activate functions are done.
*/
int
zapm_resume(struct pxa2x0_apm_softc *pxa_sc)
diff --git a/sys/arch/zaurus/dev/zaurus_audio.c b/sys/arch/zaurus/dev/zaurus_audio.c
index 2bd220e2c94..ec620d0dbf5 100644
--- a/sys/arch/zaurus/dev/zaurus_audio.c
+++ b/sys/arch/zaurus/dev/zaurus_audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_audio.c,v 1.13 2010/08/30 21:35:57 deraadt Exp $ */
+/* $OpenBSD: zaurus_audio.c,v 1.14 2010/09/07 16:21:41 deraadt Exp $ */
/*
* Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org>
@@ -18,7 +18,6 @@
/*
* TODO:
- * - powerhooks (currently only works until first suspend)
* - record support
*/
@@ -57,7 +56,6 @@ int zaudio_match(struct device *, void *, void *);
void zaudio_attach(struct device *, struct device *, void *);
int zaudio_detach(struct device *, int);
int zaudio_activate(struct device *, int);
-void zaudio_powerhook(int, void *);
#define ZAUDIO_OP_SPKR 0
#define ZAUDIO_OP_HP 1
@@ -85,7 +83,6 @@ struct zaudio_softc {
/* i2c device softc */
struct pxa2x0_i2c_softc sc_i2c;
- void *sc_powerhook;
int sc_playing;
struct zaudio_volume sc_volume[2];
@@ -200,12 +197,6 @@ zaudio_attach(struct device *parent, struct device *self, void *aux)
struct pxaip_attach_args *pxa = aux;
int err;
- sc->sc_powerhook = powerhook_establish(zaudio_powerhook, sc);
- if (sc->sc_powerhook == NULL) {
- printf(": unable to establish powerhook\n");
- return;
- }
-
sc->sc_i2s.sc_iot = pxa->pxa_iot;
sc->sc_i2s.sc_dmat = pxa->pxa_dmat;
sc->sc_i2s.sc_size = PXA2X0_I2S_SIZE;
@@ -258,7 +249,7 @@ fail_probe:
fail_i2c:
pxa2x0_i2s_detach_sub(&sc->sc_i2s);
fail_i2s:
- powerhook_disestablish(sc->sc_powerhook);
+ ;
}
int
@@ -266,11 +257,6 @@ zaudio_detach(struct device *self, int flags)
{
struct zaudio_softc *sc = (struct zaudio_softc *)self;
- if (sc->sc_powerhook != NULL) {
- powerhook_disestablish(sc->sc_powerhook);
- sc->sc_powerhook = NULL;
- }
-
pxa2x0_i2c_detach_sub(&sc->sc_i2c);
pxa2x0_i2s_detach_sub(&sc->sc_i2s);
@@ -297,12 +283,6 @@ zaudio_activate(struct device *self, int act)
}
void
-zaudio_powerhook(int why, void *arg)
-{
- zaudio_activate(arg, why);
-}
-
-void
zaudio_init(struct zaudio_softc *sc)
{
pxa2x0_i2c_open(&sc->sc_i2c);
diff --git a/sys/arch/zaurus/dev/zaurus_kbd.c b/sys/arch/zaurus/dev/zaurus_kbd.c
index 5aa281938d6..43f3c0960c3 100644
--- a/sys/arch/zaurus/dev/zaurus_kbd.c
+++ b/sys/arch/zaurus/dev/zaurus_kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_kbd.c,v 1.30 2010/08/30 21:35:57 deraadt Exp $ */
+/* $OpenBSD: zaurus_kbd.c,v 1.31 2010/09/07 16:21:41 deraadt Exp $ */
/*
* Copyright (c) 2005 Dale Rahn <drahn@openbsd.org>
*
@@ -109,7 +109,6 @@ struct zkbd_softc {
char sc_rep[MAXKEYS];
int sc_nrep;
#endif
- void *sc_powerhook;
};
struct zkbd_softc *zkbd_dev; /* XXX */
@@ -123,7 +122,6 @@ void zkbd_poll(void *v);
int zkbd_on(void *v);
int zkbd_sync(void *v);
int zkbd_hinge(void *v);
-void zkbd_powerhook(int why, void *arg);
int zkbd_modstate;
@@ -184,12 +182,6 @@ zkbd_attach(struct device *parent, struct device *self, void *aux)
#endif
/* Determine which system we are - XXX */
- sc->sc_powerhook = powerhook_establish(zkbd_powerhook, sc);
- if (sc->sc_powerhook == NULL) {
- printf(": unable to establish powerhook\n");
- return;
- }
-
if (1 /* C3000 */) {
sc->sc_sense_array = gpio_sense_pins_c3000;
sc->sc_strobe_array = gpio_strobe_pins_c3000;
@@ -587,9 +579,3 @@ zkbd_activate(struct device *self, int act)
}
return 0;
}
-
-void
-zkbd_powerhook(int why, void *arg)
-{
- zkbd_activate(arg, why);
-}
diff --git a/sys/arch/zaurus/dev/zaurus_scoop.c b/sys/arch/zaurus/dev/zaurus_scoop.c
index 8f0a3f7cdaf..f14c644c22d 100644
--- a/sys/arch/zaurus/dev/zaurus_scoop.c
+++ b/sys/arch/zaurus/dev/zaurus_scoop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_scoop.c,v 1.20 2010/08/30 21:35:57 deraadt Exp $ */
+/* $OpenBSD: zaurus_scoop.c,v 1.21 2010/09/07 16:21:41 deraadt Exp $ */
/*
* Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de>
@@ -40,7 +40,6 @@ struct scoop_softc {
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
u_int16_t sc_gpwr; /* GPIO state before suspend */
- void *sc_powerhook;
int sc_suspended;
};
@@ -69,7 +68,6 @@ void scoop0_set_card_power(enum card, int);
struct timeout scoop_checkdisk;
void scoop_timeout(void *);
-void scoop_powerhook(int, void *);
int
scoopmatch(struct device *parent, void *match, void *aux)
@@ -121,11 +119,6 @@ scoopattach(struct device *parent, struct device *self, void *aux)
timeout_set(&scoop_checkdisk, scoop_timeout, sc);
printf(": PCMCIA/GPIO controller\n");
-
- sc->sc_powerhook = powerhook_establish(scoop_powerhook, sc);
- if (sc->sc_powerhook == NULL)
- panic("Unable to establish %s powerhook",
- sc->sc_dev.dv_xname);
}
int
@@ -477,9 +470,3 @@ scoop_activate(struct device *self, int act)
}
return 0;
}
-
-void
-scoop_powerhook(int why, void *arg)
-{
- scoop_activate(arg, why);
-}
diff --git a/sys/arch/zaurus/dev/zaurus_ssp.c b/sys/arch/zaurus/dev/zaurus_ssp.c
index b66b75a7824..31282237ae2 100644
--- a/sys/arch/zaurus/dev/zaurus_ssp.c
+++ b/sys/arch/zaurus/dev/zaurus_ssp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_ssp.c,v 1.7 2010/08/30 21:35:57 deraadt Exp $ */
+/* $OpenBSD: zaurus_ssp.c,v 1.8 2010/09/07 16:21:41 deraadt Exp $ */
/*
* Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de>
@@ -46,7 +46,6 @@ int zssp_match(struct device *, void *, void *);
void zssp_attach(struct device *, struct device *, void *);
void zssp_init(void);
int zssp_activate(struct device *, int);
-void zssp_powerhook(int, void *);
int zssp_read_max1111(u_int32_t);
u_int32_t zssp_read_ads7846(u_int32_t);
@@ -81,10 +80,6 @@ zssp_attach(struct device *parent, struct device *self, void *aux)
printf("\n");
- if (powerhook_establish(zssp_powerhook, sc) == NULL)
- printf("%s: can't establish power hook\n",
- sc->sc_dev.dv_xname);
-
zssp_init();
}
@@ -123,12 +118,6 @@ zssp_activate(struct device *self, int act)
return 0;
}
-void
-zssp_powerhook(int why, void *arg)
-{
- zssp_activate(arg, why);
-}
-
/*
* Transmit a single data word to one of the ICs, keep the chip selected
* afterwards, and don't wait for data to be returned in SSDR. Interrupts
diff --git a/sys/arch/zaurus/dev/zts.c b/sys/arch/zaurus/dev/zts.c
index 9e8969f8acf..10b98f37bed 100644
--- a/sys/arch/zaurus/dev/zts.c
+++ b/sys/arch/zaurus/dev/zts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zts.c,v 1.13 2010/08/30 21:35:57 deraadt Exp $ */
+/* $OpenBSD: zts.c,v 1.14 2010/09/07 16:21:41 deraadt Exp $ */
/*
* Copyright (c) 2005 Dale Rahn <drahn@openbsd.org>
*
@@ -74,7 +74,6 @@ void zts_attach(struct device *, struct device *, void *);
int zts_activate(struct device *, int);
int zts_enable(void *);
void zts_disable(void *);
-void zts_powerhook(int, void *);
void zts_poll(void *);
int zts_irq(void *);
int zts_ioctl(void *, u_long, caddr_t, int, struct proc *);
@@ -83,7 +82,6 @@ struct zts_softc {
struct device sc_dev;
struct timeout sc_ts_poll;
void *sc_gh;
- void *sc_powerhook;
int sc_enabled;
int sc_running;
int sc_buttons; /* button emulation ? */
@@ -158,12 +156,6 @@ zts_enable(void *v)
timeout_del(&sc->sc_ts_poll);
- sc->sc_powerhook = powerhook_establish(zts_powerhook, sc);
- if (sc->sc_powerhook == NULL) {
- printf("%s: enable failed\n", sc->sc_dev.dv_xname);
- return ENOMEM;
- }
-
pxa2x0_gpio_set_function(GPIO_TP_INT_C3K, GPIO_IN);
/* XXX */
@@ -189,11 +181,6 @@ zts_disable(void *v)
timeout_del(&sc->sc_ts_poll);
- if (sc->sc_powerhook != NULL) {
- powerhook_disestablish(sc->sc_powerhook);
- sc->sc_powerhook = NULL;
- }
-
if (sc->sc_gh != NULL) {
#if 0
pxa2x0_gpio_intr_disestablish(sc->sc_gh);
@@ -254,12 +241,6 @@ zts_activate(struct device *self, int act)
return 0;
}
-void
-zts_powerhook(int why, void *v)
-{
- zts_activate(v, why);
-}
-
struct zts_pos {
int x;
int y;
diff --git a/sys/arch/zaurus/zaurus/zaurus_lcd.c b/sys/arch/zaurus/zaurus/zaurus_lcd.c
index eabf4ca34e2..e9f3d9694f9 100644
--- a/sys/arch/zaurus/zaurus/zaurus_lcd.c
+++ b/sys/arch/zaurus/zaurus/zaurus_lcd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_lcd.c,v 1.23 2010/08/30 21:35:57 deraadt Exp $ */
+/* $OpenBSD: zaurus_lcd.c,v 1.24 2010/09/07 16:21:41 deraadt Exp $ */
/* $NetBSD: lubbock_lcd.c,v 1.1 2003/08/09 19:38:53 bsh Exp $ */
/*
@@ -163,7 +163,6 @@ void lcd_set_brightness_internal(int);
int lcd_get_backlight(void);
void lcd_set_backlight(int);
void lcd_blank(int);
-void lcd_powerhook(int, void *);
int
lcd_match(struct device *parent, void *cf, void *aux)
@@ -193,8 +192,6 @@ lcd_attach(struct device *parent, struct device *self, void *aux)
/* Start with approximately 40% of full brightness. */
lcd_set_brightness(3);
-
- (void)powerhook_establish(lcd_powerhook, sc);
}
int
@@ -415,10 +412,3 @@ lcd_activate(struct device *self, int act)
}
return 0;
}
-
-void
-lcd_powerhook(int why, void *v)
-{
- lcd_activate(v, why);
-}
-
diff --git a/sys/dev/cardbus/if_re_cardbus.c b/sys/dev/cardbus/if_re_cardbus.c
index 2bde9691594..1b4492c7663 100644
--- a/sys/dev/cardbus/if_re_cardbus.c
+++ b/sys/dev/cardbus/if_re_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_re_cardbus.c,v 1.20 2010/09/06 19:20:21 deraadt Exp $ */
+/* $OpenBSD: if_re_cardbus.c,v 1.21 2010/09/07 16:21:41 deraadt Exp $ */
/*
* Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org>
@@ -76,8 +76,6 @@ void re_cardbus_attach(struct device *, struct device *, void *);
int re_cardbus_detach(struct device *, int);
void re_cardbus_setup(struct rl_softc *);
-void re_cardbus_powerhook(int, void *);
-
/*
* Cardbus autoconfig definitions
*/
@@ -160,12 +158,8 @@ re_cardbus_attach(struct device *parent, struct device *self, void *aux)
}
snprintf(intrstr, sizeof(intrstr), "irq %d", ca->ca_intrline);
- sc->sc_pwrhook = powerhook_establish(re_cardbus_powerhook, sc);
-
/* Call bus-independent (common) attach routine */
if (re_attach(sc, intrstr)) {
- if (sc->sc_pwrhook != NULL)
- powerhook_disestablish(sc->sc_pwrhook);
cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf, csc->sc_ih);
Cardbus_mapreg_unmap(ct, csc->sc_bar_reg, sc->rl_btag,
sc->rl_bhandle, csc->sc_mapsize);
@@ -259,10 +253,6 @@ re_cardbus_detach(struct device *self, int flags)
ether_ifdetach(ifp);
if_detach(ifp);
- /* No more hooks */
- if (sc->sc_pwrhook != NULL)
- powerhook_disestablish(sc->sc_pwrhook);
-
/* Disable interrupts */
if (csc->sc_ih != NULL)
cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf, csc->sc_ih);
@@ -273,13 +263,3 @@ re_cardbus_detach(struct device *self, int flags)
return (0);
}
-
-void
-re_cardbus_powerhook(int why, void *arg)
-{
- struct rl_softc *sc = arg;
- struct ifnet *ifp = &sc->sc_arpcom.ac_if;
-
- if (why == DVACT_RESUME)
- re_init(ifp);
-}
diff --git a/sys/dev/cardbus/ohci_cardbus.c b/sys/dev/cardbus/ohci_cardbus.c
index 3aec5eb7b9c..c0f2cf4653a 100644
--- a/sys/dev/cardbus/ohci_cardbus.c
+++ b/sys/dev/cardbus/ohci_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci_cardbus.c,v 1.16 2010/08/30 21:30:14 deraadt Exp $ */
+/* $OpenBSD: ohci_cardbus.c,v 1.17 2010/09/07 16:21:41 deraadt Exp $ */
/* $NetBSD: ohci_cardbus.c,v 1.19 2004/08/02 19:14:28 mycroft Exp $ */
/*
@@ -167,8 +167,6 @@ ohci_cardbus_attach(struct device *parent, struct device *self, void *aux)
return;
}
- sc->sc.sc_powerhook = powerhook_establish(ohci_powerhook, &sc->sc);
-
/* Attach usb device. */
sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
usbctlprint);
@@ -185,9 +183,6 @@ ohci_cardbus_detach(struct device *self, int flags)
if (rv)
return (rv);
- if (sc->sc.sc_powerhook != NULL)
- powerhook_disestablish(sc->sc.sc_powerhook);
-
if (sc->sc_ih != NULL) {
cardbus_intr_disestablish(sc->sc_cc, sc->sc_cf, sc->sc_ih);
sc->sc_ih = NULL;
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
index 6973d94ae51..59a53fc9a8b 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ath.c,v 1.90 2010/08/27 19:44:43 deraadt Exp $ */
+/* $OpenBSD: ath.c,v 1.91 2010/09/07 16:21:42 deraadt Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
@@ -426,12 +426,6 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
#endif
sc->sc_flags |= ATH_ATTACHED;
- /*
- * Make sure the interface is shutdown during reboot.
- */
- sc->sc_powerhook = powerhook_establish(ath_powerhook, sc);
- if (sc->sc_powerhook == NULL)
- printf(": WARNING: unable to establish power hook\n");
/*
* Print regulation domain and the mac address. The regulation domain
@@ -481,8 +475,6 @@ ath_detach(struct ath_softc *sc, int flags)
if_detach(ifp);
splx(s);
- if (sc->sc_powerhook != NULL)
- powerhook_disestablish(sc->sc_powerhook);
#ifdef __FreeBSD__
ATH_TXBUF_LOCK_DESTROY(sc);
ATH_TXQ_LOCK_DESTROY(sc);
@@ -491,12 +483,6 @@ ath_detach(struct ath_softc *sc, int flags)
return 0;
}
-void
-ath_powerhook(int why, void *arg)
-{
- ath_activate(arg, why);
-}
-
int
ath_intr(void *arg)
{
diff --git a/sys/dev/ic/athvar.h b/sys/dev/ic/athvar.h
index 2d90c12c8e3..ce5bd883a48 100644
--- a/sys/dev/ic/athvar.h
+++ b/sys/dev/ic/athvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: athvar.h,v 1.30 2010/08/27 19:44:43 deraadt Exp $ */
+/* $OpenBSD: athvar.h,v 1.31 2010/09/07 16:21:42 deraadt Exp $ */
/* $NetBSD: athvar.h,v 1.10 2004/08/10 01:03:53 dyoung Exp $ */
/*-
@@ -307,7 +307,6 @@ struct ath_softc {
HAL_MIB_STATS sc_mib_stats; /* MIB counter statistics */
#ifndef __FreeBSD__
- void *sc_powerhook; /* power management hook */
u_int sc_flags; /* misc flags */
#endif
@@ -408,7 +407,6 @@ int ath_attach(u_int16_t, struct ath_softc *);
int ath_detach(struct ath_softc *, int);
int ath_enable(struct ath_softc *);
int ath_activate(struct device *, int);
-void ath_powerhook(int, void *);
int ath_intr(void *);
int ath_enable(struct ath_softc *);
diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c
index f13e7f3818d..2c61da2ade7 100644
--- a/sys/dev/ic/atw.c
+++ b/sys/dev/ic/atw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atw.c,v 1.72 2010/09/06 19:20:21 deraadt Exp $ */
+/* $OpenBSD: atw.c,v 1.73 2010/09/07 16:21:42 deraadt Exp $ */
/* $NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $ */
/*-
@@ -842,15 +842,6 @@ atw_attach(struct atw_softc *sc)
sizeof(struct ieee80211_frame) + 64);
#endif
- /*
- * Add a suspend hook to make sure we come back up after a
- * resume.
- */
- sc->sc_powerhook = powerhook_establish(atw_powerhook, sc);
- if (sc->sc_powerhook == NULL)
- printf("%s: WARNING: unable to establish power hook\n",
- sc->sc_dev.dv_xname);
-
memset(&sc->sc_rxtapu, 0, sizeof(sc->sc_rxtapu));
sc->sc_rxtap.ar_ihdr.it_len = sizeof(sc->sc_rxtapu);
sc->sc_rxtap.ar_ihdr.it_present = ATW_RX_RADIOTAP_PRESENT;
@@ -2749,9 +2740,6 @@ atw_detach(struct atw_softc *sc)
sizeof(struct atw_control_data));
bus_dmamem_free(sc->sc_dmat, &sc->sc_cdseg, sc->sc_cdnseg);
- if (sc->sc_powerhook != NULL)
- powerhook_disestablish(sc->sc_powerhook);
-
if (sc->sc_srom)
free(sc->sc_srom, M_DEVBUF);
@@ -4011,12 +3999,6 @@ atw_resume(void *arg1, void *arg2)
atw_init(ifp);
}
-void
-atw_powerhook(int why, void *arg)
-{
- atw_activate(arg, why);
-}
-
/*
* atw_ioctl: [ifnet interface function]
*
diff --git a/sys/dev/ic/atwvar.h b/sys/dev/ic/atwvar.h
index 2469de01355..1c17ee86435 100644
--- a/sys/dev/ic/atwvar.h
+++ b/sys/dev/ic/atwvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atwvar.h,v 1.22 2010/08/29 16:46:58 deraadt Exp $ */
+/* $OpenBSD: atwvar.h,v 1.23 2010/09/07 16:21:42 deraadt Exp $ */
/* $NetBSD: atwvar.h,v 1.13 2004/07/23 07:07:55 dyoung Exp $ */
/*
@@ -196,7 +196,6 @@ struct atw_softc {
bus_space_handle_t sc_sh; /* bus space handle */
bus_size_t sc_mapsize; /* mapping size */
bus_dma_tag_t sc_dmat; /* bus dma tag */
- void *sc_powerhook; /* power management hook */
u_int32_t sc_cacheline; /* cache line size */
u_int32_t sc_maxburst; /* maximum burst length */
@@ -441,7 +440,6 @@ int atw_detach(struct atw_softc *);
int atw_activate(struct device *, int);
int atw_intr(void *arg);
int atw_enable(struct atw_softc *);
-void atw_powerhook(int, void *);
void atw_resume(void *, void *);
#endif /* _DEV_IC_ATWVAR_H_ */
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c
index 16f7dc8094a..19f30995b25 100644
--- a/sys/dev/ic/dc.c
+++ b/sys/dev/ic/dc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dc.c,v 1.120 2010/09/06 15:59:03 deraadt Exp $ */
+/* $OpenBSD: dc.c,v 1.121 2010/09/07 16:21:42 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -130,7 +130,6 @@
#include <dev/ic/dcreg.h>
int dc_intr(void *);
-void dc_powerhook(int, void *);
struct dc_type *dc_devtype(void *);
int dc_newbuf(struct dc_softc *, int, struct mbuf *);
int dc_encap(struct dc_softc *, struct mbuf *, u_int32_t *);
@@ -1814,8 +1813,6 @@ hasmac:
if_attach(ifp);
ether_ifattach(ifp);
- sc->sc_pwrhook = powerhook_establish(dc_powerhook, sc);
-
fail:
return;
}
@@ -3149,12 +3146,6 @@ dc_activate(struct device *self, int act)
return (rv);
}
-void
-dc_powerhook(int why, void *arg)
-{
- dc_activate(arg, why);
-}
-
int
dc_detach(struct dc_softc *sc)
{
@@ -3186,10 +3177,6 @@ dc_detach(struct dc_softc *sc)
ether_ifdetach(ifp);
if_detach(ifp);
-
- if (sc->sc_pwrhook != NULL)
- powerhook_disestablish(sc->sc_pwrhook);
-
return (0);
}
diff --git a/sys/dev/ic/dcreg.h b/sys/dev/ic/dcreg.h
index 57bd6de0bef..b2b999a2580 100644
--- a/sys/dev/ic/dcreg.h
+++ b/sys/dev/ic/dcreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dcreg.h,v 1.47 2010/08/27 19:54:02 deraadt Exp $ */
+/* $OpenBSD: dcreg.h,v 1.48 2010/09/07 16:21:42 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -723,7 +723,6 @@ struct dc_softc {
bus_space_handle_t dc_bhandle; /* bus space handle */
bus_space_tag_t dc_btag; /* bus space tag */
void *dc_intrhand;
- void *sc_pwrhook;
u_int8_t dc_type;
u_int8_t dc_pmode;
u_int8_t dc_link;
diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c
index 6cc76fffaac..8abe227fc22 100644
--- a/sys/dev/ic/fxp.c
+++ b/sys/dev/ic/fxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxp.c,v 1.106 2010/09/06 16:01:52 deraadt Exp $ */
+/* $OpenBSD: fxp.c,v 1.107 2010/09/07 16:21:42 deraadt Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
@@ -287,8 +287,6 @@ struct cfdriver fxp_cd = {
NULL, "fxp", DV_IFNET
};
-void fxp_powerhook(int, void *);
-
int
fxp_activate(struct device *self, int act)
{
@@ -323,12 +321,6 @@ fxp_resume(void *arg1, void *arg2)
fxp_init(sc);
}
-void
-fxp_powerhook(int why, void *arg)
-{
- fxp_activate(arg, why);
-}
-
/*************************************************************
* End of operating system-specific autoconfiguration glue
*************************************************************/
@@ -513,13 +505,6 @@ fxp_attach(struct fxp_softc *sc, const char *intrstr)
ether_ifattach(ifp);
/*
- * Add power hook, so that DMA is disabled prior to reboot. Not
- * doing so could allow DMA to corrupt kernel memory during the
- * reboot before the driver initializes.
- */
- sc->sc_powerhook = powerhook_establish(fxp_powerhook, sc);
-
- /*
* Initialize timeout for statistics update.
*/
timeout_set(&sc->stats_update_to, fxp_stats_update, sc);
@@ -1067,9 +1052,6 @@ fxp_detach(struct fxp_softc *sc)
ether_ifdetach(ifp);
if_detach(ifp);
-
- if (sc->sc_powerhook != NULL)
- powerhook_disestablish(sc->sc_powerhook);
}
/*
diff --git a/sys/dev/ic/fxpvar.h b/sys/dev/ic/fxpvar.h
index bc78a626d70..d71e57febd8 100644
--- a/sys/dev/ic/fxpvar.h
+++ b/sys/dev/ic/fxpvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxpvar.h,v 1.33 2010/08/27 18:25:47 deraadt Exp $ */
+/* $OpenBSD: fxpvar.h,v 1.34 2010/09/07 16:21:42 deraadt Exp $ */
/* $NetBSD: if_fxpvar.h,v 1.1 1997/06/05 02:01:58 thorpej Exp $ */
/*
@@ -127,7 +127,6 @@ struct fxp_softc {
int phy_10Mbps_only; /* PHY is 10Mbps-only device */
int eeprom_size; /* size of serial EEPROM */
int rx_bufs; /* how many rx buffers allocated? */
- void *sc_powerhook; /* powerhook */
struct fxp_txsw txs[FXP_NTXCB];
struct fxp_txsw *sc_cbt_cons, *sc_cbt_prod, *sc_cbt_prev;
int sc_cbt_cnt;
diff --git a/sys/dev/ic/pgt.c b/sys/dev/ic/pgt.c
index 3b16908a013..e8aa091f5fc 100644
--- a/sys/dev/ic/pgt.c
+++ b/sys/dev/ic/pgt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pgt.c,v 1.64 2010/08/27 20:06:39 deraadt Exp $ */
+/* $OpenBSD: pgt.c,v 1.65 2010/09/07 16:21:42 deraadt Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -193,7 +193,6 @@ int pgt_dma_alloc_queue(struct pgt_softc *sc, enum pgt_queue pq);
void pgt_dma_free(struct pgt_softc *);
void pgt_dma_free_queue(struct pgt_softc *sc, enum pgt_queue pq);
void pgt_shutdown(void *);
-void pgt_powerhook(int, void *);
void pgt_resume(void *, void *);
void
@@ -640,8 +639,6 @@ pgt_detach(struct pgt_softc *sc)
*/
if (sc->sc_shutdown_hook != NULL)
shutdownhook_disestablish(sc->sc_shutdown_hook);
- if (sc->sc_power_hook != NULL)
- powerhook_disestablish(sc->sc_power_hook);
ieee80211_ifdetach(&sc->sc_ic.ic_if);
if_detach(&sc->sc_ic.ic_if);
@@ -2036,11 +2033,6 @@ pgt_net_attach(struct pgt_softc *sc)
if (sc->sc_shutdown_hook == NULL)
printf("%s: WARNING: unable to establish shutdown hook\n",
sc->sc_dev.dv_xname);
- sc->sc_power_hook = powerhook_establish(pgt_powerhook, sc);
- if (sc->sc_power_hook == NULL)
- printf("%s: WARNING: unable to establish power hook\n",
- sc->sc_dev.dv_xname);
-
return (0);
}
@@ -3356,9 +3348,3 @@ pgt_resume(void *arg1, void *arg2)
pgt_update_hw_from_sw(sc, 0, 0);
}
}
-
-void
-pgt_powerhook(int why, void *arg)
-{
- pgt_activate(arg, why);
-}
diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c
index c95dc0e22d1..c7ef4a7088f 100644
--- a/sys/dev/ic/rt2560.c
+++ b/sys/dev/ic/rt2560.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2560.c,v 1.56 2010/09/06 19:20:21 deraadt Exp $ */
+/* $OpenBSD: rt2560.c,v 1.57 2010/09/07 16:21:42 deraadt Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -148,7 +148,6 @@ void rt2560_read_eeprom(struct rt2560_softc *);
int rt2560_bbp_init(struct rt2560_softc *);
int rt2560_init(struct ifnet *);
void rt2560_stop(struct ifnet *, int);
-void rt2560_powerhook(int, void *);
static const struct {
uint32_t reg;
@@ -294,12 +293,6 @@ rt2560_attach(void *xsc, int id)
sc->sc_txtap.wt_ihdr.it_len = htole16(sc->sc_txtap_len);
sc->sc_txtap.wt_ihdr.it_present = htole32(RT2560_TX_RADIOTAP_PRESENT);
#endif
-
- sc->sc_powerhook = powerhook_establish(rt2560_powerhook, sc);
- if (sc->sc_powerhook == NULL) {
- printf("%s: WARNING: unable to establish power hook\n",
- sc->sc_dev.dv_xname);
- }
return 0;
fail5: rt2560_free_tx_ring(sc, &sc->bcnq);
@@ -318,9 +311,6 @@ rt2560_detach(void *xsc)
timeout_del(&sc->scan_to);
timeout_del(&sc->amrr_to);
- if (sc->sc_powerhook != NULL)
- powerhook_disestablish(sc->sc_powerhook);
-
ieee80211_ifdetach(ifp); /* free all nodes */
if_detach(ifp);
@@ -2732,24 +2722,6 @@ rt2560_stop(struct ifnet *ifp, int disable)
}
}
-void
-rt2560_powerhook(int why, void *arg)
-{
- struct rt2560_softc *sc = arg;
- int s;
-
- s = splnet();
- switch (why) {
- case DVACT_SUSPEND:
- rt2560_suspend(sc);
- break;
- case DVACT_RESUME:
- rt2560_resume(sc);
- break;
- }
- splx(s);
-}
-
struct cfdriver ral_cd = {
NULL, "ral", DV_IFNET
};
diff --git a/sys/dev/ic/rt2560var.h b/sys/dev/ic/rt2560var.h
index 8109411ba8b..6d5eff452c5 100644
--- a/sys/dev/ic/rt2560var.h
+++ b/sys/dev/ic/rt2560var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2560var.h,v 1.8 2010/08/27 16:06:25 kettenis Exp $ */
+/* $OpenBSD: rt2560var.h,v 1.9 2010/09/07 16:21:42 deraadt Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -161,7 +161,6 @@ struct rt2560_softc {
#define sc_txtap sc_txtapu.th
int sc_txtap_len;
#endif
- void *sc_powerhook; /* power management hook */
};
int rt2560_attach(void *, int);
diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c
index e7231b0281d..d329378621e 100644
--- a/sys/dev/ic/rt2661.c
+++ b/sys/dev/ic/rt2661.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2661.c,v 1.62 2010/09/06 19:20:21 deraadt Exp $ */
+/* $OpenBSD: rt2661.c,v 1.63 2010/09/07 16:21:42 deraadt Exp $ */
/*-
* Copyright (c) 2006
@@ -156,7 +156,6 @@ int rt2661_prepare_beacon(struct rt2661_softc *);
#endif
void rt2661_enable_tsf_sync(struct rt2661_softc *);
int rt2661_get_rssi(struct rt2661_softc *, uint8_t);
-void rt2661_powerhook(int, void *);
static const struct {
uint32_t reg;
@@ -247,12 +246,6 @@ rt2661_attach(void *xsc, int id)
else
rt2661_attachhook(sc);
- sc->sc_powerhook = powerhook_establish(rt2661_powerhook, sc);
- if (sc->sc_powerhook == NULL) {
- printf("%s: WARNING: unable to establish power hook\n",
- sc->sc_dev.dv_xname);
- }
-
return 0;
fail2: rt2661_free_tx_ring(sc, &sc->mgtq);
@@ -383,9 +376,6 @@ rt2661_detach(void *xsc)
timeout_del(&sc->scan_to);
timeout_del(&sc->amrr_to);
- if (sc->sc_powerhook != NULL)
- powerhook_disestablish(sc->sc_powerhook);
-
ieee80211_ifdetach(ifp); /* free all nodes */
if_detach(ifp);
@@ -2925,21 +2915,3 @@ rt2661_get_rssi(struct rt2661_softc *sc, uint8_t raw)
}
return rssi;
}
-
-void
-rt2661_powerhook(int why, void *arg)
-{
- struct rt2661_softc *sc = arg;
- int s;
-
- s = splnet();
- switch (why) {
- case DVACT_SUSPEND:
- rt2661_suspend(sc);
- break;
- case DVACT_RESUME:
- rt2661_resume(sc);
- break;
- }
- splx(s);
-}
diff --git a/sys/dev/ic/rt2661var.h b/sys/dev/ic/rt2661var.h
index d4130d32f46..a2f4be57ced 100644
--- a/sys/dev/ic/rt2661var.h
+++ b/sys/dev/ic/rt2661var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2661var.h,v 1.12 2010/08/27 16:06:25 kettenis Exp $ */
+/* $OpenBSD: rt2661var.h,v 1.13 2010/09/07 16:21:42 deraadt Exp $ */
/*-
* Copyright (c) 2006
@@ -174,7 +174,6 @@ struct rt2661_softc {
#define sc_txtap sc_txtapu.th
int sc_txtap_len;
#endif
- void *sc_powerhook;
};
int rt2661_attach(void *, int);
diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c
index 172b3ad87a1..ddbe74d7de8 100644
--- a/sys/dev/ic/rt2860.c
+++ b/sys/dev/ic/rt2860.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2860.c,v 1.63 2010/09/06 19:20:22 deraadt Exp $ */
+/* $OpenBSD: rt2860.c,v 1.64 2010/09/07 16:21:42 deraadt Exp $ */
/*-
* Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -166,7 +166,6 @@ void rt2860_switch_chan(struct rt2860_softc *,
int rt2860_setup_beacon(struct rt2860_softc *);
#endif
void rt2860_enable_tsf_sync(struct rt2860_softc *);
-void rt2860_powerhook(int, void *);
static const struct {
uint32_t reg;
@@ -277,12 +276,6 @@ rt2860_attach(void *xsc, int id)
else
rt2860_attachhook(sc);
- sc->sc_powerhook = powerhook_establish(rt2860_powerhook, sc);
- if (sc->sc_powerhook == NULL) {
- printf("%s: WARNING: unable to establish power hook\n",
- sc->sc_dev.dv_xname);
- }
-
return 0;
fail2: rt2860_free_rx_ring(sc, &sc->rxq);
@@ -404,9 +397,6 @@ rt2860_detach(void *xsc)
struct ifnet *ifp = &sc->sc_ic.ic_if;
int qid;
- if (sc->sc_powerhook != NULL)
- powerhook_disestablish(sc->sc_powerhook);
-
ieee80211_ifdetach(ifp); /* free all nodes */
if_detach(ifp);
@@ -3863,21 +3853,3 @@ rt2860_enable_tsf_sync(struct rt2860_softc *sc)
RAL_WRITE(sc, RT2860_BCN_TIME_CFG, tmp);
}
-
-void
-rt2860_powerhook(int why, void *arg)
-{
- struct rt2860_softc *sc = arg;
- int s;
-
- s = splnet();
- switch (why) {
- case DVACT_SUSPEND:
- rt2860_suspend(sc);
- break;
- case DVACT_RESUME:
- rt2860_resume(sc);
- break;
- }
- splx(s);
-}
diff --git a/sys/dev/ic/rt2860var.h b/sys/dev/ic/rt2860var.h
index e0d466ca73c..720abcf43c7 100644
--- a/sys/dev/ic/rt2860var.h
+++ b/sys/dev/ic/rt2860var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2860var.h,v 1.19 2010/08/27 16:06:25 kettenis Exp $ */
+/* $OpenBSD: rt2860var.h,v 1.20 2010/09/07 16:21:42 deraadt Exp $ */
/*-
* Copyright (c) 2007
@@ -198,7 +198,6 @@ struct rt2860_softc {
#define sc_txtap sc_txtapu.th
int sc_txtap_len;
#endif
- void *sc_powerhook;
};
int rt2860_attach(void *, int);
diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c
index 73573128526..c1bf37011af 100644
--- a/sys/dev/ic/rtl81x9.c
+++ b/sys/dev/ic/rtl81x9.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9.c,v 1.73 2010/08/31 17:13:47 deraadt Exp $ */
+/* $OpenBSD: rtl81x9.c,v 1.74 2010/09/07 16:21:42 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -130,7 +130,6 @@
*/
void rl_tick(void *);
-void rl_powerhook(int, void *);
int rl_encap(struct rl_softc *, struct mbuf * );
@@ -1245,8 +1244,6 @@ rl_attach(struct rl_softc *sc)
if_attach(ifp);
ether_ifattach(ifp);
- sc->sc_pwrhook = powerhook_establish(rl_powerhook, sc);
-
return (0);
}
@@ -1275,12 +1272,6 @@ rl_activate(struct device *self, int act)
return (rv);
}
-void
-rl_powerhook(int why, void *arg)
-{
- rl_activate(arg, why);
-}
-
int
rl_miibus_readreg(struct device *self, int phy, int reg)
{
@@ -1399,9 +1390,6 @@ rl_detach(struct rl_softc *sc)
/* Unhook our tick handler. */
timeout_del(&sc->sc_tick_tmo);
- if (sc->sc_pwrhook != NULL)
- powerhook_disestablish(sc->sc_pwrhook);
-
/* Detach any PHYs we might have. */
if (LIST_FIRST(&sc->sc_mii.mii_phys) != NULL)
mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY);
diff --git a/sys/dev/ic/rtl81x9reg.h b/sys/dev/ic/rtl81x9reg.h
index 45da5e01f49..0902e84fc79 100644
--- a/sys/dev/ic/rtl81x9reg.h
+++ b/sys/dev/ic/rtl81x9reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9reg.h,v 1.69 2010/08/27 20:22:13 deraadt Exp $ */
+/* $OpenBSD: rtl81x9reg.h,v 1.70 2010/09/07 16:21:43 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -809,7 +809,6 @@ struct rl_softc {
int rl_eecmd_read;
int rl_eewidth;
int rl_bus_speed;
- void *sc_pwrhook;
int rl_txthresh;
struct rl_chain_data rl_cdata;
struct timeout sc_tick_tmo;
diff --git a/sys/dev/ic/rtw.c b/sys/dev/ic/rtw.c
index a94ec7e9f5c..9c5abba8312 100644
--- a/sys/dev/ic/rtw.c
+++ b/sys/dev/ic/rtw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtw.c,v 1.80 2010/08/29 16:46:58 deraadt Exp $ */
+/* $OpenBSD: rtw.c,v 1.81 2010/09/07 16:21:43 deraadt Exp $ */
/* $NetBSD: rtw.c,v 1.29 2004/12/27 19:49:16 dyoung Exp $ */
/*-
@@ -184,8 +184,6 @@ void rtw_enable_interrupts(struct rtw_softc *);
int rtw_dequeue(struct ifnet *, struct rtw_txsoft_blk **,
struct rtw_txdesc_blk **, struct mbuf **,
struct ieee80211_node **);
-void rtw_establish_hooks(struct rtw_hooks *, const char *, void *);
-void rtw_disestablish_hooks(struct rtw_hooks *, const char *, void *);
int rtw_txsoft_blk_setup(struct rtw_txsoft_blk *, u_int);
void rtw_rxdesc_init_all(struct rtw_rxdesc_blk *, struct rtw_rxsoft *,
int);
@@ -3618,34 +3616,6 @@ rtw_activate(struct device *self, int act)
return 0;
}
-void
-rtw_powerhook(int why, void *arg)
-{
- rtw_activate(arg, why);
-}
-
-void
-rtw_establish_hooks(struct rtw_hooks *hooks, const char *dvname,
- void *arg)
-{
- /*
- * Add a suspend hook to make sure we come back up after a
- * resume.
- */
- hooks->rh_power = powerhook_establish(rtw_powerhook, arg);
- if (hooks->rh_power == NULL)
- printf("%s: WARNING: unable to establish power hook\n",
- dvname);
-}
-
-void
-rtw_disestablish_hooks(struct rtw_hooks *hooks, const char *dvname,
- void *arg)
-{
- if (hooks->rh_power != NULL)
- powerhook_disestablish(hooks->rh_power);
-}
-
int
rtw_txsoft_blk_setup(struct rtw_txsoft_blk *tsb, u_int qlen)
{
@@ -4105,9 +4075,6 @@ rtw_attach(struct rtw_softc *sc)
bpfattach(&sc->sc_radiobpf, &sc->sc_ic.ic_if, DLT_IEEE802_11_RADIO,
sizeof(struct ieee80211_frame) + 64);
#endif
-
- rtw_establish_hooks(&sc->sc_hooks, sc->sc_dev.dv_xname, (void*)sc);
-
return;
fail8:
@@ -4151,8 +4118,6 @@ rtw_detach(struct rtw_softc *sc)
{
sc->sc_flags |= RTW_F_INVALID;
- rtw_disestablish_hooks(&sc->sc_hooks, sc->sc_dev.dv_xname,
- (void*)sc);
timeout_del(&sc->sc_scan_to);
rtw_stop(&sc->sc_if, 1);
diff --git a/sys/dev/ic/rtwvar.h b/sys/dev/ic/rtwvar.h
index b3ed4fdb698..79bf05b2e0b 100644
--- a/sys/dev/ic/rtwvar.h
+++ b/sys/dev/ic/rtwvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtwvar.h,v 1.29 2010/08/29 16:46:58 deraadt Exp $ */
+/* $OpenBSD: rtwvar.h,v 1.30 2010/09/07 16:21:43 deraadt Exp $ */
/* $NetBSD: rtwvar.h,v 1.10 2004/12/26 22:37:57 mycroft Exp $ */
/*-
@@ -287,10 +287,6 @@ struct rtw_tx_radiotap_header {
u_int16_t rt_chan_flags;
} __packed;
-struct rtw_hooks {
- void *rh_power; /* power management hook */
-};
-
struct rtw_mtbl {
int (*mt_newstate)(struct ieee80211com *,
enum ieee80211_state, int);
@@ -399,7 +395,6 @@ struct rtw_softc {
void (*sc_disable)(struct rtw_softc *);
void (*sc_power)(struct rtw_softc *, int);
struct rtw_mtbl sc_mtbl;
- struct rtw_hooks sc_hooks;
caddr_t sc_radiobpf;
@@ -453,7 +448,6 @@ void rtw_disable(struct rtw_softc *);
int rtw_enable(struct rtw_softc *);
int rtw_activate(struct device *, int);
-void rtw_powerhook(int, void *);
void rtw_shutdown(void *);
const char *rtw_pwrstate_string(enum rtw_pwrstate);
diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c
index 49e1b5938c8..2b41113018e 100644
--- a/sys/dev/ic/xl.c
+++ b/sys/dev/ic/xl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xl.c,v 1.95 2010/09/06 16:01:52 deraadt Exp $ */
+/* $OpenBSD: xl.c,v 1.96 2010/09/07 16:21:43 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -193,8 +193,6 @@ int xl_miibus_readreg(struct device *, int, int);
void xl_miibus_writereg(struct device *, int, int, int);
void xl_miibus_statchg(struct device *);
-void xl_powerhook(int, void *);
-
int
xl_activate(struct device *self, int act)
{
@@ -223,12 +221,6 @@ xl_activate(struct device *self, int act)
return (rv);
}
-void
-xl_powerhook(int why, void *arg)
-{
- xl_activate(arg, why);
-}
-
/*
* Murphy's law says that it's possible the chip can wedge and
* the 'command in progress' bit may never clear. Hence, we wait
@@ -2687,7 +2679,6 @@ xl_attach(struct xl_softc *sc)
ether_ifattach(ifp);
sc->sc_sdhook = shutdownhook_establish(xl_shutdown, sc);
- sc->sc_pwrhook = powerhook_establish(xl_powerhook, sc);
}
int
@@ -2710,8 +2701,6 @@ xl_detach(struct xl_softc *sc)
if (sc->sc_sdhook != NULL)
shutdownhook_disestablish(sc->sc_sdhook);
- if (sc->sc_pwrhook != NULL)
- powerhook_disestablish(sc->sc_pwrhook);
ether_ifdetach(ifp);
if_detach(ifp);
diff --git a/sys/dev/ic/xlreg.h b/sys/dev/ic/xlreg.h
index 406481de57c..ec3713a395a 100644
--- a/sys/dev/ic/xlreg.h
+++ b/sys/dev/ic/xlreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xlreg.h,v 1.23 2010/08/27 15:43:41 deraadt Exp $ */
+/* $OpenBSD: xlreg.h,v 1.24 2010/09/07 16:21:43 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -595,7 +595,7 @@ struct xl_softc {
struct xl_chain_data xl_cdata;
int xl_flags;
void (*intr_ack)(struct xl_softc *);
- void * sc_sdhook, *sc_pwrhook;
+ void * sc_sdhook;
bus_dma_tag_t sc_dmat;
bus_dmamap_t sc_listmap;
bus_dma_segment_t sc_listseg[1];
diff --git a/sys/dev/isa/aps.c b/sys/dev/isa/aps.c
index a665e90d50a..c3b7c00625d 100644
--- a/sys/dev/isa/aps.c
+++ b/sys/dev/isa/aps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aps.c,v 1.20 2010/08/27 16:45:46 deraadt Exp $ */
+/* $OpenBSD: aps.c,v 1.21 2010/09/07 16:21:43 deraadt Exp $ */
/*
* Copyright (c) 2005 Jonathan Gray <jsg@openbsd.org>
* Copyright (c) 2008 Can Erkin Acar <canacar@openbsd.org>
@@ -145,7 +145,6 @@ int aps_init(bus_space_tag_t, bus_space_handle_t);
int aps_read_data(struct aps_softc *);
void aps_refresh_sensor_data(struct aps_softc *);
void aps_refresh(void *);
-void aps_powerhook(int, void *);
int aps_do_io(bus_space_tag_t, bus_space_handle_t,
unsigned char *, int, int);
@@ -349,8 +348,6 @@ aps_attach(struct device *parent, struct device *self, void *aux)
}
sensordev_install(&sc->sensordev);
- powerhook_establish(aps_powerhook, (void *)sc);
-
/* Refresh sensor data every 0.5 seconds */
timeout_set(&aps_timeout, aps_refresh, sc);
timeout_add_msec(&aps_timeout, 500);
@@ -513,9 +510,3 @@ aps_activate(struct device *self, int act)
}
return (0);
}
-
-void
-aps_powerhook(int why, void *arg)
-{
- aps_activate(arg, why);
-}
diff --git a/sys/dev/isa/i82365_isa.c b/sys/dev/isa/i82365_isa.c
index 8a290685258..a7bdac21cf2 100644
--- a/sys/dev/isa/i82365_isa.c
+++ b/sys/dev/isa/i82365_isa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82365_isa.c,v 1.21 2010/07/02 04:23:15 blambert Exp $ */
+/* $OpenBSD: i82365_isa.c,v 1.22 2010/09/07 16:21:43 deraadt Exp $ */
/* $NetBSD: i82365_isa.c,v 1.11 1998/06/09 07:25:00 thorpej Exp $ */
/*
@@ -221,7 +221,6 @@ pcic_isa_attach(parent, self, aux)
pcic_write(h, PCIC_CSC_INTR,
(sc->irq << PCIC_CSC_INTR_IRQ_SHIFT) |
PCIC_CSC_INTR_CD_ENABLE);
- powerhook_establish(pcic_power, h);
}
}
} else
diff --git a/sys/dev/isa/i82365_isapnp.c b/sys/dev/isa/i82365_isapnp.c
index 0a4b3ca8198..85e636c5148 100644
--- a/sys/dev/isa/i82365_isapnp.c
+++ b/sys/dev/isa/i82365_isapnp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82365_isapnp.c,v 1.7 2010/07/02 04:23:15 blambert Exp $ */
+/* $OpenBSD: i82365_isapnp.c,v 1.8 2010/09/07 16:21:43 deraadt Exp $ */
/* $NetBSD: i82365_isapnp.c,v 1.8 2000/02/23 17:22:11 soren Exp $ */
/*
@@ -199,7 +199,6 @@ pcic_isapnp_attach(parent, self, aux)
pcic_write(h, PCIC_CSC_INTR,
(sc->irq << PCIC_CSC_INTR_IRQ_SHIFT) |
PCIC_CSC_INTR_CD_ENABLE);
- powerhook_establish(pcic_power, h);
}
}
} else
diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c
index 142ce082c06..55562453d4a 100644
--- a/sys/dev/pci/arc.c
+++ b/sys/dev/pci/arc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc.c,v 1.91 2010/08/07 03:50:02 krw Exp $ */
+/* $OpenBSD: arc.c,v 1.92 2010/09/07 16:21:44 deraadt Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -592,7 +592,7 @@ arc_attach(struct device *parent, struct device *self, void *aux)
sc->sc_shutdownhook = shutdownhook_establish(arc_shutdown, sc);
if (sc->sc_shutdownhook == NULL)
- panic("unable to establish arc powerhook");
+ panic("unable to establish arc shutdownhook");
sc->sc_link.adapter = &arc_switch;
sc->sc_link.adapter_softc = sc;
diff --git a/sys/dev/pci/auacer.c b/sys/dev/pci/auacer.c
index ceaebca7cbc..d45d8008fd5 100644
--- a/sys/dev/pci/auacer.c
+++ b/sys/dev/pci/auacer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auacer.c,v 1.8 2010/08/27 18:50:56 deraadt Exp $ */
+/* $OpenBSD: auacer.c,v 1.9 2010/09/07 16:21:44 deraadt Exp $ */
/* $NetBSD: auacer.c,v 1.3 2004/11/10 04:20:26 kent Exp $ */
/*-
@@ -118,9 +118,6 @@ struct auacer_softc {
pcitag_t sc_pt;
int sc_dmamap_flags;
-
- /* Power Management */
- void *sc_powerhook;
};
#define READ1(sc, a) bus_space_read_1(sc->iot, sc->aud_ioh, a)
@@ -186,7 +183,6 @@ int auacer_allocmem(struct auacer_softc *, size_t, size_t,
struct auacer_dma *);
int auacer_freemem(struct auacer_softc *, struct auacer_dma *);
-void auacer_powerhook(int, void *);
int auacer_set_rate(struct auacer_softc *, int, u_long);
void auacer_finish_attach(struct device *);
@@ -297,8 +293,6 @@ auacer_attach(struct device *parent, struct device *self, void *aux)
if (ac97_attach(&sc->host_if) != 0)
return;
- sc->sc_powerhook = powerhook_establish(auacer_powerhook, sc);
-
audio_attach_mi(&auacer_hw_if, sc, &sc->sc_dev);
auacer_reset(sc);
@@ -1097,9 +1091,3 @@ auacer_activate(struct device *self, int act)
}
return 0;
}
-
-void
-auacer_powerhook(int why, void *addr)
-{
- auacer_activate(addr, why);
-}
diff --git a/sys/dev/pci/auglx.c b/sys/dev/pci/auglx.c
index 9b524b61147..e9e1ea2b523 100644
--- a/sys/dev/pci/auglx.c
+++ b/sys/dev/pci/auglx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auglx.c,v 1.5 2010/08/27 18:50:56 deraadt Exp $ */
+/* $OpenBSD: auglx.c,v 1.6 2010/09/07 16:21:44 deraadt Exp $ */
/*
* Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org>
@@ -198,7 +198,6 @@ struct auglx_softc {
struct ac97_host_if host_if;
/* power mgmt */
- void *sc_powerhook;
u_int16_t sc_ext_ctrl;
int sc_dmamap_flags;
@@ -245,7 +244,6 @@ void auglx_free_prd(struct auglx_softc *sc, struct auglx_ring *bm);
int auglx_allocmem(struct auglx_softc *, size_t, size_t, struct auglx_dma *);
void auglx_freemem(struct auglx_softc *, struct auglx_dma *);
void auglx_get_default_params(void *, int, struct audio_params *);
-void auglx_powerhook(int, void *);
struct audio_hw_if auglx_hw_if = {
auglx_open,
@@ -359,10 +357,6 @@ auglx_attach(struct device *parent, struct device *self, void *aux)
return;
}
audio_attach_mi(&auglx_hw_if, sc, &sc->sc_dev);
-
- /* Watch for power changes */
- sc->sc_powerhook = powerhook_establish(auglx_powerhook, sc);
-
}
/* Functions to communicate with the AC97 Codec via the ACC */
@@ -1363,9 +1357,3 @@ auglx_activate(struct device *self, int act)
}
return 0;
}
-
-void
-auglx_powerhook(int why, void *self)
-{
- auglx_activate(self, why);
-}
diff --git a/sys/dev/pci/auich.c b/sys/dev/pci/auich.c
index 9e7ea163089..685e5eadd55 100644
--- a/sys/dev/pci/auich.c
+++ b/sys/dev/pci/auich.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auich.c,v 1.90 2010/09/06 19:20:22 deraadt Exp $ */
+/* $OpenBSD: auich.c,v 1.91 2010/09/07 16:21:44 deraadt Exp $ */
/*
* Copyright (c) 2000,2001 Michael Shalayeff
@@ -217,7 +217,6 @@ struct auich_softc {
int pcmo_fifoe;
#endif
- void *powerhook;
int suspend;
u_int16_t ext_ctrl;
int sc_sample_size;
@@ -327,8 +326,6 @@ void auich_get_default_params(void *, int, struct audio_params *);
int auich_suspend(struct auich_softc *);
int auich_resume(struct auich_softc *);
-void auich_powerhook(int, void *);
-
struct audio_hw_if auich_hw_if = {
auich_open,
auich_close,
@@ -556,7 +553,6 @@ auich_attach(parent, self, aux)
/* Watch for power changes */
sc->suspend = DVACT_RESUME;
- sc->powerhook = powerhook_establish(auich_powerhook, sc);
sc->sc_ac97rate = -1;
}
@@ -1954,13 +1950,6 @@ auich_resume(struct auich_softc *sc)
return (0);
}
-void
-auich_powerhook(int why, void *self)
-{
- auich_activate(self, why);
-}
-
-
/* -------------------------------------------------------------------- */
/* Calibrate card (some boards are overclocked and need scaling) */
diff --git a/sys/dev/pci/autri.c b/sys/dev/pci/autri.c
index f87cd11077e..fce8bc7208b 100644
--- a/sys/dev/pci/autri.c
+++ b/sys/dev/pci/autri.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autri.c,v 1.26 2010/08/27 18:50:56 deraadt Exp $ */
+/* $OpenBSD: autri.c,v 1.27 2010/09/07 16:21:44 deraadt Exp $ */
/*
* Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro.
@@ -99,7 +99,6 @@ int autri_write_codec(void *sc, u_int8_t a, u_int16_t d);
void autri_reset_codec(void *sc);
enum ac97_host_flags autri_flags_codec(void *);
-void autri_powerhook(int why,void *addr);
int autri_init(void *sc);
struct autri_dma *autri_find_dma(struct autri_softc *, void *);
void autri_setup_channel(struct autri_softc *sc,int mode,
@@ -617,8 +616,6 @@ autri_attach(parent, self, aux)
#if NMIDI > 0
midi_attach_mi(&autri_midi_hw_if, sc, &sc->sc_dev);
#endif
-
- powerhook_establish(autri_powerhook, sc);
}
int
@@ -638,12 +635,6 @@ autri_activate(struct device *self, int act)
return 0;
}
-void
-autri_powerhook(int why,void *addr)
-{
- autri_activate(addr, why);
-}
-
int
autri_init(sc_)
void *sc_;
diff --git a/sys/dev/pci/cs4280.c b/sys/dev/pci/cs4280.c
index 92d4572f12c..4feff85884a 100644
--- a/sys/dev/pci/cs4280.c
+++ b/sys/dev/pci/cs4280.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cs4280.c,v 1.35 2010/08/27 18:50:57 deraadt Exp $ */
+/* $OpenBSD: cs4280.c,v 1.36 2010/09/07 16:21:44 deraadt Exp $ */
/* $NetBSD: cs4280.c,v 1.5 2000/06/26 04:56:23 simonb Exp $ */
/*
@@ -157,7 +157,6 @@ struct cs4280_softc {
struct ac97_codec_if *codec_if;
struct ac97_host_if host_if;
- void *sc_powerhook; /* Power Hook */
u_int16_t ac97_reg[CS4280_SAVE_REG_MAX + 1]; /* Save ac97 registers */
};
@@ -233,8 +232,6 @@ int cs4280_read_codec(void *sc, u_int8_t a, u_int16_t *d);
int cs4280_write_codec(void *sc, u_int8_t a, u_int16_t d);
void cs4280_reset_codec(void *sc);
-void cs4280_powerhook(int, void *);
-
void cs4280_clear_fifos(struct cs4280_softc *);
#if NMIDI > 0
@@ -591,7 +588,6 @@ cs4280_attachhook(void *xsc)
#if NMIDI > 0
midi_attach_mi(&cs4280_midi_hw_if, sc, &sc->sc_dev);
#endif
- sc->sc_powerhook = powerhook_establish(cs4280_powerhook, sc);
}
void
@@ -1865,12 +1861,6 @@ cs4280_activate(struct device *self, int act)
}
void
-cs4280_powerhook(int why, void *v)
-{
- cs4280_activate(v, why);
-}
-
-void
cs4280_clear_fifos(sc)
struct cs4280_softc *sc;
{
diff --git a/sys/dev/pci/cs4281.c b/sys/dev/pci/cs4281.c
index dad225ed926..d712edd1945 100644
--- a/sys/dev/pci/cs4281.c
+++ b/sys/dev/pci/cs4281.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cs4281.c,v 1.24 2010/08/27 18:50:57 deraadt Exp $ */
+/* $OpenBSD: cs4281.c,v 1.25 2010/09/07 16:21:44 deraadt Exp $ */
/* $Tera: cs4281.c,v 1.18 2000/12/27 14:24:45 tacha Exp $ */
/*
@@ -140,7 +140,6 @@ struct cs4281_softc {
struct ac97_host_if host_if;
/* Power Management */
- void *sc_powerhook; /* Power hook */
u_int16_t ac97_reg[CS4281_SAVE_REG_MAX + 1]; /* Save ac97 registers */
};
@@ -183,8 +182,6 @@ int cs4281_read_codec(void *, u_int8_t , u_int16_t *);
int cs4281_write_codec(void *, u_int8_t, u_int16_t);
void cs4281_reset_codec(void *);
-void cs4281_powerhook(int, void *);
-
int cs4281_mixer_set_port(void *, mixer_ctrl_t *);
int cs4281_mixer_get_port(void *, mixer_ctrl_t *);
int cs4281_query_devinfo(void *, mixer_devinfo_t *);
@@ -368,8 +365,6 @@ cs4281_attach(parent, self, aux)
#if NMIDI > 0
midi_attach_mi(&cs4281_midi_hw_if, sc, &sc->sc_dev);
#endif
-
- sc->sc_powerhook = powerhook_establish(cs4281_powerhook, sc);
}
@@ -1166,12 +1161,6 @@ cs4281_activate(struct device *self, int act)
}
void
-cs4281_powerhook(int why, void *v)
-{
- cs4281_activate(v, why);
-}
-
-void
cs4281_reset_codec(void *addr)
{
struct cs4281_softc *sc;
diff --git a/sys/dev/pci/esa.c b/sys/dev/pci/esa.c
index eb33bda86fb..156a8bee9da 100644
--- a/sys/dev/pci/esa.c
+++ b/sys/dev/pci/esa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: esa.c,v 1.21 2010/08/27 18:50:57 deraadt Exp $ */
+/* $OpenBSD: esa.c,v 1.22 2010/09/07 16:21:44 deraadt Exp $ */
/* $NetBSD: esa.c,v 1.12 2002/03/24 14:17:35 jmcneill Exp $ */
/*
@@ -161,7 +161,6 @@ int esa_add_list(struct esa_voice *, struct esa_list *, u_int16_t,
void esa_remove_list(struct esa_voice *, struct esa_list *, int);
/* power management */
-void esa_powerhook(int, void *);
int esa_suspend(struct esa_softc *);
int esa_resume(struct esa_softc *);
@@ -1145,13 +1144,6 @@ esa_attach(struct device *parent, struct device *self, void *aux)
sc->sc_audiodev[i] =
audio_attach_mi(&esa_hw_if, &sc->voice[i], &sc->sc_dev);
}
-
- sc->powerhook = powerhook_establish(esa_powerhook, sc);
- if (sc->powerhook == NULL)
- printf("%s: WARNING: unable to establish powerhook\n",
- sc->sc_dev.dv_xname);
-
- return;
}
int
@@ -1622,12 +1614,6 @@ esa_activate(struct device *self, int act)
return 0;
}
-void
-esa_powerhook(int why, void *hdl)
-{
- esa_activate(hdl, why);
-}
-
int
esa_suspend(struct esa_softc *sc)
{
diff --git a/sys/dev/pci/esavar.h b/sys/dev/pci/esavar.h
index eff4a9ac62c..f7e6299d8c1 100644
--- a/sys/dev/pci/esavar.h
+++ b/sys/dev/pci/esavar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: esavar.h,v 1.1 2002/04/08 01:47:33 frantzen Exp $ */
+/* $OpenBSD: esavar.h,v 1.2 2010/09/07 16:21:44 deraadt Exp $ */
/* $NetBSD: esavar.h,v 1.4 2002/03/16 14:34:01 jmcneill Exp $ */
/*
@@ -133,6 +133,5 @@ struct esa_softc
int type; /* Allegro-1 or Maestro 3? */
int delay1, delay2;
- void *powerhook;
u_int16_t *savemem;
};
diff --git a/sys/dev/pci/eso.c b/sys/dev/pci/eso.c
index 2094778e71a..d28987f954f 100644
--- a/sys/dev/pci/eso.c
+++ b/sys/dev/pci/eso.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eso.c,v 1.33 2010/08/27 18:50:57 deraadt Exp $ */
+/* $OpenBSD: eso.c,v 1.34 2010/09/07 16:21:44 deraadt Exp $ */
/* $NetBSD: eso.c,v 1.48 2006/12/18 23:13:39 kleink Exp $ */
/*
@@ -130,9 +130,6 @@ int eso_trigger_input(void *, void *, void *, int,
void (*)(void *), void *, struct audio_params *);
void eso_setup(struct eso_softc *, int);
-void eso_powerhook(int, void *);
-
-
struct audio_hw_if eso_hw_if = {
eso_open,
eso_close,
@@ -310,8 +307,6 @@ eso_attach(struct device *parent, struct device *self, void *aux)
aa.hdl = NULL;
(void)config_found(&sc->sc_dev, &aa, audioprint);
- sc->sc_powerhook = powerhook_establish(&eso_powerhook, sc);
-
aa.type = AUDIODEV_TYPE_MPU;
aa.hwif = NULL;
aa.hdl = NULL;
@@ -2085,10 +2080,3 @@ eso_activate(struct device *self, int act)
}
return 0;
}
-
-void
-eso_powerhook(int why, void *self)
-{
- eso_activate(self, why);
-
-}
diff --git a/sys/dev/pci/esovar.h b/sys/dev/pci/esovar.h
index f130392a37f..2dd129c9ffe 100644
--- a/sys/dev/pci/esovar.h
+++ b/sys/dev/pci/esovar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: esovar.h,v 1.4 2007/11/11 01:32:52 jakemsr Exp $ */
+/* $OpenBSD: esovar.h,v 1.5 2010/09/07 16:21:44 deraadt Exp $ */
/* $NetBSD: esovar.h,v 1.5 2004/05/25 21:38:11 kleink Exp $ */
/*
@@ -89,7 +89,6 @@ struct eso_softc {
struct device sc_dev;
pci_intr_handle_t * sc_ih;
unsigned int sc_revision; /* PCI Revision ID */
- void * sc_powerhook;
/* Optionally deferred configuration of Audio 1 DMAC I/O space */
struct pci_attach_args sc_pa;
diff --git a/sys/dev/pci/i82365_pci.c b/sys/dev/pci/i82365_pci.c
index 9aed3ab08dc..e1e4aab8a08 100644
--- a/sys/dev/pci/i82365_pci.c
+++ b/sys/dev/pci/i82365_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82365_pci.c,v 1.10 2010/07/02 04:23:15 blambert Exp $ */
+/* $OpenBSD: i82365_pci.c,v 1.11 2010/09/07 16:21:44 deraadt Exp $ */
/* $NetBSD: i82365_pci.c,v 1.11 2000/02/24 03:42:44 itohy Exp $ */
/*
@@ -198,7 +198,6 @@ pcic_pci_attach(parent, self, aux)
pcic_write(h, PCIC_CSC_INTR,
(sc->irq << PCIC_CSC_INTR_IRQ_SHIFT) |
PCIC_CSC_INTR_CD_ENABLE);
- powerhook_establish(pcic_power, h);
}
}
} else
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 9a79cfe9275..fe4a4c7fa0f 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.301 2010/08/31 17:13:44 deraadt Exp $ */
+/* $OpenBSD: if_bge.c,v 1.302 2010/09/07 16:21:44 deraadt Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -151,7 +151,6 @@ int bge_intr(void *);
void bge_start(struct ifnet *);
int bge_ioctl(struct ifnet *, u_long, caddr_t);
void bge_init(void *);
-void bge_powerhook(int, void *);
void bge_stop_block(struct bge_softc *, bus_size_t, u_int32_t);
void bge_stop(struct bge_softc *);
void bge_watchdog(struct ifnet *);
@@ -2265,7 +2264,6 @@ bge_attach(struct device *parent, struct device *self, void *aux)
ether_ifattach(ifp);
sc->sc_shutdownhook = shutdownhook_establish(bge_shutdown, sc);
- sc->sc_powerhook = powerhook_establish(bge_powerhook, sc);
timeout_set(&sc->bge_timeout, bge_tick, sc);
timeout_set(&sc->bge_rxtimeout, bge_rxtick, sc);
@@ -3737,9 +3735,3 @@ bge_link_upd(struct bge_softc *sc)
BGE_MACSTAT_CFG_CHANGED|BGE_MACSTAT_MI_COMPLETE|
BGE_MACSTAT_LINK_CHANGED);
}
-
-void
-bge_powerhook(int why, void *arg)
-{
- bge_activate(arg, why);
-}
diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h
index 1e40661ac10..e733d7db0c7 100644
--- a/sys/dev/pci/if_bgereg.h
+++ b/sys/dev/pci/if_bgereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bgereg.h,v 1.101 2010/07/09 00:04:42 sthen Exp $ */
+/* $OpenBSD: if_bgereg.h,v 1.102 2010/09/07 16:21:44 deraadt Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -2641,7 +2641,6 @@ struct bge_softc {
int bge_txcnt;
struct timeout bge_timeout;
struct timeout bge_rxtimeout;
- void *sc_powerhook;
void *sc_shutdownhook;
u_int32_t bge_rx_discards;
u_int32_t bge_tx_discards;
diff --git a/sys/dev/pci/if_bnxreg.h b/sys/dev/pci/if_bnxreg.h
index 19462818bfa..466df061031 100644
--- a/sys/dev/pci/if_bnxreg.h
+++ b/sys/dev/pci/if_bnxreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bnxreg.h,v 1.35 2010/05/24 21:23:23 sthen Exp $ */
+/* $OpenBSD: if_bnxreg.h,v 1.36 2010/09/07 16:21:44 deraadt Exp $ */
/*-
* Copyright (c) 2006 Broadcom Corporation
@@ -4776,7 +4776,6 @@ struct bnx_softc {
bus_size_t bnx_size;
void *bnx_intrhand; /* Interrupt handler */
- void *bnx_powerhook;
void *bnx_shutdownhook;
/* ASIC Chip ID. */
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 10991235aed..51152f746b5 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.246 2010/08/31 17:13:44 deraadt Exp $ */
+/* $OpenBSD: if_em.c,v 1.247 2010/09/07 16:21:44 deraadt Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -170,7 +170,6 @@ void em_attach(struct device *, struct device *, void *);
void em_defer_attach(struct device*);
int em_detach(struct device *, int);
int em_activate(struct device *, int);
-void em_powerhook(int, void *);
int em_intr(void *);
void em_start(struct ifnet *);
int em_ioctl(struct ifnet *, u_long, caddr_t);
@@ -281,9 +280,6 @@ em_defer_attach(struct device *self)
pci_intr_disestablish(pc, sc->sc_intrhand);
sc->sc_intrhand = 0;
- if (sc->sc_powerhook != NULL)
- powerhook_disestablish(sc->sc_powerhook);
-
em_stop(sc, 1);
em_free_pci_resources(sc);
@@ -507,7 +503,6 @@ em_attach(struct device *parent, struct device *self, void *aux)
sc->hw.icp_xxxx_is_link_up = FALSE;
INIT_DEBUGOUT("em_attach: end");
- sc->sc_powerhook = powerhook_establish(em_powerhook, sc);
return;
err_mac_addr:
@@ -1857,9 +1852,6 @@ em_detach(struct device *self, int flags)
pci_intr_disestablish(pc, sc->sc_intrhand);
sc->sc_intrhand = 0;
- if (sc->sc_powerhook != NULL)
- powerhook_disestablish(sc->sc_powerhook);
-
em_stop(sc, 1);
em_free_pci_resources(sc);
@@ -1898,12 +1890,6 @@ em_activate(struct device *self, int act)
return (rv);
}
-void
-em_powerhook(int why, void *arg)
-{
- em_activate(arg, why);
-}
-
/*********************************************************************
*
* Workaround for SmartSpeed on 82541 and 82547 controllers
diff --git a/sys/dev/pci/if_em.h b/sys/dev/pci/if_em.h
index e2e5e5de94d..d9cab877ffa 100644
--- a/sys/dev/pci/if_em.h
+++ b/sys/dev/pci/if_em.h
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
/* $FreeBSD: if_em.h,v 1.26 2004/09/01 23:22:41 pdeuskar Exp $ */
-/* $OpenBSD: if_em.h,v 1.47 2010/04/20 22:05:43 tedu Exp $ */
+/* $OpenBSD: if_em.h,v 1.48 2010/09/07 16:21:44 deraadt Exp $ */
#ifndef _EM_H_DEFINED_
#define _EM_H_DEFINED_
@@ -325,7 +325,6 @@ struct em_softc {
struct timeout em_intr_enable;
struct timeout timer_handle;
struct timeout tx_fifo_timer_handle;
- void *sc_powerhook;
#ifdef __STRICT_ALIGNMENT
/* Used for carrying forward alignment adjustments */
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c
index 797eb156847..e670fa0dec0 100644
--- a/sys/dev/pci/if_ipw.c
+++ b/sys/dev/pci/if_ipw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ipw.c,v 1.92 2010/08/27 20:09:01 deraadt Exp $ */
+/* $OpenBSD: if_ipw.c,v 1.93 2010/09/07 16:21:45 deraadt Exp $ */
/*-
* Copyright (c) 2004-2008
@@ -66,7 +66,6 @@ int ipw_match(struct device *, void *, void *);
void ipw_attach(struct device *, struct device *, void *);
int ipw_activate(struct device *, int);
void ipw_resume(void *, void *);
-void ipw_powerhook(int, void *);
int ipw_dma_alloc(struct ipw_softc *);
void ipw_release(struct ipw_softc *);
int ipw_media_change(struct ifnet *);
@@ -277,8 +276,6 @@ ipw_attach(struct device *parent, struct device *self, void *aux)
ic->ic_send_mgmt = ipw_send_mgmt;
ieee80211_media_init(ifp, ipw_media_change, ipw_media_status);
- sc->powerhook = powerhook_establish(ipw_powerhook, sc);
-
#if NBPFILTER > 0
bpfattach(&sc->sc_drvbpf, ifp, DLT_IEEE802_11_RADIO,
sizeof (struct ieee80211_frame) + IEEE80211_RADIOTAP_HDRLEN);
@@ -339,12 +336,6 @@ ipw_resume(void *arg1, void *arg2)
splx(s);
}
-void
-ipw_powerhook(int why, void *arg)
-{
- ipw_activate(arg, why);
-}
-
int
ipw_dma_alloc(struct ipw_softc *sc)
{
diff --git a/sys/dev/pci/if_ipwvar.h b/sys/dev/pci/if_ipwvar.h
index 5c5d83b9abf..4f4b7f41a02 100644
--- a/sys/dev/pci/if_ipwvar.h
+++ b/sys/dev/pci/if_ipwvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ipwvar.h,v 1.20 2010/08/03 18:26:25 kettenis Exp $ */
+/* $OpenBSD: if_ipwvar.h,v 1.21 2010/09/07 16:21:45 deraadt Exp $ */
/*-
* Copyright (c) 2004-2006
@@ -128,7 +128,6 @@ struct ipw_softc {
uint32_t rxcur;
int txfree;
- void *powerhook;
struct workq_task sc_resume_wqt;
#if NBPFILTER > 0
diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c
index 481d4e18924..afdefcf79a3 100644
--- a/sys/dev/pci/if_iwi.c
+++ b/sys/dev/pci/if_iwi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwi.c,v 1.109 2010/08/27 20:09:01 deraadt Exp $ */
+/* $OpenBSD: if_iwi.c,v 1.110 2010/09/07 16:21:45 deraadt Exp $ */
/*-
* Copyright (c) 2004-2008
@@ -76,7 +76,6 @@ int iwi_match(struct device *, void *, void *);
void iwi_attach(struct device *, struct device *, void *);
int iwi_activate(struct device *, int);
void iwi_resume(void *, void *);
-void iwi_powerhook(int, void *);
int iwi_alloc_cmd_ring(struct iwi_softc *, struct iwi_cmd_ring *);
void iwi_reset_cmd_ring(struct iwi_softc *, struct iwi_cmd_ring *);
void iwi_free_cmd_ring(struct iwi_softc *, struct iwi_cmd_ring *);
@@ -313,8 +312,6 @@ iwi_attach(struct device *parent, struct device *self, void *aux)
ic->ic_send_mgmt = iwi_send_mgmt;
ieee80211_media_init(ifp, iwi_media_change, iwi_media_status);
- sc->powerhook = powerhook_establish(iwi_powerhook, sc);
-
#if NBPFILTER > 0
bpfattach(&sc->sc_drvbpf, ifp, DLT_IEEE802_11_RADIO,
sizeof (struct ieee80211_frame) + IEEE80211_RADIOTAP_HDRLEN);
@@ -381,12 +378,6 @@ iwi_resume(void *arg1, void *arg2)
splx(s);
}
-void
-iwi_powerhook(int why, void *arg)
-{
- iwi_activate(arg, why);
-}
-
int
iwi_alloc_cmd_ring(struct iwi_softc *sc, struct iwi_cmd_ring *ring)
{
diff --git a/sys/dev/pci/if_iwivar.h b/sys/dev/pci/if_iwivar.h
index ecd7791dfb5..34d1fb4097f 100644
--- a/sys/dev/pci/if_iwivar.h
+++ b/sys/dev/pci/if_iwivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwivar.h,v 1.22 2010/08/03 18:26:25 kettenis Exp $ */
+/* $OpenBSD: if_iwivar.h,v 1.23 2010/09/07 16:21:45 deraadt Exp $ */
/*-
* Copyright (c) 2004-2006
@@ -114,7 +114,6 @@ struct iwi_softc {
int sc_tx_timer;
- void *powerhook;
struct workq_task sc_resume_wqt;
#if NBPFILTER > 0
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c
index dc4d635065c..9839fed3b50 100644
--- a/sys/dev/pci/if_iwn.c
+++ b/sys/dev/pci/if_iwn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwn.c,v 1.104 2010/08/27 20:09:01 deraadt Exp $ */
+/* $OpenBSD: if_iwn.c,v 1.105 2010/09/07 16:21:45 deraadt Exp $ */
/*-
* Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -107,7 +107,6 @@ void iwn_radiotap_attach(struct iwn_softc *);
int iwn_detach(struct device *, int);
int iwn_activate(struct device *, int);
void iwn_resume(void *, void *);
-void iwn_powerhook(int, void *);
int iwn_nic_lock(struct iwn_softc *);
int iwn_eeprom_lock(struct iwn_softc *);
int iwn_init_otprom(struct iwn_softc *);
@@ -568,9 +567,6 @@ iwn_attach(struct device *parent, struct device *self, void *aux)
iwn_radiotap_attach(sc);
#endif
timeout_set(&sc->calib_to, iwn_calib_timeout, sc);
-
- sc->powerhook = powerhook_establish(iwn_powerhook, sc);
-
return;
/* Free allocated memory if something failed during attachment. */
@@ -713,9 +709,6 @@ iwn_detach(struct device *self, int flags)
if (sc->sc_ih != NULL)
pci_intr_disestablish(sc->sc_pct, sc->sc_ih);
- if (sc->powerhook != NULL)
- powerhook_disestablish(sc->powerhook);
-
/* Free DMA resources. */
iwn_free_rx_ring(sc, &sc->rxq);
for (qid = 0; qid < sc->sc_hal->ntxqs; qid++)
@@ -786,12 +779,6 @@ iwn_resume(void *arg1, void *arg2)
splx(s);
}
-void
-iwn_powerhook(int why, void *arg)
-{
- iwn_activate(arg, why);
-}
-
int
iwn_nic_lock(struct iwn_softc *sc)
{
diff --git a/sys/dev/pci/if_iwnvar.h b/sys/dev/pci/if_iwnvar.h
index 4f882e856b7..f806348f377 100644
--- a/sys/dev/pci/if_iwnvar.h
+++ b/sys/dev/pci/if_iwnvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwnvar.h,v 1.20 2010/07/23 06:43:00 phessler Exp $ */
+/* $OpenBSD: if_iwnvar.h,v 1.21 2010/09/07 16:21:45 deraadt Exp $ */
/*-
* Copyright (c) 2007, 2008
@@ -284,7 +284,6 @@ struct iwn_softc {
uint8_t chainmask;
int sc_tx_timer;
- void *powerhook;
struct workq_task sc_resume_wqt;
#if NBPFILTER > 0
diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c
index f5217dfa714..02f6da6a142 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.95 2010/08/31 17:13:44 deraadt Exp $ */
+/* $OpenBSD: if_nfe.c,v 1.96 2010/09/07 16:21:45 deraadt Exp $ */
/*-
* Copyright (c) 2006, 2007 Damien Bergamini <damien.bergamini@free.fr>
@@ -70,7 +70,6 @@
int nfe_match(struct device *, void *, void *);
void nfe_attach(struct device *, struct device *, void *);
int nfe_activate(struct device *, int);
-void nfe_powerhook(int, void *);
void nfe_miibus_statchg(struct device *);
int nfe_miibus_readreg(struct device *, int, int);
void nfe_miibus_writereg(struct device *, int, int, int);
@@ -383,14 +382,6 @@ nfe_attach(struct device *parent, struct device *self, void *aux)
ether_ifattach(ifp);
timeout_set(&sc->sc_tick_ch, nfe_tick, sc);
-
- sc->sc_powerhook = powerhook_establish(nfe_powerhook, sc);
-}
-
-void
-nfe_powerhook(int why, void *arg)
-{
- nfe_activate(arg, why);
}
void
diff --git a/sys/dev/pci/if_nfevar.h b/sys/dev/pci/if_nfevar.h
index 7aae8e5099f..b02d248574c 100644
--- a/sys/dev/pci/if_nfevar.h
+++ b/sys/dev/pci/if_nfevar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nfevar.h,v 1.13 2007/12/05 08:30:33 jsg Exp $ */
+/* $OpenBSD: if_nfevar.h,v 1.14 2010/09/07 16:21:45 deraadt Exp $ */
/*-
* Copyright (c) 2005 Jonathan Gray <jsg@openbsd.org>
@@ -73,7 +73,6 @@ struct nfe_softc {
bus_dma_tag_t sc_dmat;
struct mii_data sc_mii;
struct timeout sc_tick_ch;
- void *sc_powerhook;
int sc_if_flags;
u_int sc_flags;
diff --git a/sys/dev/pci/if_re_pci.c b/sys/dev/pci/if_re_pci.c
index 993167bf53c..a6907ba5929 100644
--- a/sys/dev/pci/if_re_pci.c
+++ b/sys/dev/pci/if_re_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_re_pci.c,v 1.29 2010/07/27 21:56:11 todd Exp $ */
+/* $OpenBSD: if_re_pci.c,v 1.30 2010/09/07 16:21:45 deraadt Exp $ */
/*
* Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org>
@@ -226,10 +226,6 @@ re_pci_detach(struct device *self, int flags)
ether_ifdetach(ifp);
if_detach(ifp);
- /* No more hooks */
- if (sc->sc_pwrhook != NULL)
- powerhook_disestablish(sc->sc_pwrhook);
-
/* Disable interrupts */
if (psc->sc_ih != NULL)
pci_intr_disestablish(psc->sc_pc, psc->sc_ih);
diff --git a/sys/dev/pci/if_wi_pci.c b/sys/dev/pci/if_wi_pci.c
index 9a6fdfe6c3f..86d9e57ba7e 100644
--- a/sys/dev/pci/if_wi_pci.c
+++ b/sys/dev/pci/if_wi_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_pci.c,v 1.47 2010/08/30 20:42:54 deraadt Exp $ */
+/* $OpenBSD: if_wi_pci.c,v 1.48 2010/09/07 16:21:45 deraadt Exp $ */
/*
* Copyright (c) 2001-2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -85,11 +85,9 @@ int wi_pci_tmd_attach(struct pci_attach_args *pa, struct wi_softc *sc);
int wi_pci_native_attach(struct pci_attach_args *pa, struct wi_softc *sc);
int wi_pci_common_attach(struct pci_attach_args *pa, struct wi_softc *sc);
void wi_pci_plx_print_cis(struct wi_softc *);
-void wi_pci_powerhook(int, void *);
struct wi_pci_softc {
struct wi_softc sc_wi; /* real softc */
- void *sc_powerhook;
struct workq_task sc_resume_wqt;
};
@@ -147,7 +145,6 @@ wi_pci_match(struct device *parent, void *match, void *aux)
void
wi_pci_attach(struct device *parent, struct device *self, void *aux)
{
- struct wi_pci_softc *psc = (struct wi_pci_softc *)self;
struct wi_softc *sc = (struct wi_softc *)self;
struct pci_attach_args *pa = aux;
const struct wi_pci_product *pp;
@@ -157,8 +154,6 @@ wi_pci_attach(struct device *parent, struct device *self, void *aux)
return;
printf("\n");
wi_attach(sc, &wi_func_io);
-
- psc->sc_powerhook = powerhook_establish(wi_pci_powerhook, sc);
}
int
@@ -201,12 +196,6 @@ wi_pci_resume(void *arg1, void *arg2)
splx(s);
}
-void
-wi_pci_powerhook(int why, void *arg)
-{
- wi_pci_activate(arg, why);
-}
-
/*
* ACEX EP1K30-based PCMCIA->PCI bridge attachment.
*
diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c
index 94d18b1e075..1b3017313a7 100644
--- a/sys/dev/pci/if_wpi.c
+++ b/sys/dev/pci/if_wpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wpi.c,v 1.108 2010/08/27 20:09:01 deraadt Exp $ */
+/* $OpenBSD: if_wpi.c,v 1.109 2010/09/07 16:21:45 deraadt Exp $ */
/*-
* Copyright (c) 2006-2008
@@ -77,7 +77,6 @@ void wpi_radiotap_attach(struct wpi_softc *);
int wpi_detach(struct device *, int);
int wpi_activate(struct device *, int);
void wpi_resume(void *, void *);
-void wpi_powerhook(int, void *);
int wpi_nic_lock(struct wpi_softc *);
int wpi_read_prom_data(struct wpi_softc *, uint32_t, void *, int);
int wpi_dma_contig_alloc(bus_dma_tag_t, struct wpi_dma_info *,
@@ -327,9 +326,6 @@ wpi_attach(struct device *parent, struct device *self, void *aux)
wpi_radiotap_attach(sc);
#endif
timeout_set(&sc->calib_to, wpi_calib_timeout, sc);
-
- sc->powerhook = powerhook_establish(wpi_powerhook, sc);
-
return;
/* Free allocated memory if something failed during attachment. */
@@ -372,9 +368,6 @@ wpi_detach(struct device *self, int flags)
if (sc->sc_ih != NULL)
pci_intr_disestablish(sc->sc_pct, sc->sc_ih);
- if (sc->powerhook != NULL)
- powerhook_disestablish(sc->powerhook);
-
/* Free DMA resources. */
wpi_free_rx_ring(sc, &sc->rxq);
for (qid = 0; qid < WPI_NTXQUEUES; qid++)
@@ -436,12 +429,6 @@ wpi_resume(void *arg1, void *arg2)
splx(s);
}
-void
-wpi_powerhook(int why, void *arg)
-{
- wpi_activate(arg, why);
-}
-
int
wpi_nic_lock(struct wpi_softc *sc)
{
diff --git a/sys/dev/pci/if_wpivar.h b/sys/dev/pci/if_wpivar.h
index 0c981701cc1..df92cb7fa9d 100644
--- a/sys/dev/pci/if_wpivar.h
+++ b/sys/dev/pci/if_wpivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wpivar.h,v 1.22 2010/07/22 14:42:43 kettenis Exp $ */
+/* $OpenBSD: if_wpivar.h,v 1.23 2010/09/07 16:21:45 deraadt Exp $ */
/*-
* Copyright (c) 2006-2008
@@ -180,7 +180,6 @@ struct wpi_softc {
int8_t maxpwr[IEEE80211_CHAN_MAX];
int sc_tx_timer;
- void *powerhook;
struct workq_task sc_resume_wqt;
#if NBPFILTER > 0
diff --git a/sys/dev/pci/maestro.c b/sys/dev/pci/maestro.c
index 34d63e2a87c..8a9bd6acfb3 100644
--- a/sys/dev/pci/maestro.c
+++ b/sys/dev/pci/maestro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: maestro.c,v 1.30 2010/08/27 18:50:57 deraadt Exp $ */
+/* $OpenBSD: maestro.c,v 1.31 2010/09/07 16:21:45 deraadt Exp $ */
/* $FreeBSD: /c/ncvs/src/sys/dev/sound/pci/maestro.c,v 1.3 2000/11/21 12:22:11 julian Exp $ */
/*
* FreeBSD's ESS Agogo/Maestro driver
@@ -455,7 +455,6 @@ struct maestro_softc {
struct ac97_host_if host_if;
struct audio_device *sc_audev;
- void *powerhook;
int suspend;
struct maestro_channel play;
@@ -511,7 +510,6 @@ void maestro_initcodec(void *);
void maestro_set_speed(struct maestro_channel *, u_long *);
void maestro_init(struct maestro_softc *);
void maestro_power(struct maestro_softc *, int);
-void maestro_powerhook(int, void *);
void maestro_channel_start(struct maestro_channel *);
void maestro_channel_stop(struct maestro_channel *);
@@ -767,10 +765,6 @@ maestro_attach(parent, self, aux)
/* Attach audio */
audio_attach_mi(&maestro_hw_if, sc, &sc->dev);
-
- /* Hook power changes */
- sc->powerhook = powerhook_establish(maestro_powerhook, sc);
-
return;
bad:
@@ -1553,12 +1547,6 @@ maestro_activate(struct device *self, int act)
}
void
-maestro_powerhook(int why, void *v)
-{
- maestro_activate(v, why);
-}
-
-void
maestro_power(sc, status)
struct maestro_softc *sc;
int status;
diff --git a/sys/dev/pci/neo.c b/sys/dev/pci/neo.c
index 5e70c2ff731..5b4c2320510 100644
--- a/sys/dev/pci/neo.c
+++ b/sys/dev/pci/neo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neo.c,v 1.25 2010/08/27 18:49:40 deraadt Exp $ */
+/* $OpenBSD: neo.c,v 1.26 2010/09/07 16:21:45 deraadt Exp $ */
/*
* Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
@@ -154,8 +154,6 @@ struct neo_softc {
struct ac97_codec_if *codec_if;
struct ac97_host_if host_if;
-
- void *powerhook;
};
static struct neo_firmware *nf;
@@ -208,8 +206,6 @@ void neo_free(void *, void *, int);
size_t neo_round_buffersize(void *, int, size_t);
int neo_get_props(void *);
void neo_set_mixer(struct neo_softc *sc, int a, int d);
-void neo_powerhook(int why, void *arg);
-
struct cfdriver neo_cd = {
NULL, "neo", DV_DULL
@@ -621,8 +617,6 @@ neo_attach(parent, self, aux)
if ((error = ac97_attach(&sc->host_if)) != 0)
return;
- sc->powerhook = powerhook_establish(neo_powerhook, sc);
-
audio_attach_mi(&neo_hw_if, sc, &sc->dev);
return;
@@ -644,12 +638,6 @@ neo_activate(struct device *self, int act)
return 0;
}
-void
-neo_powerhook(int why, void *addr)
-{
- neo_activate(addr, why);
-}
-
int
neo_match(parent, match, aux)
struct device *parent;
diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c
index 396beae47f6..dda8650d4d0 100644
--- a/sys/dev/pci/ohci_pci.c
+++ b/sys/dev/pci/ohci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci_pci.c,v 1.35 2010/08/30 21:30:15 deraadt Exp $ */
+/* $OpenBSD: ohci_pci.c,v 1.36 2010/09/07 16:21:45 deraadt Exp $ */
/* $NetBSD: ohci_pci.c,v 1.23 2002/10/02 16:51:47 thorpej Exp $ */
/*
@@ -189,12 +189,6 @@ ohci_pci_attach_deferred(struct device *self)
splx(s);
return;
}
-
- sc->sc.sc_powerhook = powerhook_establish(ohci_powerhook, &sc->sc);
- if (sc->sc.sc_powerhook == NULL)
- printf("%s: unable to establish powerhook\n",
- sc->sc.sc_bus.bdev.dv_xname);
-
splx(s);
/* Attach usb device. */
@@ -212,9 +206,6 @@ ohci_pci_detach(struct device *self, int flags)
if (rv)
return (rv);
- if (sc->sc.sc_powerhook != NULL)
- powerhook_disestablish(sc->sc.sc_powerhook);
-
if (sc->sc_ih != NULL) {
pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
sc->sc_ih = NULL;
diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c
index 1feb1a395e3..ee07d00828f 100644
--- a/sys/dev/pci/pccbb.c
+++ b/sys/dev/pci/pccbb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccbb.c,v 1.81 2010/09/06 18:34:34 kettenis Exp $ */
+/* $OpenBSD: pccbb.c,v 1.82 2010/09/07 16:21:45 deraadt Exp $ */
/* $NetBSD: pccbb.c,v 1.96 2004/03/28 09:49:31 nakayama Exp $ */
/*
@@ -148,7 +148,6 @@ int pccbb_pcmcia_card_detect(pcmcia_chipset_handle_t pch);
void pccbb_pcmcia_do_io_map(struct pcic_handle *, int);
void pccbb_pcmcia_wait_ready(struct pcic_handle *);
void pccbb_pcmcia_do_mem_map(struct pcic_handle *, int);
-void pccbb_powerhook(int, void *);
/* bus-space allocation and deallocation functions */
int pccbb_rbus_cb_space_alloc(cardbus_chipset_tag_t, rbus_tag_t,
@@ -502,8 +501,6 @@ pccbb_pci_callback(struct device *self)
sc->sc_pil = NULL;
sc->sc_pil_intr_enable = 1;
- powerhook_establish(pccbb_powerhook, sc);
-
sockstat = bus_space_read_4(base_memt, base_memh, CB_SOCKET_STAT);
if ((sockstat & CB_SOCKET_STAT_CD) == 0)
sc->sc_flags |= CBB_CARDEXIST;
@@ -2904,9 +2901,3 @@ pccbbactivate(struct device *self, int act)
}
return (rv);
}
-
-void
-pccbb_powerhook(int why, void *arg)
-{
- pccbbactivate(arg, why);
-}
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 46d4fd8b39c..96ac03f5c77 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci.c,v 1.85 2010/09/06 19:20:23 deraadt Exp $ */
+/* $OpenBSD: pci.c,v 1.86 2010/09/07 16:21:45 deraadt Exp $ */
/* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */
/*
@@ -49,7 +49,6 @@
int pcimatch(struct device *, void *, void *);
void pciattach(struct device *, struct device *, void *);
int pcidetach(struct device *, int);
-void pcipowerhook(int, void *);
int pciactivate(struct device *, int);
void pci_suspend(struct pci_softc *);
void pci_resume(struct pci_softc *);
@@ -163,7 +162,6 @@ pciattach(struct device *parent, struct device *self, void *aux)
printf("\n");
LIST_INIT(&sc->sc_devs);
- sc->sc_powerhook = powerhook_establish(pcipowerhook, sc);
sc->sc_iot = pba->pba_iot;
sc->sc_memt = pba->pba_memt;
@@ -213,20 +211,6 @@ pciactivate(struct device *self, int act)
return (rv);
}
-/* save and restore the pci config space */
-void
-pcipowerhook(int why, void *arg)
-{
- switch (why) {
- case DVACT_SUSPEND:
- pci_suspend(arg);
- break;
- case DVACT_RESUME:
- pci_resume(arg);
- break;
- }
-}
-
void
pci_suspend(struct pci_softc *sc)
{
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index ad5a5c12649..d1b36b41f4b 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcivar.h,v 1.62 2010/09/05 18:14:33 kettenis Exp $ */
+/* $OpenBSD: pcivar.h,v 1.63 2010/09/07 16:21:45 deraadt Exp $ */
/* $NetBSD: pcivar.h,v 1.23 1997/06/06 23:48:05 thorpej Exp $ */
/*
@@ -183,7 +183,6 @@ struct pci_softc {
struct extent *sc_ioex;
struct extent *sc_memex;
struct extent *sc_pmemex;
- void *sc_powerhook;
LIST_HEAD(, pci_dev) sc_devs;
int sc_domain, sc_bus, sc_maxndevs;
pcitag_t *sc_bridgetag;
diff --git a/sys/dev/pci/sdhc_pci.c b/sys/dev/pci/sdhc_pci.c
index c9bd33d6446..32225b63dea 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.9 2010/08/27 15:41:42 deraadt Exp $ */
+/* $OpenBSD: sdhc_pci.c,v 1.10 2010/09/07 16:21:46 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -143,9 +143,8 @@ sdhc_pci_attach(struct device *parent, struct device *self, void *aux)
}
/*
- * Establish power and shutdown hooks.
+ * Establish shutdown hooks.
*/
- (void)powerhook_establish(sdhc_powerhook, &sc->sc);
(void)shutdownhook_establish(sdhc_shutdown, &sc->sc);
}
diff --git a/sys/dev/pci/yds.c b/sys/dev/pci/yds.c
index 530c5bf1c88..c19cbe467a6 100644
--- a/sys/dev/pci/yds.c
+++ b/sys/dev/pci/yds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yds.c,v 1.36 2010/09/06 19:20:23 deraadt Exp $ */
+/* $OpenBSD: yds.c,v 1.37 2010/09/07 16:21:46 deraadt Exp $ */
/* $NetBSD: yds.c,v 1.5 2001/05/21 23:55:04 minoura Exp $ */
/*
@@ -196,7 +196,6 @@ static u_int32_t yds_get_lpfq(u_int);
static u_int32_t yds_get_lpfk(u_int);
static struct yds_dma *yds_find_dma(struct yds_softc *, void *);
-void yds_powerhook(int, void *);
int yds_init(void *sc);
void yds_attachhook(void *);
@@ -823,8 +822,6 @@ yds_attachhook(void *xsc)
/* Watch for power changes */
sc->suspend = DVACT_RESUME;
- sc->powerhook = powerhook_establish(yds_powerhook, sc);
-
yds_configure_legacy(sc);
}
@@ -1820,12 +1817,6 @@ yds_activate(struct device *self, int act)
return 0;
}
-void
-yds_powerhook(int why, void *self)
-{
- yds_activate(self, why);
-}
-
int
yds_init(sc_)
void *sc_;
diff --git a/sys/dev/pci/ydsreg.h b/sys/dev/pci/ydsreg.h
index 4515a266a1e..1fb6f05cadf 100644
--- a/sys/dev/pci/ydsreg.h
+++ b/sys/dev/pci/ydsreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ydsreg.h,v 1.5 2004/12/20 12:29:36 deraadt Exp $ */
+/* $OpenBSD: ydsreg.h,v 1.6 2010/09/07 16:21:46 deraadt Exp $ */
/* $NetBSD$ */
/*
@@ -398,7 +398,6 @@ struct yds_softc {
/*
* Suspend/resume support
*/
- void *powerhook;
int suspend;
};
#define sc_opl_iot sc_legacy_iot
diff --git a/sys/dev/pcmcia/if_ray.c b/sys/dev/pcmcia/if_ray.c
index c12366b7b73..d3fde4b6003 100644
--- a/sys/dev/pcmcia/if_ray.c
+++ b/sys/dev/pcmcia/if_ray.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ray.c,v 1.44 2010/09/06 19:20:23 deraadt Exp $ */
+/* $OpenBSD: if_ray.c,v 1.45 2010/09/07 16:21:46 deraadt Exp $ */
/* $NetBSD: if_ray.c,v 1.21 2000/07/05 02:35:54 onoe Exp $ */
/*
@@ -172,7 +172,6 @@ struct ray_softc {
struct pcmcia_mem_handle sc_mem;
int sc_window;
void *sc_ih;
- void *sc_pwrhook;
int sc_flags;
#define RAY_FLAGS_RESUMEINIT 0x01
#define RAY_FLAGS_ATTACHED 0x02
@@ -633,8 +632,6 @@ ray_attach(struct device *parent, struct device *self, void *aux)
/* disable the card */
pcmcia_function_disable(sc->sc_pf);
- sc->sc_pwrhook = powerhook_establish(ray_power, sc);
-
/* The attach is successful. */
sc->sc_flags |= RAY_FLAGS_ATTACHED;
return;
@@ -701,9 +698,6 @@ ray_detach(struct device *self, int flags)
ether_ifdetach(ifp);
if_detach(ifp);
- if (sc->sc_pwrhook != NULL)
- powerhook_disestablish(sc->sc_pwrhook);
-
return (0);
}
diff --git a/sys/dev/pcmcia/pcmcia.c b/sys/dev/pcmcia/pcmcia.c
index 5fe71c39ce3..5ca7638e957 100644
--- a/sys/dev/pcmcia/pcmcia.c
+++ b/sys/dev/pcmcia/pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmcia.c,v 1.42 2010/09/01 11:45:42 miod Exp $ */
+/* $OpenBSD: pcmcia.c,v 1.43 2010/09/07 16:21:46 deraadt Exp $ */
/* $NetBSD: pcmcia.c,v 1.9 1998/08/13 02:10:55 eeh Exp $ */
/*
@@ -58,7 +58,6 @@ void pcmcia_attach(struct device *, struct device *, void *);
int pcmcia_activate(struct device *, int);
int pcmcia_print(void *, const char *);
void pcmcia_card_detach_notify(struct device *, void *);
-void pcmcia_powerhook(int why, void *arg);
static inline void pcmcia_socket_enable(pcmcia_chipset_tag_t,
pcmcia_chipset_handle_t *);
@@ -130,7 +129,6 @@ pcmcia_attach(parent, self, aux)
sc->iosize = paa->iosize;
sc->ih = NULL;
- powerhook_establish(pcmcia_powerhook, sc);
}
int
@@ -167,12 +165,6 @@ pcmcia_activate(struct device *self, int act)
return (0);
}
-void
-pcmcia_powerhook(int why, void *arg)
-{
- pcmcia_activate(arg, why);
-}
-
int
pcmcia_card_attach(dev)
struct device *dev;
diff --git a/sys/dev/sdmmc/sdhc.c b/sys/dev/sdmmc/sdhc.c
index 2a4d5f21a1b..03d60bae7db 100644
--- a/sys/dev/sdmmc/sdhc.c
+++ b/sys/dev/sdmmc/sdhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhc.c,v 1.32 2010/08/31 17:13:47 deraadt Exp $ */
+/* $OpenBSD: sdhc.c,v 1.33 2010/09/07 16:21:46 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -285,12 +285,6 @@ sdhc_activate(struct device *self, int act)
return (rv);
}
-void
-sdhc_powerhook(int why, void *arg)
-{
- sdhc_activate(arg, why);
-}
-
/*
* Shutdown hook established by or called from attachment driver.
*/
diff --git a/sys/dev/sdmmc/sdhcvar.h b/sys/dev/sdmmc/sdhcvar.h
index ae035232689..ac16eac30d6 100644
--- a/sys/dev/sdmmc/sdhcvar.h
+++ b/sys/dev/sdmmc/sdhcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhcvar.h,v 1.4 2010/08/27 15:41:43 deraadt Exp $ */
+/* $OpenBSD: sdhcvar.h,v 1.5 2010/09/07 16:21:46 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -34,7 +34,6 @@ struct sdhc_softc {
int sdhc_host_found(struct sdhc_softc *, bus_space_tag_t,
bus_space_handle_t, bus_size_t, int);
int sdhc_activate(struct device *, int);
-void sdhc_powerhook(int, void *);
void sdhc_shutdown(void *);
int sdhc_intr(void *);
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c
index 38bc81d01e1..714b3f08de2 100644
--- a/sys/dev/usb/ehci.c
+++ b/sys/dev/usb/ehci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci.c,v 1.109 2010/08/31 17:13:47 deraadt Exp $ */
+/* $OpenBSD: ehci.c,v 1.110 2010/09/07 16:21:46 deraadt Exp $ */
/* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */
/*
@@ -123,8 +123,6 @@ struct ehci_pipe {
u_int8_t ehci_reverse_bits(u_int8_t, int);
-void ehci_powerhook(int, void *);
-
usbd_status ehci_open(usbd_pipe_handle);
void ehci_poll(struct usbd_bus *);
void ehci_softintr(void *);
@@ -419,8 +417,6 @@ ehci_init(ehci_softc_t *sc)
sc->sc_bus.methods = &ehci_bus_methods;
sc->sc_bus.pipe_size = sizeof(struct ehci_pipe);
- sc->sc_powerhook = powerhook_establish(ehci_powerhook, sc);
-
sc->sc_eintrs = EHCI_NORMAL_INTRS;
/*
@@ -1012,8 +1008,6 @@ ehci_detach(struct ehci_softc *sc, int flags)
timeout_del(&sc->sc_tmo_intrlist);
- if (sc->sc_powerhook != NULL)
- powerhook_disestablish(sc->sc_powerhook);
if (sc->sc_shutdownhook != NULL)
shutdownhook_disestablish(sc->sc_shutdownhook);
@@ -1141,12 +1135,6 @@ ehci_activate(struct device *self, int act)
return (rv);
}
-void
-ehci_powerhook(int why, void *v)
-{
- ehci_activate(v, why);
-}
-
/*
* Shut down the controller when the system is going down.
*/
diff --git a/sys/dev/usb/ehcivar.h b/sys/dev/usb/ehcivar.h
index e9020c4c75a..9970ac4b516 100644
--- a/sys/dev/usb/ehcivar.h
+++ b/sys/dev/usb/ehcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehcivar.h,v 1.18 2009/10/13 19:33:17 pirofti Exp $ */
+/* $OpenBSD: ehcivar.h,v 1.19 2010/09/07 16:21:46 deraadt Exp $ */
/* $NetBSD: ehcivar.h,v 1.19 2005/04/29 15:04:29 augustss Exp $ */
/*
@@ -123,7 +123,6 @@ typedef struct ehci_softc {
int sc_id_vendor; /* vendor ID for root hub */
u_int32_t sc_cmd; /* shadow of cmd reg during suspend */
- void *sc_powerhook; /* cookie from power hook */
void *sc_shutdownhook; /* cookie from shutdown hook */
usb_dma_t sc_fldma;
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index 87740999011..fa543d0fe29 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci.c,v 1.98 2010/08/31 16:59:47 deraadt Exp $ */
+/* $OpenBSD: ohci.c,v 1.99 2010/09/07 16:21:46 deraadt Exp $ */
/* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
@@ -1023,19 +1023,6 @@ ohci_shutdown(void *v)
OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
}
-/*
- * Handle suspend/resume.
- *
- * We need to switch to polling mode here, because this routine is
- * called from an interrupt context. This is all right since we
- * are almost suspended anyway.
- */
-void
-ohci_powerhook(int why, void *v)
-{
- ohci_activate(v, why);
-}
-
#ifdef OHCI_DEBUG
void
ohci_dumpregs(ohci_softc_t *sc)
diff --git a/sys/dev/usb/ohcivar.h b/sys/dev/usb/ohcivar.h
index 5e98b4962fe..aa7c8877db7 100644
--- a/sys/dev/usb/ohcivar.h
+++ b/sys/dev/usb/ohcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohcivar.h,v 1.29 2010/08/30 21:30:17 deraadt Exp $ */
+/* $OpenBSD: ohcivar.h,v 1.30 2010/09/07 16:21:46 deraadt Exp $ */
/* $NetBSD: ohcivar.h,v 1.32 2003/02/22 05:24:17 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.13 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -116,7 +116,6 @@ typedef struct ohci_softc {
char sc_vendor[16];
int sc_id_vendor;
- void *sc_powerhook; /* cookie from power hook */
void *sc_shutdownhook; /* cookie from shutdown hook */
u_int32_t sc_control; /* Preserved during suspend/standby */
@@ -144,4 +143,3 @@ usbd_status ohci_init(ohci_softc_t *);
int ohci_intr(void *);
int ohci_detach(ohci_softc_t *, int);
int ohci_activate(struct device *, int);
-void ohci_powerhook(int, void *);
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index dbd32360ace..50eacad3f27 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.80 2010/09/06 19:20:24 deraadt Exp $ */
+/* $OpenBSD: uhci.c,v 1.81 2010/09/07 16:21:46 deraadt Exp $ */
/* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -129,7 +129,6 @@ void uhci_globalreset(uhci_softc_t *);
usbd_status uhci_portreset(uhci_softc_t*, int);
void uhci_reset(uhci_softc_t *);
void uhci_shutdown(void *v);
-void uhci_powerhook(int, void *);
usbd_status uhci_run(uhci_softc_t *, int run);
uhci_soft_td_t *uhci_alloc_std(uhci_softc_t *);
void uhci_free_std(uhci_softc_t *, uhci_soft_td_t *);
@@ -508,7 +507,6 @@ uhci_init(uhci_softc_t *sc)
sc->sc_bus.pipe_size = sizeof(struct uhci_pipe);
sc->sc_suspend = DVACT_RESUME;
- sc->sc_powerhook = powerhook_establish(uhci_powerhook, sc);
sc->sc_shutdownhook = shutdownhook_establish(uhci_shutdown, sc);
UHCICMD(sc, UHCI_CMD_MAXP); /* Assume 64 byte packets at frame end */
@@ -548,7 +546,7 @@ uhci_activate(struct device *self, int act)
usb_delay_ms(&sc->sc_bus, USB_RESUME_WAIT);
sc->sc_suspend = act;
sc->sc_bus.use_polling--;
- DPRINTF(("uhci_powerhook: cmd=0x%x\n", UREAD2(sc, UHCI_CMD)));
+ DPRINTF(("uhci_activate: cmd=0x%x\n", UREAD2(sc, UHCI_CMD)));
break;
case DVACT_RESUME:
#ifdef DIAGNOSTIC
@@ -605,8 +603,6 @@ uhci_detach(struct uhci_softc *sc, int flags)
if (rv != 0)
return (rv);
- if (sc->sc_powerhook != NULL)
- powerhook_disestablish(sc->sc_powerhook);
if (sc->sc_shutdownhook != NULL)
shutdownhook_disestablish(sc->sc_shutdownhook);
@@ -724,19 +720,6 @@ uhci_shutdown(void *v)
uhci_run(sc, 0); /* stop the controller */
}
-/*
- * Handle suspend/resume.
- *
- * We need to switch to polling mode here, because this routine is
- * called from an interrupt context. This is all right since we
- * are almost suspended anyway.
- */
-void
-uhci_powerhook(int why, void *v)
-{
- uhci_activate(v, why);
-}
-
#ifdef UHCI_DEBUG
void
uhci_dumpregs(uhci_softc_t *sc)
diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h
index c7ea2d0059d..ca55724b514 100644
--- a/sys/dev/usb/uhcivar.h
+++ b/sys/dev/usb/uhcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhcivar.h,v 1.22 2009/11/04 19:14:10 kettenis Exp $ */
+/* $OpenBSD: uhcivar.h,v 1.23 2010/09/07 16:21:46 deraadt Exp $ */
/* $NetBSD: uhcivar.h,v 1.36 2002/12/31 00:39:11 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhcivar.h,v 1.14 1999/11/17 22:33:42 n_hibma Exp $ */
@@ -171,7 +171,6 @@ typedef struct uhci_softc {
char sc_vendor[32]; /* vendor string for root hub */
int sc_id_vendor; /* vendor ID for root hub */
- void *sc_powerhook; /* cookie from power hook */
void *sc_shutdownhook; /* cookie from shutdown hook */
struct device *sc_child; /* /dev/usb# device */
diff --git a/sys/dev/vesa/vesafbvar.h b/sys/dev/vesa/vesafbvar.h
index 659f04670fe..c9bcdb6a6a7 100644
--- a/sys/dev/vesa/vesafbvar.h
+++ b/sys/dev/vesa/vesafbvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vesafbvar.h,v 1.1 2006/11/27 18:04:28 gwk Exp $ */
+/* $OpenBSD: vesafbvar.h,v 1.2 2010/09/07 16:21:47 deraadt Exp $ */
/*-
* Copyright (c) 2006 Jared D. McNeill <jmcneill@invisible.ca>
@@ -70,7 +70,6 @@ struct vesafb_softc {
int sc_pm;
uint8_t sc_pmver;
uint8_t sc_pmstates;
- void *sc_powerhook;
};
diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c
index 71242e0d59b..17db66e758a 100644
--- a/sys/kern/kern_subr.c
+++ b/sys/kern/kern_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_subr.c,v 1.33 2010/09/06 19:20:24 deraadt Exp $ */
+/* $OpenBSD: kern_subr.c,v 1.34 2010/09/07 16:21:47 deraadt Exp $ */
/* $NetBSD: kern_subr.c,v 1.15 1996/04/09 17:21:56 ragge Exp $ */
/*
@@ -248,73 +248,3 @@ dohooks(struct hook_desc_head *head, int flags)
}
}
}
-
-/*
- * "Power hook" types, functions, and variables.
- */
-
-struct powerhook_desc {
- CIRCLEQ_ENTRY(powerhook_desc) sfd_list;
- void (*sfd_fn)(int, void *);
- void *sfd_arg;
-};
-
-CIRCLEQ_HEAD(, powerhook_desc) powerhook_list =
- CIRCLEQ_HEAD_INITIALIZER(powerhook_list);
-
-void *
-powerhook_establish(void (*fn)(int, void *), void *arg)
-{
- struct powerhook_desc *ndp;
-
- ndp = (struct powerhook_desc *)
- malloc(sizeof(*ndp), M_DEVBUF, M_NOWAIT);
- if (ndp == NULL)
- return NULL;
-
- ndp->sfd_fn = fn;
- ndp->sfd_arg = arg;
- CIRCLEQ_INSERT_HEAD(&powerhook_list, ndp, sfd_list);
-
- return (ndp);
-}
-
-void
-powerhook_disestablish(void *vhook)
-{
-#ifdef DIAGNOSTIC
- struct powerhook_desc *dp;
-
- CIRCLEQ_FOREACH(dp, &powerhook_list, sfd_list)
- if (dp == vhook)
- break;
- if (dp == NULL)
- panic("powerhook_disestablish: hook not established");
-#endif
-
- CIRCLEQ_REMOVE(&powerhook_list, (struct powerhook_desc *)vhook,
- sfd_list);
- free(vhook, M_DEVBUF);
-}
-
-/*
- * Run power hooks.
- */
-void
-dopowerhooks(int why)
-{
- struct powerhook_desc *dp;
- int s;
-
- s = splhigh();
- if (why == DVACT_RESUME) {
- CIRCLEQ_FOREACH_REVERSE(dp, &powerhook_list, sfd_list) {
- (*dp->sfd_fn)(why, dp->sfd_arg);
- }
- } else {
- CIRCLEQ_FOREACH(dp, &powerhook_list, sfd_list) {
- (*dp->sfd_fn)(why, dp->sfd_arg);
- }
- }
- splx(s);
-}
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index 66727207b74..26311902041 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.186 2010/09/07 04:42:15 deraadt Exp $ */
+/* $OpenBSD: cd.c,v 1.187 2010/09/07 16:21:47 deraadt Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -114,7 +114,6 @@ struct cd_softc {
struct bufq sc_bufq;
struct scsi_xshandler sc_xsh;
struct timeout sc_timeout;
- void *sc_cdpwrhook; /* our power hook */
};
void cdstart(struct scsi_xfer *);
@@ -146,9 +145,6 @@ int dvd_read_bca(struct cd_softc *, union dvd_struct *);
int dvd_read_manufact(struct cd_softc *, union dvd_struct *);
int dvd_read_struct(struct cd_softc *, union dvd_struct *);
-void cd_powerhook(int why, void *arg);
-void cd_resume(struct cd_softc *);
-
#if defined(__macppc__)
int cd_eject(void);
#endif
@@ -232,10 +228,6 @@ cdattach(struct device *parent, struct device *self, void *aux)
timeout_set(&sc->sc_timeout, (void (*)(void *))scsi_xsh_add,
&sc->sc_xsh);
- if ((sc->sc_cdpwrhook = powerhook_establish(cd_powerhook, sc)) == NULL)
- printf("%s: WARNING: unable to establish power hook\n",
- sc->sc_dev.dv_xname);
-
/* Attach disk. */
disk_attach(&sc->sc_dk);
}
@@ -256,7 +248,9 @@ cdactivate(struct device *self, int act)
* there are any open partitions, lock the CD.
*/
if (sc->sc_dk.dk_openmask != 0)
- cd_resume(sc);
+ scsi_prevent(sc->sc_link, PR_PREVENT,
+ SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE |
+ SCSI_SILENT | SCSI_AUTOCONF);
break;
case DVACT_DEACTIVATE:
sc->sc_flags |= CDF_DYING;
@@ -266,23 +260,6 @@ cdactivate(struct device *self, int act)
return (rv);
}
-void
-cd_resume(struct cd_softc *sc)
-{
- scsi_prevent(sc->sc_link, PR_PREVENT,
- SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE |
- SCSI_SILENT | SCSI_AUTOCONF);
-}
-
-void
-cd_powerhook(int why, void *arg)
-{
- struct cd_softc *sc = arg;
-
- if (why == DVACT_RESUME && sc->sc_dk.dk_openmask != 0)
- cd_resume(sc);
-}
-
int
cddetach(struct device *self, int flags)
{
@@ -301,10 +278,6 @@ cddetach(struct device *self, int flags)
if (cdevsw[cmaj].d_open == cdopen)
vdevgone(cmaj, mn, mn + MAXPARTITIONS - 1, VCHR);
- /* Get rid of the power hook. */
- if (sc->sc_cdpwrhook != NULL)
- powerhook_disestablish(sc->sc_cdpwrhook);
-
/* Detach disk. */
bufq_destroy(&sc->sc_bufq);
disk_detach(&sc->sc_dk);
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index c81319b1197..5324713b381 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: systm.h,v 1.84 2010/09/06 19:20:24 deraadt Exp $ */
+/* $OpenBSD: systm.h,v 1.85 2010/09/07 16:21:47 deraadt Exp $ */
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
/*-
@@ -294,13 +294,6 @@ void dohooks(struct hook_desc_head *, int);
hook_disestablish(&mountroothook_list, (vhook))
#define domountroothooks() dohooks(&mountroothook_list, HOOK_REMOVE|HOOK_FREE)
-/*
- * Power management hooks.
- */
-void *powerhook_establish(void (*)(int, void *), void *);
-void powerhook_disestablish(void *);
-void dopowerhooks(int);
-
struct uio;
int uiomove(void *, int, struct uio *);