summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ic/atw.c14
-rw-r--r--sys/dev/ic/gem.c15
-rw-r--r--sys/dev/ic/smc83c170.c14
-rw-r--r--sys/dev/ic/xl.c6
-rw-r--r--sys/dev/pci/if_bce.c10
-rw-r--r--sys/dev/pci/if_em.c7
-rw-r--r--sys/dev/pci/if_ipw.c8
-rw-r--r--sys/dev/pci/if_iwi.c8
-rw-r--r--sys/dev/pci/if_lge.c7
-rw-r--r--sys/dev/pci/if_nge.c7
-rw-r--r--sys/dev/pci/if_sf.c6
-rw-r--r--sys/dev/pci/if_sis.c6
-rw-r--r--sys/dev/pci/if_sk.c6
-rw-r--r--sys/dev/pci/if_ste.c6
-rw-r--r--sys/dev/pci/if_ti.c6
-rw-r--r--sys/dev/pci/if_wb.c8
16 files changed, 69 insertions, 65 deletions
diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c
index cbdc3c71fb0..f5a0b637ac1 100644
--- a/sys/dev/ic/atw.c
+++ b/sys/dev/ic/atw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atw.c,v 1.32 2005/06/21 05:36:43 kevlo Exp $ */
+/* $OpenBSD: atw.c,v 1.33 2005/07/02 23:10:16 brad Exp $ */
/* $NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $ */
/*-
@@ -2697,6 +2697,12 @@ atw_stop(struct ifnet *ifp, int disable)
ieee80211_new_state(ic, IEEE80211_S_INIT, -1);
+ /*
+ * Mark the interface down and cancel the watchdog timer.
+ */
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+ ifp->if_timer = 0;
+
/* Disable interrupts. */
ATW_WRITE(sc, ATW_IER, 0);
@@ -2715,12 +2721,6 @@ atw_stop(struct ifnet *ifp, int disable)
atw_disable(sc);
}
- /*
- * Mark the interface down and cancel the watchdog timer.
- */
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
- ifp->if_timer = 0;
-
if (!disable)
atw_reset(sc);
}
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c
index 5cfc9ff1806..45968b34c01 100644
--- a/sys/dev/ic/gem.c
+++ b/sys/dev/ic/gem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gem.c,v 1.41 2005/06/08 17:02:59 henning Exp $ */
+/* $OpenBSD: gem.c,v 1.42 2005/07/02 23:10:16 brad Exp $ */
/* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */
/*
@@ -454,6 +454,13 @@ gem_stop(struct ifnet *ifp, int disable)
DPRINTF(sc, ("%s: gem_stop\n", sc->sc_dev.dv_xname));
timeout_del(&sc->sc_tick_ch);
+
+ /*
+ * Mark the interface down and cancel the watchdog timer.
+ */
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+ ifp->if_timer = 0;
+
mii_down(&sc->sc_mii);
gem_reset_rx(sc);
@@ -477,12 +484,6 @@ gem_stop(struct ifnet *ifp, int disable)
if (disable) {
gem_rxdrain(sc);
}
-
- /*
- * Mark the interface down and cancel the watchdog timer.
- */
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
- ifp->if_timer = 0;
}
diff --git a/sys/dev/ic/smc83c170.c b/sys/dev/ic/smc83c170.c
index f9182879174..04bc3aa5124 100644
--- a/sys/dev/ic/smc83c170.c
+++ b/sys/dev/ic/smc83c170.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smc83c170.c,v 1.4 2005/06/28 03:07:37 brad Exp $ */
+/* $OpenBSD: smc83c170.c,v 1.5 2005/07/02 23:10:16 brad Exp $ */
/* $NetBSD: smc83c170.c,v 1.59 2005/02/27 00:27:02 perry Exp $ */
/*-
@@ -1153,6 +1153,12 @@ epic_stop(struct ifnet *ifp, int disable)
*/
timeout_del(&sc->sc_mii_timeout);
+ /*
+ * Mark the interface down and cancel the watchdog timer.
+ */
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+ ifp->if_timer = 0;
+
/* Down the MII. */
mii_down(&sc->sc_mii);
@@ -1186,12 +1192,6 @@ epic_stop(struct ifnet *ifp, int disable)
if (disable)
epic_rxdrain(sc);
-
- /*
- * Mark the interface down and cancel the watchdog timer.
- */
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
- ifp->if_timer = 0;
}
/*
diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c
index 38fde3ecbde..aafa07fd4f6 100644
--- a/sys/dev/ic/xl.c
+++ b/sys/dev/ic/xl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xl.c,v 1.64 2005/04/25 17:55:51 brad Exp $ */
+/* $OpenBSD: xl.c,v 1.65 2005/07/02 23:10:16 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -2606,10 +2606,10 @@ xl_stop(sc)
/* Stop the stats updater. */
timeout_del(&sc->xl_stsup_tmo);
- xl_freetxrx(sc);
-
ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+ xl_freetxrx(sc);
+
return;
}
diff --git a/sys/dev/pci/if_bce.c b/sys/dev/pci/if_bce.c
index 4a957516283..5e8a28fb02e 100644
--- a/sys/dev/pci/if_bce.c
+++ b/sys/dev/pci/if_bce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bce.c,v 1.6 2005/04/23 22:59:01 brad Exp $ */
+/* $OpenBSD: if_bce.c,v 1.7 2005/07/02 23:10:11 brad Exp $ */
/* $NetBSD: if_bce.c,v 1.3 2003/09/29 01:53:02 mrg Exp $ */
/*
@@ -1141,6 +1141,10 @@ bce_stop(ifp, disable)
/* Stop the 1 second timer */
timeout_del(&sc->bce_timeout);
+ /* Mark the interface down and cancel the watchdog timer. */
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+ ifp->if_timer = 0;
+
/* Down the MII. */
mii_down(&sc->bce_mii);
@@ -1177,10 +1181,6 @@ bce_stop(ifp, disable)
/* drain receive queue */
if (disable)
bce_rxdrain(sc);
-
- /* Mark the interface down and cancel the watchdog timer. */
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
- ifp->if_timer = 0;
}
/* reset the chip */
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index fc830c275a8..7749ef1066f 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.59 2005/07/02 06:15:44 deraadt Exp $ */
+/* $OpenBSD: if_em.c,v 1.60 2005/07/02 23:10:11 brad Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include "bpfilter.h"
@@ -1439,12 +1439,13 @@ em_stop(void *arg)
em_reset_hw(&sc->hw);
timeout_del(&sc->timer_handle);
timeout_del(&sc->tx_fifo_timer_handle);
- em_free_transmit_structures(sc);
- em_free_receive_structures(sc);
/* Tell the stack that the interface is no longer active */
ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+ em_free_transmit_structures(sc);
+ em_free_receive_structures(sc);
+
return;
}
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c
index 07551244930..b5d5b49afcd 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.47 2005/04/17 13:41:46 damien Exp $ */
+/* $OpenBSD: if_ipw.c,v 1.48 2005/07/02 23:10:11 brad Exp $ */
/*-
* Copyright (c) 2004, 2005
@@ -1980,15 +1980,15 @@ ipw_stop(struct ifnet *ifp, int disable)
ipw_stop_master(sc);
CSR_WRITE_4(sc, IPW_CSR_RST, IPW_RST_SW_RESET);
+ ifp->if_timer = 0;
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+
/*
* Release tx buffers
*/
for (i = 0; i < IPW_NTBD; i++)
ipw_release_sbd(sc, &sc->stbd_list[i]);
- ifp->if_timer = 0;
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
ieee80211_new_state(ic, IEEE80211_S_INIT, -1);
}
diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c
index 15d867cc3f5..f711ed84551 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.45 2005/06/20 18:25:14 damien Exp $ */
+/* $OpenBSD: if_iwi.c,v 1.46 2005/07/02 23:10:11 brad Exp $ */
/*-
* Copyright (c) 2004, 2005
@@ -2014,6 +2014,9 @@ iwi_stop(struct ifnet *ifp, int disable)
iwi_stop_master(sc);
CSR_WRITE_4(sc, IWI_CSR_RST, IWI_RST_SW_RESET);
+ ifp->if_timer = 0;
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+
/*
* Release Tx buffers
*/
@@ -2032,9 +2035,6 @@ iwi_stop(struct ifnet *ifp, int disable)
}
}
- ifp->if_timer = 0;
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
ieee80211_new_state(ic, IEEE80211_S_INIT, -1);
}
diff --git a/sys/dev/pci/if_lge.c b/sys/dev/pci/if_lge.c
index ad61e017171..34992458218 100644
--- a/sys/dev/pci/if_lge.c
+++ b/sys/dev/pci/if_lge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_lge.c,v 1.20 2005/06/18 04:23:09 brad Exp $ */
+/* $OpenBSD: if_lge.c,v 1.21 2005/07/02 23:10:11 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
@@ -1579,6 +1579,9 @@ void lge_stop(sc)
ifp = &sc->arpcom.ac_if;
ifp->if_timer = 0;
timeout_del(&sc->lge_timeout);
+
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+
CSR_WRITE_4(sc, LGE_IMR, LGE_IMR_INTR_ENB);
/* Disable receiver and transmitter. */
@@ -1610,8 +1613,6 @@ void lge_stop(sc)
bzero((char *)&sc->lge_ldata->lge_tx_list,
sizeof(sc->lge_ldata->lge_tx_list));
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
return;
}
diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c
index 6cd3f96b14d..267495e7f8d 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.34 2005/05/25 21:01:17 brad Exp $ */
+/* $OpenBSD: if_nge.c,v 1.35 2005/07/02 23:10:11 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
@@ -2244,6 +2244,9 @@ nge_stop(sc)
}
timeout_del(&sc->nge_timeout);
+
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+
CSR_WRITE_4(sc, NGE_IER, 0);
CSR_WRITE_4(sc, NGE_IMR, 0);
NGE_SETBIT(sc, NGE_CSR, NGE_CSR_TX_DISABLE|NGE_CSR_RX_DISABLE);
@@ -2280,8 +2283,6 @@ nge_stop(sc)
bzero((char *)&sc->nge_ldata->nge_tx_list,
sizeof(sc->nge_ldata->nge_tx_list));
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
}
/*
diff --git a/sys/dev/pci/if_sf.c b/sys/dev/pci/if_sf.c
index d37fe6643d1..a633522d86c 100644
--- a/sys/dev/pci/if_sf.c
+++ b/sys/dev/pci/if_sf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sf.c,v 1.29 2005/05/11 03:44:27 brad Exp $ */
+/* $OpenBSD: if_sf.c,v 1.30 2005/07/02 23:10:11 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -1296,6 +1296,8 @@ void sf_stop(sc)
timeout_del(&sc->sc_stats_tmo);
+ ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE);
+
csr_write_4(sc, SF_GEN_ETH_CTL, 0);
csr_write_4(sc, SF_CQ_CONSIDX, 0);
csr_write_4(sc, SF_CQ_PRODIDX, 0);
@@ -1323,8 +1325,6 @@ void sf_stop(sc)
}
}
- ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE);
-
return;
}
diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c
index 8e6c6b570cf..15bc95148ed 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.47 2005/06/12 21:38:14 fgsch Exp $ */
+/* $OpenBSD: if_sis.c,v 1.48 2005/07/02 23:10:11 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -2036,6 +2036,9 @@ void sis_stop(sc)
ifp->if_timer = 0;
timeout_del(&sc->sis_timeout);
+
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+
CSR_WRITE_4(sc, SIS_IER, 0);
CSR_WRITE_4(sc, SIS_IMR, 0);
CSR_READ_4(sc, SIS_ISR); /* clear any interrupts already pending */
@@ -2084,7 +2087,6 @@ void sis_stop(sc)
sizeof(struct sis_desc) - sizeof(bus_dmamap_t));
}
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
sc->sis_stopped = 1;
return;
diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c
index f9b8bb3f3d0..1856ddedb98 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.68 2005/07/02 21:57:19 brad Exp $ */
+/* $OpenBSD: if_sk.c,v 1.69 2005/07/02 23:10:11 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -2709,6 +2709,8 @@ sk_stop(struct sk_if_softc *sc_if)
timeout_del(&sc_if->sk_tick_ch);
+ ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE);
+
if (sc_if->sk_phytype == SK_PHYTYPE_BCOM) {
u_int32_t val;
@@ -2773,8 +2775,6 @@ sk_stop(struct sk_if_softc *sc_if)
sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf = NULL;
}
}
-
- ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE);
}
struct cfattach skc_ca = {
diff --git a/sys/dev/pci/if_ste.c b/sys/dev/pci/if_ste.c
index f804eff0956..4b4e76371a5 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.30 2005/04/21 06:48:05 fgsch Exp $ */
+/* $OpenBSD: if_ste.c,v 1.31 2005/07/02 23:10:11 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -1222,6 +1222,8 @@ void ste_stop(sc)
timeout_del(&sc->sc_stats_tmo);
+ ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE);
+
CSR_WRITE_2(sc, STE_IMR, 0);
STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_TX_DISABLE);
STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_RX_DISABLE);
@@ -1253,8 +1255,6 @@ void ste_stop(sc)
bzero(sc->ste_ldata, sizeof(struct ste_list_data));
- ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE);
-
return;
}
diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c
index b8c2733e3b7..f9aa332e281 100644
--- a/sys/dev/pci/if_ti.c
+++ b/sys/dev/pci/if_ti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ti.c,v 1.60 2005/04/25 17:55:51 brad Exp $ */
+/* $OpenBSD: if_ti.c,v 1.61 2005/07/02 23:10:11 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -2675,6 +2675,8 @@ void ti_stop(sc)
ifp = &sc->arpcom.ac_if;
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+
/* Disable host interrupts. */
CSR_WRITE_4(sc, TI_MB_HOSTINTR, 1);
/*
@@ -2704,8 +2706,6 @@ void ti_stop(sc)
sc->ti_tx_considx.ti_idx = 0;
sc->ti_tx_saved_considx = TI_TXCONS_UNSET;
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
return;
}
diff --git a/sys/dev/pci/if_wb.c b/sys/dev/pci/if_wb.c
index 88cf1264be1..e165eeda209 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.27 2005/01/15 05:24:11 brad Exp $ */
+/* $OpenBSD: if_wb.c,v 1.28 2005/07/02 23:10:11 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -1735,6 +1735,8 @@ void wb_stop(sc)
timeout_del(&sc->wb_tick_tmo);
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+
WB_CLRBIT(sc, WB_NETCFG, (WB_NETCFG_RX_ON|WB_NETCFG_TX_ON));
CSR_WRITE_4(sc, WB_IMR, 0x00000000);
CSR_WRITE_4(sc, WB_TXADDR, 0x00000000);
@@ -1764,10 +1766,6 @@ void wb_stop(sc)
bzero((char *)&sc->wb_ldata->wb_tx_list,
sizeof(sc->wb_ldata->wb_tx_list));
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
}
/*