wlan - Update ath, sync rev 1.276@FreeBSD
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 9 Sep 2010 05:43:37 +0000 (22:43 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 9 Sep 2010 05:43:37 +0000 (22:43 -0700)
* Don't delay updating the longcal timer - instead, update the longcal
  flag immediately so it's only set once per longcal interval.

  Without this, the current AR5416 code will continuously spam NF
  calibrations during a periodic calibration if the longcal flag
  is set. The longcal flag wouldn't be cleared until the calibration
  method indicates that calibrations are "complete".

  This could cause numerous problems including stuck beacons.

Taken-From: FreeBSD

sys/dev/netif/ath/ath/if_ath.c

index 279fc7c..d86a724 100644 (file)
@@ -1671,6 +1671,7 @@ ath_reset(struct ifnet *ifp)
        struct ath_hal *ah = sc->sc_ah;
        HAL_STATUS status;
 
+       kprintf("ath_reset\n");
        ath_hal_intrset(ah, 0);         /* disable interrupts */
        ath_draintxq(sc);               /* stop xmit side */
        ath_stoprecv(sc);               /* stop recv side */
@@ -5420,6 +5421,7 @@ ath_calibrate_callout(void *arg)
        longCal = (ticks - sc->sc_lastlongcal >= ath_longcalinterval*hz);
        if (longCal) {
                sc->sc_stats.ast_per_cal++;
+               sc->sc_lastlongcal = ticks;
                if (ath_hal_getrfgain(ah) == HAL_RFGAIN_NEED_CHANGE) {
                        /*
                         * Rfgain is out of bounds, reset the chip
@@ -5468,7 +5470,6 @@ restart:
                        nextcal *= 10;
        } else {
                nextcal = ath_longcalinterval*hz;
-               sc->sc_lastlongcal = ticks;
                if (sc->sc_lastcalreset == 0)
                        sc->sc_lastcalreset = sc->sc_lastlongcal;
                else if (ticks - sc->sc_lastcalreset >= ath_resetcalinterval*hz)