diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-06-14 18:40:24 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-06-14 18:40:24 +0000 |
commit | e5f21831749319be6a03711223bde4ff78570591 (patch) | |
tree | b9b308f023db0c93867d6125655c011b172b601e /sys | |
parent | f9a4ca8c02838136b15b3df1e5077afeec9a712b (diff) |
clear the IFF_UP interface flag before shutting down the interface.
ok damien@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_ipw.c | 9 | ||||
-rw-r--r-- | sys/dev/pci/if_iwi.c | 8 | ||||
-rw-r--r-- | sys/dev/pci/if_wpi.c | 5 |
3 files changed, 16 insertions, 6 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 9e44d862f22..cdc88b57649 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.57 2006/05/17 19:54:10 damien Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.58 2006/06/14 18:40:23 brad Exp $ */ /*- * Copyright (c) 2004-2006 @@ -301,7 +301,7 @@ ipw_attach(struct device *parent, struct device *self, void *aux) } int -ipw_detach(struct device* self, int flags) +ipw_detach(struct device *self, int flags) { struct ipw_softc *sc = (struct ipw_softc *)self; struct ifnet *ifp = &sc->sc_ic.ic_if; @@ -803,6 +803,7 @@ void ipw_newstate_intr(struct ipw_softc *sc, struct ipw_soft_buf *sbuf) { struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = &ic->ic_if; uint32_t state; bus_dmamap_sync(sc->sc_dmat, sbuf->map, 0, sizeof state, @@ -834,6 +835,7 @@ ipw_newstate_intr(struct ipw_softc *sc, struct ipw_soft_buf *sbuf) break; case IPW_STATE_RADIO_DISABLED: + ifp->if_flags &= ~IFF_UP; ipw_stop(&ic->ic_if, 1); break; } @@ -1059,6 +1061,7 @@ int ipw_intr(void *arg) { struct ipw_softc *sc = arg; + struct ifnet *ifp = &sc->sc_ic.ic_if; uint32_t r; if ((r = CSR_READ_4(sc, IPW_CSR_INTR)) == 0 || r == 0xffffffff) @@ -1071,6 +1074,7 @@ ipw_intr(void *arg) if (r & (IPW_INTR_FATAL_ERROR | IPW_INTR_PARITY_ERROR)) { printf("%s: fatal firmware error\n", sc->sc_dev.dv_xname); + ifp->if_flags &= ~IFF_UP; ipw_stop(&sc->sc_ic.ic_if, 1); return 1; } @@ -1374,6 +1378,7 @@ ipw_watchdog(struct ifnet *ifp) if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { printf("%s: device timeout\n", sc->sc_dev.dv_xname); + ifp->if_flags &= ~IFF_UP; ipw_stop(ifp, 1); ifp->if_oerrors++; return; diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index 38948485a9d..a8768088abc 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.68 2006/05/17 19:54:10 damien Exp $ */ +/* $OpenBSD: if_iwi.c,v 1.69 2006/06/14 18:40:23 brad Exp $ */ /*- * Copyright (c) 2004-2006 @@ -378,7 +378,7 @@ fail1: iwi_free_cmd_ring(sc, &sc->cmdq); } int -iwi_detach(struct device* self, int flags) +iwi_detach(struct device *self, int flags) { struct iwi_softc *sc = (struct iwi_softc *)self; struct ifnet *ifp = &sc->sc_ic.ic_if; @@ -1183,6 +1183,7 @@ int iwi_intr(void *arg) { struct iwi_softc *sc = arg; + struct ifnet *ifp = &sc->sc_ic.ic_if; uint32_t r; if ((r = CSR_READ_4(sc, IWI_CSR_INTR)) == 0 || r == 0xffffffff) @@ -1196,6 +1197,7 @@ iwi_intr(void *arg) if (r & (IWI_INTR_FATAL_ERROR | IWI_INTR_PARITY_ERROR)) { printf("%s: fatal firmware error\n", sc->sc_dev.dv_xname); + ifp->if_flags &= ~IFF_UP; iwi_stop(&sc->sc_ic.ic_if, 1); return 1; } @@ -1207,6 +1209,7 @@ iwi_intr(void *arg) if (r & IWI_INTR_RADIO_OFF) { DPRINTF(("radio transmitter off\n")); + ifp->if_flags &= ~IFF_UP; iwi_stop(&sc->sc_ic.ic_if, 1); r = 0; /* don't process more interrupts */ } @@ -1452,6 +1455,7 @@ iwi_watchdog(struct ifnet *ifp) if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { printf("%s: device timeout\n", sc->sc_dev.dv_xname); + ifp->if_flags &= ~IFF_UP; iwi_stop(ifp, 1); ifp->if_oerrors++; return; diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index 6f9b8011420..7635a8312f3 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.16 2006/06/10 20:34:45 damien Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.17 2006/06/14 18:40:23 brad Exp $ */ /*- * Copyright (c) 2006 @@ -364,7 +364,7 @@ fail1: while (--ac >= 0) } int -wpi_detach(struct device* self, int flags) +wpi_detach(struct device *self, int flags) { struct wpi_softc *sc = (struct wpi_softc *)self; struct ifnet *ifp = &sc->sc_ic.ic_if; @@ -1690,6 +1690,7 @@ wpi_watchdog(struct ifnet *ifp) if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { printf("%s: device timeout\n", sc->sc_dev.dv_xname); + ifp->if_flags &= ~IFF_UP; wpi_stop(ifp, 1); ifp->if_oerrors++; return; |