Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Nov 2008 19:48:18 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 152758 for review
Message-ID:  <200811101948.mAAJmIxp015279@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=152758

Change 152758 by sam@sam_ebb on 2008/11/10 19:47:39

	allow setting the cal interval to 0 to disable periodic cals
	for testing

Affected files ...

.. //depot/projects/vap/sys/dev/ath/if_ath.c#122 edit

Differences ...

==== //depot/projects/vap/sys/dev/ath/if_ath.c#122 (text+ko) ====

@@ -5582,15 +5582,22 @@
 		if (sc->sc_calinterval > ath_calinterval)
 			sc->sc_calinterval = ath_calinterval;
 	}
-	KASSERT(0 < sc->sc_calinterval && sc->sc_calinterval <= ath_calinterval,
+	KASSERT(0 <= sc->sc_calinterval &&
+	    sc->sc_calinterval <= ath_calinterval,
 		("bad calibration interval %u", sc->sc_calinterval));
 
-	DPRINTF(sc, ATH_DEBUG_CALIBRATE,
-		"%s: next +%u (%siqCalDone tries %u)\n", __func__,
-		sc->sc_calinterval, iqCalDone ? "" : "!", sc->sc_caltries);
-	sc->sc_caltries++;
-	callout_reset(&sc->sc_cal_ch, sc->sc_calinterval * hz,
-		ath_calibrate, sc);
+	if (ath_calinterval != 0) {
+		DPRINTF(sc, ATH_DEBUG_CALIBRATE,
+		    "%s: next +%u (%siqCalDone tries %u)\n", __func__,
+		    sc->sc_calinterval, iqCalDone ? "" : "!", sc->sc_caltries);
+		sc->sc_caltries++;
+		callout_reset(&sc->sc_cal_ch, sc->sc_calinterval * hz,
+			ath_calibrate, sc);
+	} else {
+		DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: calibration disabled\n",
+		    __func__);
+		/* NB: don't rearm timer */
+	}
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811101948.mAAJmIxp015279>