summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2009-08-10 19:41:05 +0000
committerderaadt <deraadt@openbsd.org>2009-08-10 19:41:05 +0000
commit4ffe6de589ac4bca0097e20124ae0c10c27cef0b (patch)
treeef93c1a8bc4b74480649f872dcb33e7cf1c359dc
parentclear the beacons owner/valid bits to avoid garbage. (diff)
downloadwireguard-openbsd-4ffe6de589ac4bca0097e20124ae0c10c27cef0b.tar.xz
wireguard-openbsd-4ffe6de589ac4bca0097e20124ae0c10c27cef0b.zip
A few more simple cases of shutdown hooks which only call xxstop, when
we now know the interface has already been stopped
-rw-r--r--sys/dev/pci/if_em.c18
-rw-r--r--sys/dev/pci/if_em.h3
-rw-r--r--sys/dev/pci/if_et.c16
-rw-r--r--sys/dev/pci/if_ix.c18
-rw-r--r--sys/dev/pci/if_ix.h3
-rw-r--r--sys/dev/pci/if_ixgb.c18
-rw-r--r--sys/dev/pci/if_ixgb.h3
-rw-r--r--sys/dev/pci/if_sis.c17
-rw-r--r--sys/dev/pci/if_ste.c13
-rw-r--r--sys/dev/pci/if_stge.c25
-rw-r--r--sys/dev/pci/if_stgereg.h3
-rw-r--r--sys/dev/pci/if_tl.c14
-rw-r--r--sys/dev/pci/if_vr.c17
-rw-r--r--sys/dev/pci/if_wb.c19
14 files changed, 14 insertions, 173 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 9a7155f2ab6..394e0b1acef 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.216 2009/08/09 11:40:56 deraadt Exp $ */
+/* $OpenBSD: if_em.c,v 1.217 2009/08/10 19:41:05 deraadt Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -152,7 +152,6 @@ const struct pci_matchid em_devices[] = {
*********************************************************************/
int em_probe(struct device *, void *, void *);
void em_attach(struct device *, struct device *, void *);
-void em_shutdown(void *);
int em_intr(void *);
void em_power(int, void *);
void em_start(struct ifnet *);
@@ -438,7 +437,6 @@ em_attach(struct device *parent, struct device *self, void *aux)
sc->pcix_82544 = FALSE;
INIT_DEBUGOUT("em_attach: end");
sc->sc_powerhook = powerhook_establish(em_power, sc);
- sc->sc_shutdownhook = shutdownhook_establish(em_shutdown, sc);
return;
err_mac_addr:
@@ -465,20 +463,6 @@ em_power(int why, void *arg)
}
/*********************************************************************
- *
- * Shutdown entry point
- *
- **********************************************************************/
-
-void
-em_shutdown(void *arg)
-{
- struct em_softc *sc = arg;
-
- em_stop(sc);
-}
-
-/*********************************************************************
* Transmit entry point
*
* em_start is called by the stack to initiate a transmit.
diff --git a/sys/dev/pci/if_em.h b/sys/dev/pci/if_em.h
index 069b1f65181..2173d461c5d 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.44 2009/06/05 16:27:40 naddy Exp $ */
+/* $OpenBSD: if_em.h,v 1.45 2009/08/10 19:41:05 deraadt Exp $ */
#ifndef _EM_H_DEFINED_
#define _EM_H_DEFINED_
@@ -325,7 +325,6 @@ struct em_softc {
struct timeout timer_handle;
struct timeout tx_fifo_timer_handle;
void *sc_powerhook;
- void *sc_shutdownhook;
#ifdef __STRICT_ALIGNMENT
/* Used for carrying forward alignment adjustments */
diff --git a/sys/dev/pci/if_et.c b/sys/dev/pci/if_et.c
index 1dbf547e467..21d630f8c7e 100644
--- a/sys/dev/pci/if_et.c
+++ b/sys/dev/pci/if_et.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_et.c,v 1.17 2009/03/29 21:53:52 sthen Exp $ */
+/* $OpenBSD: if_et.c,v 1.18 2009/08/10 19:41:05 deraadt Exp $ */
/*
* Copyright (c) 2007 The DragonFly Project. All rights reserved.
*
@@ -92,7 +92,6 @@
int et_match(struct device *, void *, void *);
void et_attach(struct device *, struct device *, void *);
int et_detach(struct device *, int);
-int et_shutdown(struct device *);
int et_miibus_readreg(struct device *, int, int);
void et_miibus_writereg(struct device *, int, int, int);
@@ -319,19 +318,6 @@ et_detach(struct device *self, int flags)
}
int
-et_shutdown(struct device *self)
-{
- struct et_softc *sc = (struct et_softc *)self;
- int s;
-
- s = splnet();
- et_stop(sc);
- splx(s);
-
- return 0;
-}
-
-int
et_miibus_readreg(struct device *dev, int phy, int reg)
{
struct et_softc *sc = (struct et_softc *)dev;
diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c
index 067efcc2b69..b12507f6ac9 100644
--- a/sys/dev/pci/if_ix.c
+++ b/sys/dev/pci/if_ix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ix.c,v 1.25 2009/08/09 11:40:56 deraadt Exp $ */
+/* $OpenBSD: if_ix.c,v 1.26 2009/08/10 19:41:05 deraadt Exp $ */
/******************************************************************************
@@ -65,7 +65,6 @@ int ixgbe_probe(struct device *, void *, void *);
void ixgbe_attach(struct device *, struct device *, void *);
int ixgbe_detach(struct device *, int);
void ixgbe_power(int, void *);
-void ixgbe_shutdown(void *);
void ixgbe_start(struct ifnet *);
void ixgbe_start_locked(struct tx_ring *, struct ifnet *);
int ixgbe_ioctl(struct ifnet *, u_long, caddr_t);
@@ -239,7 +238,6 @@ ixgbe_attach(struct device *parent, struct device *self, void *aux)
IXGBE_WRITE_REG(&sc->hw, IXGBE_CTRL_EXT, ctrl_ext);
sc->powerhook = powerhook_establish(ixgbe_power, sc);
- sc->shutdownhook = shutdownhook_establish(ixgbe_shutdown, sc);
printf(", address %s\n", ether_sprintf(sc->hw.mac.addr));
@@ -305,20 +303,6 @@ ixgbe_power(int why, void *arg)
}
/*********************************************************************
- *
- * Shutdown entry point
- *
- **********************************************************************/
-
-void
-ixgbe_shutdown(void *arg)
-{
- struct ix_softc *sc = (struct ix_softc *)arg;
-
- ixgbe_stop(sc);
-}
-
-/*********************************************************************
* Transmit entry point
*
* ixgbe_start is called by the stack to initiate a transmit.
diff --git a/sys/dev/pci/if_ix.h b/sys/dev/pci/if_ix.h
index 63d2f04580e..4add40646ca 100644
--- a/sys/dev/pci/if_ix.h
+++ b/sys/dev/pci/if_ix.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ix.h,v 1.7 2009/06/28 22:20:20 jsg Exp $ */
+/* $OpenBSD: if_ix.h,v 1.8 2009/08/10 19:41:05 deraadt Exp $ */
/******************************************************************************
@@ -237,7 +237,6 @@ struct ix_softc {
struct ixgbe_hw hw;
struct ixgbe_osdep osdep;
void *powerhook;
- void *shutdownhook;
struct resource *pci_mem;
struct resource *msix_mem;
diff --git a/sys/dev/pci/if_ixgb.c b/sys/dev/pci/if_ixgb.c
index 88003e03577..2d934d86cd8 100644
--- a/sys/dev/pci/if_ixgb.c
+++ b/sys/dev/pci/if_ixgb.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_ixgb.c,v 1.53 2009/06/24 13:36:56 deraadt Exp $ */
+/* $OpenBSD: if_ixgb.c,v 1.54 2009/08/10 19:41:05 deraadt Exp $ */
#include <dev/pci/if_ixgb.h>
@@ -64,7 +64,6 @@ const struct pci_matchid ixgb_devices[] = {
*********************************************************************/
int ixgb_probe(struct device *, void *, void *);
void ixgb_attach(struct device *, struct device *, void *);
-void ixgb_shutdown(void *);
int ixgb_intr(void *);
void ixgb_power(int, void *);
void ixgb_start(struct ifnet *);
@@ -247,7 +246,6 @@ ixgb_attach(struct device *parent, struct device *self, void *aux)
INIT_DEBUGOUT("ixgb_attach: end");
sc->sc_powerhook = powerhook_establish(ixgb_power, sc);
- sc->sc_shutdownhook = shutdownhook_establish(ixgb_shutdown, sc);
return;
err_hw_init:
@@ -273,20 +271,6 @@ ixgb_power(int why, void *arg)
}
/*********************************************************************
- *
- * Shutdown entry point
- *
- **********************************************************************/
-
-void
-ixgb_shutdown(void *arg)
-{
- struct ixgb_softc *sc = arg;
-
- ixgb_stop(sc);
-}
-
-/*********************************************************************
* Transmit entry point
*
* ixgb_start is called by the stack to initiate a transmit.
diff --git a/sys/dev/pci/if_ixgb.h b/sys/dev/pci/if_ixgb.h
index 4b4f8e72aa0..9f1bf0ecc27 100644
--- a/sys/dev/pci/if_ixgb.h
+++ b/sys/dev/pci/if_ixgb.h
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_ixgb.h,v 1.10 2006/11/28 04:45:08 brad Exp $ */
+/* $OpenBSD: if_ixgb.h,v 1.11 2009/08/10 19:41:05 deraadt Exp $ */
#ifndef _IXGB_H_DEFINED_
#define _IXGB_H_DEFINED_
@@ -243,7 +243,6 @@ struct ixgb_softc {
struct timeout timer_handle;
int if_flags;
void *sc_powerhook;
- void *sc_shutdownhook;
/* Info about the board itself */
u_int32_t part_num;
diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c
index 3fb8be5af3b..75db5e4842d 100644
--- a/sys/dev/pci/if_sis.c
+++ b/sys/dev/pci/if_sis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sis.c,v 1.95 2009/08/09 11:40:56 deraadt Exp $ */
+/* $OpenBSD: if_sis.c,v 1.96 2009/08/10 19:41:05 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -114,7 +114,6 @@ struct cfdriver sis_cd = {
};
int sis_intr(void *);
-void sis_shutdown(void *);
void sis_fill_rx_ring(struct sis_softc *);
int sis_newbuf(struct sis_softc *, struct sis_desc *);
int sis_encap(struct sis_softc *, struct mbuf *, u_int32_t *);
@@ -1144,8 +1143,6 @@ sis_attach(struct device *parent, struct device *self, void *aux)
*/
if_attach(ifp);
ether_ifattach(ifp);
-
- shutdownhook_establish(sis_shutdown, sc);
return;
fail_2:
@@ -1990,15 +1987,3 @@ sis_stop(struct sis_softc *sc)
sizeof(struct sis_desc) - sizeof(bus_dmamap_t));
}
}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-void
-sis_shutdown(void *v)
-{
- struct sis_softc *sc = (struct sis_softc *)v;
-
- sis_stop(sc);
-}
diff --git a/sys/dev/pci/if_ste.c b/sys/dev/pci/if_ste.c
index 1ffab70958c..f224236425f 100644
--- a/sys/dev/pci/if_ste.c
+++ b/sys/dev/pci/if_ste.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ste.c,v 1.43 2008/11/28 02:44:18 brad Exp $ */
+/* $OpenBSD: if_ste.c,v 1.44 2009/08/10 19:41:05 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -82,7 +82,6 @@
int ste_probe(struct device *, void *, void *);
void ste_attach(struct device *, struct device *, void *);
int ste_intr(void *);
-void ste_shutdown(void *);
void ste_init(void *);
void ste_rxeoc(struct ste_softc *);
void ste_rxeof(struct ste_softc *);
@@ -985,8 +984,6 @@ ste_attach(struct device *parent, struct device *self, void *aux)
*/
if_attach(ifp);
ether_ifattach(ifp);
-
- shutdownhook_establish(ste_shutdown, sc);
return;
fail_2:
@@ -1505,11 +1502,3 @@ ste_watchdog(struct ifnet *ifp)
return;
}
-
-void
-ste_shutdown(void *v)
-{
- struct ste_softc *sc = (struct ste_softc *)v;
-
- ste_stop(sc);
-}
diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c
index a574f5e3f89..02b0f3b1534 100644
--- a/sys/dev/pci/if_stge.c
+++ b/sys/dev/pci/if_stge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_stge.c,v 1.48 2009/07/28 08:24:06 sthen Exp $ */
+/* $OpenBSD: if_stge.c,v 1.49 2009/08/10 19:41:05 deraadt Exp $ */
/* $NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $ */
/*-
@@ -91,8 +91,6 @@ int stge_ioctl(struct ifnet *, u_long, caddr_t);
int stge_init(struct ifnet *);
void stge_stop(struct ifnet *, int);
-void stge_shutdown(void *);
-
void stge_reset(struct stge_softc *);
void stge_rxdrain(struct stge_softc *);
int stge_add_rxbuf(struct stge_softc *, int);
@@ -424,14 +422,6 @@ stge_attach(struct device *parent, struct device *self, void *aux)
*/
if_attach(ifp);
ether_ifattach(ifp);
-
- /*
- * Make sure the interface is shutdown during reboot.
- */
- sc->sc_sdhook = shutdownhook_establish(stge_shutdown, sc);
- if (sc->sc_sdhook == NULL)
- printf("%s: WARNING: unable to establish shutdown hook\n",
- sc->sc_dev.dv_xname);
return;
/*
@@ -463,19 +453,6 @@ stge_attach(struct device *parent, struct device *self, void *aux)
return;
}
-/*
- * stge_shutdown:
- *
- * Make sure the interface is stopped at reboot time.
- */
-void
-stge_shutdown(void *arg)
-{
- struct stge_softc *sc = arg;
-
- stge_stop(&sc->sc_arpcom.ac_if, 1);
-}
-
static void
stge_dma_wait(struct stge_softc *sc)
{
diff --git a/sys/dev/pci/if_stgereg.h b/sys/dev/pci/if_stgereg.h
index 98f392409f1..3b7b8d83dc3 100644
--- a/sys/dev/pci/if_stgereg.h
+++ b/sys/dev/pci/if_stgereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_stgereg.h,v 1.10 2009/07/28 22:15:44 sthen Exp $ */
+/* $OpenBSD: if_stgereg.h,v 1.11 2009/08/10 19:41:05 deraadt Exp $ */
/* $NetBSD: if_stgereg.h,v 1.3 2003/02/10 21:10:07 christos Exp $ */
/*-
@@ -529,7 +529,6 @@ struct stge_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 */
int sc_rev; /* silicon revision */
void *sc_ih; /* interrupt cookie */
diff --git a/sys/dev/pci/if_tl.c b/sys/dev/pci/if_tl.c
index 6e852cec923..0c20c3eb656 100644
--- a/sys/dev/pci/if_tl.c
+++ b/sys/dev/pci/if_tl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tl.c,v 1.47 2009/03/29 21:53:52 sthen Exp $ */
+/* $OpenBSD: if_tl.c,v 1.48 2009/08/10 19:41:05 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -264,7 +264,6 @@ int tl_ioctl(struct ifnet *, u_long, caddr_t);
void tl_init(void *);
void tl_stop(struct tl_softc *);
void tl_watchdog(struct ifnet *);
-void tl_shutdown(void *);
int tl_ifmedia_upd(struct ifnet *);
void tl_ifmedia_sts(struct ifnet *, struct ifmediareq *);
@@ -2176,8 +2175,6 @@ tl_attach(parent, self, aux)
*/
if_attach(ifp);
ether_ifattach(ifp);
-
- shutdownhook_establish(tl_shutdown, sc);
}
void
@@ -2191,15 +2188,6 @@ tl_wait_up(xsc)
ifp->if_flags &= ~IFF_OACTIVE;
}
-void
-tl_shutdown(xsc)
- void *xsc;
-{
- struct tl_softc *sc = xsc;
-
- tl_stop(sc);
-}
-
struct cfattach tl_ca = {
sizeof(struct tl_softc), tl_probe, tl_attach
};
diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c
index 4c961ebe1c2..f4b17689899 100644
--- a/sys/dev/pci/if_vr.c
+++ b/sys/dev/pci/if_vr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vr.c,v 1.98 2009/08/09 11:40:56 deraadt Exp $ */
+/* $OpenBSD: if_vr.c,v 1.99 2009/08/10 19:41:05 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -122,7 +122,6 @@ int vr_ioctl(struct ifnet *, u_long, caddr_t);
void vr_init(void *);
void vr_stop(struct vr_softc *);
void vr_watchdog(struct ifnet *);
-void vr_shutdown(void *);
int vr_ifmedia_upd(struct ifnet *);
void vr_ifmedia_sts(struct ifnet *, struct ifmediareq *);
@@ -668,8 +667,6 @@ vr_attach(struct device *parent, struct device *self, void *aux)
m_clsetwms(ifp, MCLBYTES, 2, VR_RX_LIST_CNT - 1);
if_attach(ifp);
ether_ifattach(ifp);
-
- shutdownhook_establish(vr_shutdown, sc);
return;
fail_5:
@@ -1547,18 +1544,6 @@ vr_stop(struct vr_softc *sc)
sizeof(sc->vr_ldata->vr_tx_list));
}
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-void
-vr_shutdown(void *arg)
-{
- struct vr_softc *sc = (struct vr_softc *)arg;
-
- vr_stop(sc);
-}
-
int
vr_alloc_mbuf(struct vr_softc *sc, struct vr_chain_onefrag *r)
{
diff --git a/sys/dev/pci/if_wb.c b/sys/dev/pci/if_wb.c
index a41a7c982dc..4cfea0ad730 100644
--- a/sys/dev/pci/if_wb.c
+++ b/sys/dev/pci/if_wb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wb.c,v 1.43 2008/11/28 02:44:18 brad Exp $ */
+/* $OpenBSD: if_wb.c,v 1.44 2009/08/10 19:41:05 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -149,7 +149,6 @@ int wb_ioctl(struct ifnet *, u_long, caddr_t);
void wb_init(void *);
void wb_stop(struct wb_softc *);
void wb_watchdog(struct ifnet *);
-void wb_shutdown(void *);
int wb_ifmedia_upd(struct ifnet *);
void wb_ifmedia_sts(struct ifnet *, struct ifmediareq *);
@@ -855,8 +854,6 @@ wb_attach(parent, self, aux)
*/
if_attach(ifp);
ether_ifattach(ifp);
-
- shutdownhook_establish(wb_shutdown, sc);
return;
fail_5:
@@ -1689,20 +1686,6 @@ void wb_stop(sc)
sizeof(sc->wb_ldata->wb_tx_list));
}
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-void wb_shutdown(arg)
- void *arg;
-{
- struct wb_softc *sc = (struct wb_softc *)arg;
-
- wb_stop(sc);
-
- return;
-}
-
struct cfattach wb_ca = {
sizeof(struct wb_softc), wb_probe, wb_attach
};