summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-09-20 07:40:43 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-09-20 07:40:43 +0000
commita8d7c69788c334b14d463ae7d62315f192665c1a (patch)
tree2c4568c37f5dd209be9f93da275f6571a5a0a739
parent6457664f9f4ba52fa78a62ee7a55d34402deef45 (diff)
Stop doing shutdown hooks in network drivers where possible. We already
take all interfaces down, via their xxstop routines. Claudio and I have verified that none of the shutdown hooks do much extra beyond what xxstop was already doing; it is largely a pile of junk. ok claudio, some early comments by sthen; also read by matthew, jsg
-rw-r--r--sys/arch/vax/bi/if_ni.c23
-rw-r--r--sys/arch/vax/qbus/if_de.c17
-rw-r--r--sys/dev/eisa/if_fea.c7
-rw-r--r--sys/dev/ic/gemvar.h3
-rw-r--r--sys/dev/ic/pdqvar.h3
-rw-r--r--sys/dev/ic/pgt.c27
-rw-r--r--sys/dev/ic/pgtvar.h4
-rw-r--r--sys/dev/ic/ti.c18
-rw-r--r--sys/dev/ic/xl.c17
-rw-r--r--sys/dev/ic/xlreg.h3
-rw-r--r--sys/dev/pci/if_bge.c18
-rw-r--r--sys/dev/pci/if_bgereg.h3
-rw-r--r--sys/dev/pci/if_bnx.c20
-rw-r--r--sys/dev/pci/if_bnxreg.h3
-rw-r--r--sys/dev/pci/if_cas.c17
-rw-r--r--sys/dev/pci/if_casvar.h3
-rw-r--r--sys/dev/pci/if_de.c18
-rw-r--r--sys/dev/pci/if_fpa.c8
-rw-r--r--sys/dev/pci/if_lmc_obsd.c19
-rw-r--r--sys/dev/pci/if_msk.c25
-rw-r--r--sys/dev/pci/if_mskvar.h5
-rw-r--r--sys/dev/pci/if_nge.c17
-rw-r--r--sys/dev/pci/if_pcn.c25
-rw-r--r--sys/dev/pci/if_sk.c25
-rw-r--r--sys/dev/pci/if_skvar.h5
-rw-r--r--sys/dev/pci/if_txp.c20
-rw-r--r--sys/dev/tc/if_fta.c8
27 files changed, 29 insertions, 332 deletions
diff --git a/sys/arch/vax/bi/if_ni.c b/sys/arch/vax/bi/if_ni.c
index 59afd794221..88e25152930 100644
--- a/sys/arch/vax/bi/if_ni.c
+++ b/sys/arch/vax/bi/if_ni.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ni.c,v 1.14 2009/03/29 21:53:52 sthen Exp $ */
+/* $OpenBSD: if_ni.c,v 1.15 2010/09/20 07:40:41 deraadt Exp $ */
/* $NetBSD: if_ni.c,v 1.15 2002/05/22 16:03:14 wiz Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -140,7 +140,6 @@ static int niioctl(struct ifnet *, u_long, caddr_t);
static int ni_add_rxbuf(struct ni_softc *, struct ni_dg *, int);
static void ni_setup(struct ni_softc *);
static void nitimeout(struct ifnet *);
-static void ni_shutdown(void *);
static void ni_getpgs(struct ni_softc *sc, int size, caddr_t *v, paddr_t *p);
static int failtest(struct ni_softc *, int, int, int, char *);
@@ -467,9 +466,6 @@ retry: WAITREG(NI_PCR, PCR_OWN);
*/
if_attach(ifp);
ether_ifattach(ifp, sc->sc_enaddr);
- if (shutdownhook_establish(ni_shutdown, sc) == 0)
- printf("%s: WARNING: unable to establish shutdown hook\n",
- sc->sc_dev.dv_xname);
}
/*
@@ -866,20 +862,3 @@ nitimeout(ifp)
niinit(sc);
#endif
}
-
-/*
- * Shutdown hook. Make sure the interface is stopped at reboot.
- */
-void
-ni_shutdown(arg)
- void *arg;
-{
- struct ni_softc *sc = arg;
-
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_OWN|PCR_SHUTDOWN);
- WAITREG(NI_PCR, PCR_OWN);
- WAITREG(NI_PSR, PSR_OWN);
-
-}
-
diff --git a/sys/arch/vax/qbus/if_de.c b/sys/arch/vax/qbus/if_de.c
index 53e556f15c6..d3c082dec1c 100644
--- a/sys/arch/vax/qbus/if_de.c
+++ b/sys/arch/vax/qbus/if_de.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_de.c,v 1.9 2010/08/27 17:08:01 jsg Exp $ */
+/* $OpenBSD: if_de.c,v 1.10 2010/09/20 07:40:41 deraadt Exp $ */
/* $NetBSD: if_de.c,v 1.11 2001/11/13 07:11:24 lukem Exp $ */
/*
@@ -130,7 +130,6 @@ struct de_softc {
int sc_rindex; /* UNA index into receive chain */
int sc_xfree; /* index for next transmit buffer */
int sc_nxmit; /* # of transmits in progress */
- void *sc_sh; /* shutdownhook cookie */
};
static int dematch(struct device *, struct cfdata *, void *);
@@ -143,7 +142,6 @@ static void destop(struct ifnet *, int);
static void destart(struct ifnet *);
static void derecv(struct de_softc *);
static void deintr(void *);
-static void deshutdown(void *);
struct cfattach de_ca = {
sizeof(struct de_softc), dematch, deattach
@@ -236,8 +234,6 @@ deattach(struct device *parent, struct device *self, void *aux)
if_attach(ifp);
ether_ifattach(ifp, myaddr);
ubmemfree((struct uba_softc *)parent, &sc->sc_ui);
-
- sc->sc_sh = shutdownhook_establish(deshutdown, sc);
}
void
@@ -613,14 +609,3 @@ dematch(struct device *parent, struct cfdata *cf, void *aux)
return 1;
}
-
-void
-deshutdown(void *arg)
-{
- struct de_softc *sc = arg;
-
- DE_WCSR(DE_PCSR0, 0);
- DELAY(1000);
- DE_WCSR(DE_PCSR0, PCSR0_RSET);
- dewait(sc, "shutdown");
-}
diff --git a/sys/dev/eisa/if_fea.c b/sys/dev/eisa/if_fea.c
index 392788ad47f..812ac701f40 100644
--- a/sys/dev/eisa/if_fea.c
+++ b/sys/dev/eisa/if_fea.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_fea.c,v 1.19 2009/08/13 14:24:46 jasper Exp $ */
+/* $OpenBSD: if_fea.c,v 1.20 2010/09/20 07:40:42 deraadt Exp $ */
/* $NetBSD: if_fea.c,v 1.9 1996/10/21 22:31:05 thorpej Exp $ */
/*-
@@ -225,11 +225,6 @@ pdq_eisa_attach(parent, self, aux)
pdq_ifattach(sc, NULL);
- sc->sc_ats = shutdownhook_establish((void (*)(void *)) pdq_hwreset,
- sc->sc_pdq);
- if (sc->sc_ats == NULL)
- printf("%s: warning: can't establish shutdown hook\n",
- self->dv_xname);
#if !defined(PDQ_IOMAPPED)
printf("%s: using iomem 0x%x-0x%x\n", sc->sc_dev.dv_xname, maddr,
maddr + msize - 1);
diff --git a/sys/dev/ic/gemvar.h b/sys/dev/ic/gemvar.h
index 6f03356a857..9a084aaeef8 100644
--- a/sys/dev/ic/gemvar.h
+++ b/sys/dev/ic/gemvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: gemvar.h,v 1.25 2010/08/27 08:05:01 deraadt Exp $ */
+/* $OpenBSD: gemvar.h,v 1.26 2010/09/20 07:40:41 deraadt Exp $ */
/* $NetBSD: gemvar.h,v 1.1 2001/09/16 00:11:43 eeh Exp $ */
/*
@@ -198,7 +198,6 @@ struct gem_softc {
/* ========== */
int sc_inited;
int sc_debug;
- void *sc_sh; /* shutdownhook cookie */
/* Special hardware hooks */
void (*sc_hwreset)(struct gem_softc *);
diff --git a/sys/dev/ic/pdqvar.h b/sys/dev/ic/pdqvar.h
index 34b7d585096..0b1de57c2a9 100644
--- a/sys/dev/ic/pdqvar.h
+++ b/sys/dev/ic/pdqvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdqvar.h,v 1.18 2006/03/25 22:41:43 djm Exp $ */
+/* $OpenBSD: pdqvar.h,v 1.19 2010/09/20 07:40:41 deraadt Exp $ */
/* $NetBSD: pdqvar.h,v 1.11 1996/10/25 21:33:37 cgd Exp $ */
/*-
@@ -194,7 +194,6 @@ typedef struct {
#elif defined(__NetBSD__) || defined(__OpenBSD__)
struct device sc_dev; /* base device */
void *sc_ih; /* interrupt vectoring */
- void *sc_ats; /* shutdown hook */
bus_space_tag_t sc_csrtag; /* space tag for CSRs */
bus_space_handle_t sc_csrhandle; /* space handle for CSRs */
#define sc_bc sc_csrtag
diff --git a/sys/dev/ic/pgt.c b/sys/dev/ic/pgt.c
index e8aa091f5fc..f425d4385d9 100644
--- a/sys/dev/ic/pgt.c
+++ b/sys/dev/ic/pgt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pgt.c,v 1.65 2010/09/07 16:21:42 deraadt Exp $ */
+/* $OpenBSD: pgt.c,v 1.66 2010/09/20 07:40:41 deraadt Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -192,7 +192,6 @@ int pgt_dma_alloc(struct pgt_softc *);
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_resume(void *, void *);
void
@@ -634,12 +633,6 @@ pgt_detach(struct pgt_softc *sc)
pgt_stop(sc, SC_DYING);
pgt_reboot(sc);
- /*
- * Disable shutdown and power hooks
- */
- if (sc->sc_shutdown_hook != NULL)
- shutdownhook_disestablish(sc->sc_shutdown_hook);
-
ieee80211_ifdetach(&sc->sc_ic.ic_if);
if_detach(&sc->sc_ic.ic_if);
@@ -2025,14 +2018,6 @@ pgt_net_attach(struct pgt_softc *sc)
sc->sc_txtap.wt_ihdr.it_len = htole16(sc->sc_txtap_len);
sc->sc_txtap.wt_ihdr.it_present = htole32(PGT_TX_RADIOTAP_PRESENT);
#endif
-
- /*
- * Enable shutdown and power hooks
- */
- sc->sc_shutdown_hook = shutdownhook_establish(pgt_shutdown, sc);
- if (sc->sc_shutdown_hook == NULL)
- printf("%s: WARNING: unable to establish shutdown hook\n",
- sc->sc_dev.dv_xname);
return (0);
}
@@ -3296,16 +3281,6 @@ pgt_dma_free_queue(struct pgt_softc *sc, enum pgt_queue pq)
}
}
-void
-pgt_shutdown(void *arg)
-{
- struct pgt_softc *sc = arg;
-
- DPRINTF(("%s: %s\n", sc->sc_dev.dv_xname, __func__));
-
- pgt_stop(sc, SC_DYING);
-}
-
int
pgt_activate(struct device *self, int act)
{
diff --git a/sys/dev/ic/pgtvar.h b/sys/dev/ic/pgtvar.h
index cb44228bf62..fa6fb0067bd 100644
--- a/sys/dev/ic/pgtvar.h
+++ b/sys/dev/ic/pgtvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pgtvar.h,v 1.12 2010/08/27 20:06:39 deraadt Exp $ */
+/* $OpenBSD: pgtvar.h,v 1.13 2010/09/20 07:40:41 deraadt Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -178,8 +178,6 @@ struct pgt_softc {
int (*sc_enable)(struct pgt_softc *);
void (*sc_disable)(struct pgt_softc *);
void (*sc_power)(struct pgt_softc *, int);
- void *sc_shutdown_hook; /* shutdown hook */
- void *sc_power_hook; /* power mgmt hook */
struct pgt_mgmt_descq sc_mgmtinprog;
struct pgt_descq sc_freeq[PGT_QUEUE_COUNT];
diff --git a/sys/dev/ic/ti.c b/sys/dev/ic/ti.c
index 21475dd264e..e783f52c9c7 100644
--- a/sys/dev/ic/ti.c
+++ b/sys/dev/ic/ti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ti.c,v 1.2 2009/12/13 13:21:54 kettenis Exp $ */
+/* $OpenBSD: ti.c,v 1.3 2010/09/20 07:40:41 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -132,7 +132,6 @@ void ti_init(void *);
void ti_init2(struct ti_softc *);
void ti_stop(struct ti_softc *);
void ti_watchdog(struct ifnet *);
-void ti_shutdown(void *);
int ti_ifmedia_upd(struct ifnet *);
void ti_ifmedia_sts(struct ifnet *, struct ifmediareq *);
@@ -1686,7 +1685,6 @@ ti_attach(struct ti_softc *sc)
if_attach(ifp);
ether_ifattach(ifp);
- shutdownhook_establish(ti_shutdown, sc);
return (0);
fail_3:
@@ -2528,17 +2526,3 @@ ti_stop(struct ti_softc *sc)
sc->ti_tx_considx.ti_idx = 0;
sc->ti_tx_saved_considx = TI_TXCONS_UNSET;
}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-void
-ti_shutdown(void *xsc)
-{
- struct ti_softc *sc;
-
- sc = xsc;
-
- ti_chipinit(sc);
-}
diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c
index 2b41113018e..9b2dc60a781 100644
--- a/sys/dev/ic/xl.c
+++ b/sys/dev/ic/xl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xl.c,v 1.96 2010/09/07 16:21:43 deraadt Exp $ */
+/* $OpenBSD: xl.c,v 1.97 2010/09/20 07:40:41 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -163,7 +163,6 @@ void xl_start_90xB(struct ifnet *);
int xl_ioctl(struct ifnet *, u_long, caddr_t);
void xl_freetxrx(struct xl_softc *);
void xl_watchdog(struct ifnet *);
-void xl_shutdown(void *);
int xl_ifmedia_upd(struct ifnet *);
void xl_ifmedia_sts(struct ifnet *, struct ifmediareq *);
@@ -2677,8 +2676,6 @@ xl_attach(struct xl_softc *sc)
*/
if_attach(ifp);
ether_ifattach(ifp);
-
- sc->sc_sdhook = shutdownhook_establish(xl_shutdown, sc);
}
int
@@ -2699,24 +2696,12 @@ xl_detach(struct xl_softc *sc)
/* Delete all remaining media. */
ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY);
- if (sc->sc_sdhook != NULL)
- shutdownhook_disestablish(sc->sc_sdhook);
-
ether_ifdetach(ifp);
if_detach(ifp);
return (0);
}
-void
-xl_shutdown(void *v)
-{
- struct xl_softc *sc = (struct xl_softc *)v;
-
- xl_reset(sc);
- xl_stop(sc);
-}
-
struct cfdriver xl_cd = {
0, "xl", DV_IFNET
};
diff --git a/sys/dev/ic/xlreg.h b/sys/dev/ic/xlreg.h
index ec3713a395a..4a814b47ba5 100644
--- a/sys/dev/ic/xlreg.h
+++ b/sys/dev/ic/xlreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xlreg.h,v 1.24 2010/09/07 16:21:43 deraadt Exp $ */
+/* $OpenBSD: xlreg.h,v 1.25 2010/09/20 07:40:41 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -595,7 +595,6 @@ struct xl_softc {
struct xl_chain_data xl_cdata;
int xl_flags;
void (*intr_ack)(struct xl_softc *);
- 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/pci/if_bge.c b/sys/dev/pci/if_bge.c
index fe4a4c7fa0f..e1c09ca451d 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.302 2010/09/07 16:21:44 deraadt Exp $ */
+/* $OpenBSD: if_bge.c,v 1.303 2010/09/20 07:40:38 deraadt Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -154,7 +154,6 @@ void bge_init(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 *);
-void bge_shutdown(void *);
int bge_ifmedia_upd(struct ifnet *);
void bge_ifmedia_sts(struct ifnet *, struct ifmediareq *);
@@ -2263,8 +2262,6 @@ bge_attach(struct device *parent, struct device *self, void *aux)
if_attach(ifp);
ether_ifattach(ifp);
- sc->sc_shutdownhook = shutdownhook_establish(bge_shutdown, sc);
-
timeout_set(&sc->bge_timeout, bge_tick, sc);
timeout_set(&sc->bge_rxtimeout, bge_rxtick, sc);
return;
@@ -3619,19 +3616,6 @@ bge_stop(struct bge_softc *sc)
BGE_STS_CLRBIT(sc, BGE_STS_LINK);
}
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-void
-bge_shutdown(void *xsc)
-{
- struct bge_softc *sc = (struct bge_softc *)xsc;
-
- bge_stop(sc);
- bge_reset(sc);
-}
-
void
bge_link_upd(struct bge_softc *sc)
{
diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h
index e733d7db0c7..95df99be86c 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.102 2010/09/07 16:21:44 deraadt Exp $ */
+/* $OpenBSD: if_bgereg.h,v 1.103 2010/09/20 07:40:38 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_shutdownhook;
u_int32_t bge_rx_discards;
u_int32_t bge_tx_discards;
u_int32_t bge_rx_inerrors;
diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c
index 8ff6db84058..d4f45dc620b 100644
--- a/sys/dev/pci/if_bnx.c
+++ b/sys/dev/pci/if_bnx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bnx.c,v 1.89 2010/08/03 16:11:57 jsg Exp $ */
+/* $OpenBSD: if_bnx.c,v 1.90 2010/09/20 07:40:38 deraadt Exp $ */
/*-
* Copyright (c) 2006 Broadcom Corporation
@@ -285,7 +285,6 @@ int bnx_read_rv2p(struct bnx_softc *sc, int);
#if 0
void bnx_detach(void *);
#endif
-void bnx_shutdown(void *);
/****************************************************************************/
/* BNX Debug Data Structure Dump Routines */
@@ -992,23 +991,6 @@ bnx_detach(void *xsc)
#endif
/****************************************************************************/
-/* Device shutdown function. */
-/* */
-/* Stops and resets the controller. */
-/* */
-/* Returns: */
-/* Nothing */
-/****************************************************************************/
-void
-bnx_shutdown(void *xsc)
-{
- struct bnx_softc *sc = (struct bnx_softc *)xsc;
-
- bnx_stop(sc);
- bnx_reset(sc, BNX_DRV_MSG_CODE_RESET);
-}
-
-/****************************************************************************/
/* Indirect register read. */
/* */
/* Reads NetXtreme II registers using an index/data register pair in PCI */
diff --git a/sys/dev/pci/if_bnxreg.h b/sys/dev/pci/if_bnxreg.h
index 466df061031..ebd9a3c72eb 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.36 2010/09/07 16:21:44 deraadt Exp $ */
+/* $OpenBSD: if_bnxreg.h,v 1.37 2010/09/20 07:40:38 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_shutdownhook;
/* ASIC Chip ID. */
u_int32_t bnx_chipid;
diff --git a/sys/dev/pci/if_cas.c b/sys/dev/pci/if_cas.c
index 5d8d8ca42b5..79d55ef8d3e 100644
--- a/sys/dev/pci/if_cas.c
+++ b/sys/dev/pci/if_cas.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cas.c,v 1.30 2010/05/19 15:27:35 oga Exp $ */
+/* $OpenBSD: if_cas.c,v 1.31 2010/09/20 07:40:38 deraadt Exp $ */
/*
*
@@ -109,7 +109,6 @@ void cas_stop(struct ifnet *, int);
int cas_ioctl(struct ifnet *, u_long, caddr_t);
void cas_tick(void *);
void cas_watchdog(struct ifnet *);
-void cas_shutdown(void *);
int cas_init(struct ifnet *);
void cas_init_regs(struct cas_softc *);
int cas_ringsize(int);
@@ -579,10 +578,6 @@ cas_config(struct cas_softc *sc)
if_attach(ifp);
ether_ifattach(ifp);
- sc->sc_sh = shutdownhook_establish(cas_shutdown, sc);
- if (sc->sc_sh == NULL)
- panic("cas_config: can't establish shutdownhook");
-
timeout_set(&sc->sc_tick_ch, cas_tick, sc);
return;
@@ -1722,16 +1717,6 @@ cas_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
return (error);
}
-
-void
-cas_shutdown(void *arg)
-{
- struct cas_softc *sc = (struct cas_softc *)arg;
- struct ifnet *ifp = &sc->sc_arpcom.ac_if;
-
- cas_stop(ifp, 1);
-}
-
void
cas_iff(struct cas_softc *sc)
{
diff --git a/sys/dev/pci/if_casvar.h b/sys/dev/pci/if_casvar.h
index 6fd0c7d9171..6635f7a4322 100644
--- a/sys/dev/pci/if_casvar.h
+++ b/sys/dev/pci/if_casvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_casvar.h,v 1.6 2009/06/13 12:18:58 kettenis Exp $ */
+/* $OpenBSD: if_casvar.h,v 1.7 2010/09/20 07:40:38 deraadt Exp $ */
/*
*
@@ -171,7 +171,6 @@ struct cas_softc {
int sc_rev;
int sc_inited;
int sc_debug;
- void *sc_sh; /* shutdownhook cookie */
};
/*
diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c
index 65db468fed1..df29a17a5ab 100644
--- a/sys/dev/pci/if_de.c
+++ b/sys/dev/pci/if_de.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_de.c,v 1.105 2010/04/08 00:23:53 tedu Exp $ */
+/* $OpenBSD: if_de.c,v 1.106 2010/09/20 07:40:38 deraadt Exp $ */
/* $NetBSD: if_de.c,v 1.58 1998/01/12 09:39:58 thorpej Exp $ */
/*-
@@ -224,7 +224,6 @@ int tulip_busdma_init(tulip_softc_t * const sc);
void tulip_initcsrs(tulip_softc_t * const sc, bus_addr_t csr_base, size_t csr_size);
void tulip_initring(tulip_softc_t * const sc, tulip_ringinfo_t * const ri,
tulip_desc_t *descs, int ndescs);
-void tulip_shutdown(void *arg);
bus_dmamap_t tulip_alloc_rxmap(tulip_softc_t *);
void tulip_free_rxmap(tulip_softc_t *, bus_dmamap_t);
@@ -4521,16 +4520,6 @@ tulip_probe(struct device *parent, void *match, void *aux)
}
void
-tulip_shutdown(void *arg)
-{
- tulip_softc_t * const sc = arg;
- TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
- DELAY(10); /* Wait 10 microseconds (actually 50 PCI cycles but at
- 33MHz that comes to two microseconds but wait a
- bit longer anyways) */
-}
-
-void
tulip_attach(struct device * const parent, struct device * const self, void * const aux)
{
tulip_softc_t * const sc = (tulip_softc_t *) self;
@@ -4703,11 +4692,6 @@ tulip_attach(struct device * const parent, struct device * const self, void * co
intrstr, ether_sprintf(sc->tulip_enaddr));
}
- sc->tulip_ats = shutdownhook_establish(tulip_shutdown, sc);
- if (sc->tulip_ats == NULL)
- printf("%s: warning: couldn't establish shutdown hook\n",
- sc->tulip_xname);
-
ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_NOTRAILERS|IFF_MULTICAST;
ifp->if_ioctl = tulip_ifioctl;
ifp->if_start = tulip_ifstart;
diff --git a/sys/dev/pci/if_fpa.c b/sys/dev/pci/if_fpa.c
index 6d95ed75937..0a03f0b2510 100644
--- a/sys/dev/pci/if_fpa.c
+++ b/sys/dev/pci/if_fpa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_fpa.c,v 1.26 2009/08/13 14:24:47 jasper Exp $ */
+/* $OpenBSD: if_fpa.c,v 1.27 2010/09/20 07:40:38 deraadt Exp $ */
/* $NetBSD: if_fpa.c,v 1.15 1996/10/21 22:56:40 thorpej Exp $ */
/*-
@@ -170,12 +170,6 @@ pdq_pci_attach(parent, self, aux)
bcopy((caddr_t) sc->sc_pdq->pdq_hwaddr.lanaddr_bytes,
sc->sc_arpcom.ac_enaddr, 6);
pdq_ifattach(sc, NULL);
-
- sc->sc_ats = shutdownhook_establish((void (*)(void *)) pdq_hwreset,
- sc->sc_pdq);
- if (sc->sc_ats == NULL)
- printf("%s: warning: couldn't establish shutdown hook\n",
- self->dv_xname);
}
struct cfattach fpa_ca = {
diff --git a/sys/dev/pci/if_lmc_obsd.c b/sys/dev/pci/if_lmc_obsd.c
index 54ef40ce79a..157de5657b2 100644
--- a/sys/dev/pci/if_lmc_obsd.c
+++ b/sys/dev/pci/if_lmc_obsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_lmc_obsd.c,v 1.21 2010/04/08 00:23:53 tedu Exp $ */
+/* $OpenBSD: if_lmc_obsd.c,v 1.22 2010/09/20 07:40:38 deraadt Exp $ */
/* $NetBSD: if_lmc_nbsd.c,v 1.1 1999/03/25 03:32:43 explorer Exp $ */
/*-
@@ -102,7 +102,6 @@
* This file is INCLUDED (gross, I know, but...)
*/
-static void lmc_shutdown(void *arg);
static int lmc_busdma_init(lmc_softc_t * const sc);
static int lmc_busdma_allocmem(lmc_softc_t * const sc, size_t size,
bus_dmamap_t *map_p, lmc_desc_t **desc_p);
@@ -305,11 +304,6 @@ lmc_pci_attach(struct device * const parent,
(sc->lmc_revinfo & 0xF0) >> 4, sc->lmc_revinfo & 0x0F,
LMC_EADDR_ARGS(sc->lmc_enaddr), intrstr);
- sc->lmc_ats = shutdownhook_establish(lmc_shutdown, sc);
- if (sc->lmc_ats == NULL)
- printf("%s: warning: couldn't establish shutdown hook\n",
- sc->lmc_xname);
-
s = LMC_RAISESPL();
lmc_dec_reset(sc);
lmc_reset(sc);
@@ -317,17 +311,6 @@ lmc_pci_attach(struct device * const parent,
LMC_RESTORESPL(s);
}
-static void
-lmc_shutdown(void *arg)
-{
- lmc_softc_t * const sc = arg;
- LMC_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
- DELAY(10);
-
- sc->lmc_miireg16 = 0; /* deassert ready, and all others too */
- lmc_led_on(sc, LMC_MII16_LED_ALL);
-}
-
static int
lmc_busdma_allocmem(
lmc_softc_t * const sc,
diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c
index 5acde94e34c..45c551beafd 100644
--- a/sys/dev/pci/if_msk.c
+++ b/sys/dev/pci/if_msk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_msk.c,v 1.89 2010/09/12 10:39:50 kettenis Exp $ */
+/* $OpenBSD: if_msk.c,v 1.90 2010/09/20 07:40:38 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -136,7 +136,6 @@ void mskc_attach(struct device *, struct device *self, void *aux);
int mskc_detach(struct device *, int);
int mskc_activate(struct device *, int);
void mskc_reset(struct sk_softc *);
-void mskc_shutdown(void *);
int msk_probe(struct device *, void *, void *);
void msk_attach(struct device *, struct device *self, void *aux);
int msk_detach(struct device *, int);
@@ -991,8 +990,6 @@ msk_attach(struct device *parent, struct device *self, void *aux)
ether_ifattach(ifp);
m_clsetwms(ifp, sc_if->sk_pktlen, 2, MSK_RX_RING_CNT);
- sc_if->sk_sdhook = shutdownhook_establish(mskc_shutdown, sc);
-
DPRINTFN(2, ("msk_attach: end\n"));
return;
@@ -1025,9 +1022,6 @@ msk_detach(struct device *self, int flags)
msk_stop(sc_if, 1);
- if (sc_if->sk_sdhook != NULL)
- shutdownhook_disestablish(sc_if->sk_sdhook);
-
/* Detach any PHYs we might have. */
if (LIST_FIRST(&sc_if->sk_mii.mii_phys) != NULL)
mii_detach(&sc_if->sk_mii, MII_PHY_ANY, MII_OFFSET_ANY);
@@ -1598,23 +1592,6 @@ msk_watchdog(struct ifnet *ifp)
}
}
-void
-mskc_shutdown(void *v)
-{
- struct sk_softc *sc = v;
-
- DPRINTFN(2, ("msk_shutdown\n"));
-
- /* Turn off the 'driver is loaded' LED. */
- CSR_WRITE_2(sc, SK_LED, SK_LED_GREEN_OFF);
-
- /*
- * Reset the GEnesis controller. Doing this should also
- * assert the resets on the attached XMAC(s).
- */
- mskc_reset(sc);
-}
-
static __inline int
msk_rxvalid(struct sk_softc *sc, u_int32_t stat, u_int32_t len)
{
diff --git a/sys/dev/pci/if_mskvar.h b/sys/dev/pci/if_mskvar.h
index 85651d625eb..d56c9e7829b 100644
--- a/sys/dev/pci/if_mskvar.h
+++ b/sys/dev/pci/if_mskvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mskvar.h,v 1.8 2009/03/23 21:58:54 kettenis Exp $ */
+/* $OpenBSD: if_mskvar.h,v 1.9 2010/09/20 07:40:38 deraadt Exp $ */
/* $NetBSD: if_skvar.h,v 1.6 2005/05/30 04:35:22 christos Exp $ */
/*-
@@ -26,7 +26,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* $OpenBSD: if_mskvar.h,v 1.8 2009/03/23 21:58:54 kettenis Exp $ */
+/* $OpenBSD: if_mskvar.h,v 1.9 2010/09/20 07:40:38 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -219,7 +219,6 @@ struct sk_if_softc {
int sk_tx_bmu; /* TX BMU register */
int sk_if_flags;
SIMPLEQ_HEAD(__sk_txmaphead, sk_txmap_entry) sk_txmap_head;
- void *sk_sdhook;
};
struct skc_attach_args {
diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c
index 591519cf3d0..9b518cb08bb 100644
--- a/sys/dev/pci/if_nge.c
+++ b/sys/dev/pci/if_nge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nge.c,v 1.69 2010/05/19 15:27:35 oga Exp $ */
+/* $OpenBSD: if_nge.c,v 1.70 2010/09/20 07:40:38 deraadt Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
@@ -154,7 +154,6 @@ int nge_ioctl(struct ifnet *, u_long, caddr_t);
void nge_init(void *);
void nge_stop(struct nge_softc *);
void nge_watchdog(struct ifnet *);
-void nge_shutdown(void *);
int nge_ifmedia_mii_upd(struct ifnet *);
void nge_ifmedia_mii_sts(struct ifnet *, struct ifmediareq *);
int nge_ifmedia_tbi_upd(struct ifnet *);
@@ -2220,20 +2219,6 @@ nge_stop(sc)
sizeof(sc->nge_ldata->nge_tx_list));
}
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-void
-nge_shutdown(xsc)
- void *xsc;
-{
- struct nge_softc *sc = (struct nge_softc *)xsc;
-
- nge_reset(sc);
- nge_stop(sc);
-}
-
struct cfattach nge_ca = {
sizeof(struct nge_softc), nge_probe, nge_attach
};
diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c
index 0e275ee1ce7..3ba43d46949 100644
--- a/sys/dev/pci/if_pcn.c
+++ b/sys/dev/pci/if_pcn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pcn.c,v 1.22 2009/08/13 14:24:47 jasper Exp $ */
+/* $OpenBSD: if_pcn.c,v 1.23 2010/09/20 07:40:38 deraadt Exp $ */
/* $NetBSD: if_pcn.c,v 1.26 2005/05/07 09:15:44 is Exp $ */
/*
@@ -283,7 +283,6 @@ struct pcn_softc {
bus_space_handle_t sc_sh; /* bus space handle */
bus_dma_tag_t sc_dmat; /* bus DMA tag */
struct arpcom sc_arpcom; /* Ethernet common data */
- void *sc_sdhook; /* shutdown hook */
/* Points to our media routines, etc. */
const struct pcn_variant *sc_variant;
@@ -401,8 +400,6 @@ int pcn_ioctl(struct ifnet *, u_long, caddr_t);
int pcn_init(struct ifnet *);
void pcn_stop(struct ifnet *, int);
-void pcn_shutdown(void *);
-
void pcn_reset(struct pcn_softc *);
void pcn_rxdrain(struct pcn_softc *);
int pcn_add_rxbuf(struct pcn_softc *, int);
@@ -794,12 +791,6 @@ pcn_attach(struct device *parent, struct device *self, void *aux)
/* Attach the interface. */
if_attach(ifp);
ether_ifattach(ifp);
-
- /* Make sure the interface is shutdown during reboot. */
- sc->sc_sdhook = shutdownhook_establish(pcn_shutdown, sc);
- if (sc->sc_sdhook == NULL)
- printf("%s: WARNING: unable to establish shutdown hook\n",
- sc->sc_dev.dv_xname);
return;
/*
@@ -829,20 +820,6 @@ pcn_attach(struct device *parent, struct device *self, void *aux)
}
/*
- * pcn_shutdown:
- *
- * Make sure the interface is stopped at reboot time.
- */
-void
-pcn_shutdown(void *arg)
-{
- struct pcn_softc *sc = arg;
-
- pcn_stop(&sc->sc_arpcom.ac_if, 1);
- pcn_reset(sc);
-}
-
-/*
* pcn_start: [ifnet interface function]
*
* Start packet transmission on the interface.
diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c
index f95bb218b8f..6ed6e3dd1ec 100644
--- a/sys/dev/pci/if_sk.c
+++ b/sys/dev/pci/if_sk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sk.c,v 1.157 2010/05/19 15:27:35 oga Exp $ */
+/* $OpenBSD: if_sk.c,v 1.158 2010/09/20 07:40:38 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -134,7 +134,6 @@
int skc_probe(struct device *, void *, void *);
void skc_attach(struct device *, struct device *self, void *aux);
int skc_detach(struct device *, int);
-void skc_shutdown(void *);
int sk_probe(struct device *, void *, void *);
void sk_attach(struct device *, struct device *self, void *aux);
int sk_detach(struct device *, int);
@@ -1237,8 +1236,6 @@ sk_attach(struct device *parent, struct device *self, void *aux)
if_attach(ifp);
ether_ifattach(ifp);
- sc_if->sk_sdhook = shutdownhook_establish(skc_shutdown, sc);
-
DPRINTFN(2, ("sk_attach: end\n"));
return;
@@ -1271,9 +1268,6 @@ sk_detach(struct device *self, int flags)
/* Delete any remaining media. */
ifmedia_delete_instance(&sc_if->sk_mii.mii_media, IFM_INST_ANY);
- if (sc_if->sk_sdhook != NULL)
- shutdownhook_disestablish(sc_if->sk_sdhook);
-
ether_ifdetach(ifp);
if_detach(ifp);
@@ -1714,23 +1708,6 @@ sk_watchdog(struct ifnet *ifp)
}
}
-void
-skc_shutdown(void *v)
-{
- struct sk_softc *sc = v;
-
- DPRINTFN(2, ("sk_shutdown\n"));
-
- /* Turn off the 'driver is loaded' LED. */
- CSR_WRITE_2(sc, SK_LED, SK_LED_GREEN_OFF);
-
- /*
- * Reset the GEnesis controller. Doing this should also
- * assert the resets on the attached XMAC(s).
- */
- sk_reset(sc);
-}
-
static __inline int
sk_rxvalid(struct sk_softc *sc, u_int32_t stat, u_int32_t len)
{
diff --git a/sys/dev/pci/if_skvar.h b/sys/dev/pci/if_skvar.h
index 3afab578345..402e48d869a 100644
--- a/sys/dev/pci/if_skvar.h
+++ b/sys/dev/pci/if_skvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_skvar.h,v 1.6 2009/10/04 18:32:41 deraadt Exp $ */
+/* $OpenBSD: if_skvar.h,v 1.7 2010/09/20 07:40:38 deraadt Exp $ */
/* $NetBSD: if_skvar.h,v 1.6 2005/05/30 04:35:22 christos Exp $ */
/*-
@@ -26,7 +26,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* $OpenBSD: if_skvar.h,v 1.6 2009/10/04 18:32:41 deraadt Exp $ */
+/* $OpenBSD: if_skvar.h,v 1.7 2010/09/20 07:40:38 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -227,7 +227,6 @@ struct sk_if_softc {
LIST_HEAD(__sk_jfreehead, sk_jpool_entry) sk_jfree_listhead;
LIST_HEAD(__sk_jinusehead, sk_jpool_entry) sk_jinuse_listhead;
SIMPLEQ_HEAD(__sk_txmaphead, sk_txmap_entry) sk_txmap_head;
- void *sk_sdhook;
};
struct skc_attach_args {
diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c
index be4333bc477..a5eb2afbd7c 100644
--- a/sys/dev/pci/if_txp.c
+++ b/sys/dev/pci/if_txp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_txp.c,v 1.101 2009/08/13 14:24:47 jasper Exp $ */
+/* $OpenBSD: if_txp.c,v 1.102 2010/09/20 07:40:38 deraadt Exp $ */
/*
* Copyright (c) 2001
@@ -89,7 +89,6 @@ void txp_attach(struct device *, struct device *, void *);
void txp_attachhook(void *vsc);
int txp_intr(void *);
void txp_tick(void *);
-void txp_shutdown(void *);
int txp_ioctl(struct ifnet *, u_long, caddr_t);
void txp_start(struct ifnet *);
void txp_stop(struct txp_softc *);
@@ -242,7 +241,6 @@ txp_attachhook(void *vsc)
if_attach(ifp);
ether_ifattach(ifp);
- shutdownhook_establish(txp_shutdown, sc);
splx(s);
}
@@ -869,22 +867,6 @@ txp_tx_reclaim(struct txp_softc *sc, struct txp_tx_ring *r,
ifp->if_timer = 0;
}
-void
-txp_shutdown(void *vsc)
-{
- struct txp_softc *sc = (struct txp_softc *)vsc;
-
- /* mask all interrupts */
- WRITE_REG(sc, TXP_IMR,
- TXP_INT_SELF | TXP_INT_PCI_TABORT | TXP_INT_PCI_MABORT |
- TXP_INT_DMA3 | TXP_INT_DMA2 | TXP_INT_DMA1 | TXP_INT_DMA0 |
- TXP_INT_LATCH);
-
- txp_command(sc, TXP_CMD_TX_DISABLE, 0, 0, 0, NULL, NULL, NULL, 0);
- txp_command(sc, TXP_CMD_RX_DISABLE, 0, 0, 0, NULL, NULL, NULL, 0);
- txp_command(sc, TXP_CMD_HALT, 0, 0, 0, NULL, NULL, NULL, 0);
-}
-
int
txp_alloc_rings(struct txp_softc *sc)
{
diff --git a/sys/dev/tc/if_fta.c b/sys/dev/tc/if_fta.c
index c672e39bef1..d0720800c2b 100644
--- a/sys/dev/tc/if_fta.c
+++ b/sys/dev/tc/if_fta.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_fta.c,v 1.16 2009/08/13 14:24:47 jasper Exp $ */
+/* $OpenBSD: if_fta.c,v 1.17 2010/09/20 07:40:42 deraadt Exp $ */
/* $NetBSD: if_fta.c,v 1.7 1996/10/22 21:37:26 cgd Exp $ */
/*-
@@ -115,12 +115,6 @@ pdq_tc_attach(parent, self, aux)
tc_intr_establish(parent, ta->ta_cookie, IPL_NET,
(int (*)(void *)) pdq_interrupt, sc->sc_pdq, self->dv_xname);
-
- sc->sc_ats = shutdownhook_establish((void (*)(void *)) pdq_hwreset,
- sc->sc_pdq);
- if (sc->sc_ats == NULL)
- printf("%s: warning: couldn't establish shutdown hook\n",
- self->dv_xname);
}
struct cfattach fta_ca = {