-@@ -439,7 +443,7 @@
- (AR5315_REV_MAJ_M | AR5315_REV_MIN_M));
- if (((devid & AR5315_REV_MAJ_M) == AR5315_REV_MAJ) ||
- ((devid & AR5315_REV_MAJ_M) == AR5317_REV_MAJ))
-- return init_ath_wmac(devid, 0, &config);
-+ return init_ath_wmac(devid, 0);
- }
-
- devid = (u_int16_t) ((sysRegRead(AR531X_REV) >>8) &
-@@ -452,11 +456,11 @@
- ar5312BspEepromRead(2 * AR531X_RADIO_MASK_OFF, 2,
- (char *) &radioMask);
- if ((radioMask & AR531X_RADIO0_MASK) != 0)
-- if ((ret = init_ath_wmac(devid, 0, &config)) !=0 )
-+ if ((ret = init_ath_wmac(devid, 0)) !=0 )
- return ret;
- /* XXX: Fall through?! */
- case AR5212_AR2313_REV8:
-- if ((ret = init_ath_wmac(devid, 1, &config)) != 0)
-+ if ((ret = init_ath_wmac(devid, 1)) != 0)
- return ret;
- break;
- default:
-diff -urN madwifi-ng-refcount-r2313-20070505.old/ath/if_ath.c madwifi-ng-refcount-r2313-20070505.dev/ath/if_ath.c
---- madwifi-ng-refcount-r2313-20070505.old/ath/if_ath.c 2007-05-13 18:17:56.362000712 +0200
-+++ madwifi-ng-refcount-r2313-20070505.dev/ath/if_ath.c 2007-05-13 18:17:56.371999192 +0200
-@@ -7670,9 +7672,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++)