Date: Thu, 20 Oct 2011 09:46:47 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r226560 - user/adrian/if_ath_tx/sys/dev/ath Message-ID: <201110200946.p9K9klSR066896@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Thu Oct 20 09:46:47 2011 New Revision: 226560 URL: http://svn.freebsd.org/changeset/base/226560 Log: Track whether the driver is in reset or not. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Thu Oct 20 07:53:15 2011 (r226559) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Thu Oct 20 09:46:47 2011 (r226560) @@ -1828,6 +1828,10 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T DPRINTF(sc, ATH_DEBUG_RESET, "%s: called\n", __func__); + ATH_LOCK(sc); + sc->sc_in_reset++; + ATH_UNLOCK(sc); + ath_hal_intrset(ah, 0); /* disable interrupts */ ath_draintxq(sc, reset_type); /* stop xmit side */ /* @@ -1864,6 +1868,10 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T } ath_hal_intrset(ah, sc->sc_imask); + ATH_LOCK(sc); + sc->sc_in_reset--; + ATH_UNLOCK(sc); + ath_start(ifp); /* restart xmit */ return 0; } @@ -5238,6 +5246,11 @@ ath_set_channel(struct ieee80211com *ic) struct ifnet *ifp = ic->ic_ifp; struct ath_softc *sc = ifp->if_softc; + /* This isn't strictly a reset, but we still have to drain */ + ATH_LOCK(sc); + sc->sc_in_reset++; + ATH_UNLOCK(sc); + (void) ath_chan_set(sc, ic->ic_curchan); /* * If we are returning to our bss channel then mark state @@ -5247,6 +5260,10 @@ ath_set_channel(struct ieee80211com *ic) */ if (!sc->sc_scanning && ic->ic_curchan == ic->ic_bsschan) sc->sc_syncbeacon = 1; + + ATH_LOCK(sc); + sc->sc_in_reset--; + ATH_UNLOCK(sc); } /* Modified: user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Thu Oct 20 07:53:15 2011 (r226559) +++ user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Thu Oct 20 09:46:47 2011 (r226560) @@ -434,6 +434,7 @@ struct ath_softc { */ uint32_t sc_txq_active; /* bitmap of active TXQs */ uint32_t sc_kickpcu; /* whether to kick the PCU */ + uint32_t sc_in_reset; /* currently reset/chan change */ u_int sc_keymax; /* size of key cache */ u_int8_t sc_keymap[ATH_KEYBYTES];/* key use bit map */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110200946.p9K9klSR066896>