Author: adrian
Date: Sat May 18 13:58:07 2013
New Revision: 250777
URL: http://svnweb.freebsd.org/changeset/base/250777

Log:
  Re-add some code to exclude transmitting if we're in reset.
  
  This fixes some "transmitting during reset" bugs that crept in after
  I messed around with this part of the transmit path.

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c   Sat May 18 13:56:26 2013        (r250776)
+++ head/sys/dev/ath/if_ath.c   Sat May 18 13:58:07 2013        (r250777)
@@ -2620,9 +2620,28 @@ ath_start_queue(struct ifnet *ifp)
 {
        struct ath_softc *sc = ifp->if_softc;
 
+       ATH_PCU_LOCK(sc);
+       if (sc->sc_inreset_cnt > 0) {
+               device_printf(sc->sc_dev,
+                   "%s: sc_inreset_cnt > 0; bailing\n", __func__);
+               ATH_PCU_UNLOCK(sc);
+               IF_LOCK(&ifp->if_snd);
+               sc->sc_stats.ast_tx_qstop++;
+               ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+               IF_UNLOCK(&ifp->if_snd);
+               ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: OACTIVE, finish");
+               return;
+       }
+       sc->sc_txstart_cnt++;
+       ATH_PCU_UNLOCK(sc);
+
        ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_queue: start");
        ath_tx_kick(sc);
        ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_queue: finished");
+
+       ATH_PCU_LOCK(sc);
+       sc->sc_txstart_cnt--;
+       ATH_PCU_UNLOCK(sc);
 }
 
 void
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to