-diff -urN madwifi-ng-r2377-20070526.old/ath/if_ath.c madwifi-ng-r2377-20070526.dev/ath/if_ath.c
---- madwifi-ng-r2377-20070526.old/ath/if_ath.c 2007-05-26 18:51:09.019716336 +0200
-+++ madwifi-ng-r2377-20070526.dev/ath/if_ath.c 2007-05-26 18:51:09.116701592 +0200
-@@ -7636,9 +7636,24 @@
- DPRINTF(sc, ATH_DEBUG_RESET, "%s: beacon queue 0x%x\n",
- __func__, ath_hal_gettxbuf(ah, sc->sc_bhalq));
- for (i = 0; i < HAL_NUM_TX_QUEUES; i++)
-- if (ATH_TXQ_SETUP(sc, i))
-+ if (ATH_TXQ_SETUP(sc, i)) {
- ath_tx_stopdma(sc, &sc->sc_txq[i]);
-+
-+ /* The TxDMA may not really be stopped.
-+ * Double check the hal tx pending count */
-+ npend += ath_hal_numtxpending(ah, sc->sc_txq[i].axq_qnum);
-+ }
- }
-+
-+ if (npend) {
-+ HAL_STATUS status;
-+
-+ /* TxDMA not stopped, reset the hal */
-+ DPRINTF(sc, ATH_DEBUG_RESET, "%s: Unable to stop TxDMA. Reset HAL!\n", __func__);
-+ if (!ath_hal_reset(ah, sc->sc_ic.ic_opmode, &sc->sc_curchan, AH_TRUE, &status))
-+ printk("%s: unable to reset hardware; hal status %u\n", __func__, status);
-+ }
-+
- sc->sc_dev->trans_start = jiffies;
- netif_start_queue(sc->sc_dev); /* XXX move to callers */
- for (i = 0; i < HAL_NUM_TX_QUEUES; i++)