diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2010-08-12 16:51:31 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2010-08-12 16:51:31 +0000 |
commit | de5938e60019448c40f039ca3daea63ef52f05ef (patch) | |
tree | 69b4b4b84f04f57cdb469b0103b9888c60222b8c /sys/dev/ic | |
parent | 5850f7c441fa9bd99d4e9b1be1bfef3452ad18a3 (diff) |
Enable periodic (every 4 minutes) power amplifier calibration
on AR9285 and AR9287.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/athn.c | 17 | ||||
-rw-r--r-- | sys/dev/ic/athnvar.h | 3 |
2 files changed, 15 insertions, 5 deletions
diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c index a96b13cac6c..b2207d734fe 100644 --- a/sys/dev/ic/athn.c +++ b/sys/dev/ic/athn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: athn.c,v 1.60 2010/08/12 16:32:31 damien Exp $ */ +/* $OpenBSD: athn.c,v 1.61 2010/08/12 16:51:30 damien Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -1149,9 +1149,16 @@ athn_calib_to(void *arg) s = splnet(); + /* Do periodic (every 4 minutes) PA calibration. */ + if (AR_SREV_9285_11_OR_LATER(sc) && + sc->pa_calib_ticks + 240 * hz < ticks) { + sc->pa_calib_ticks = ticks; + ar9285_pa_calib(sc); + } + + /* Do periodic (every 30 seconds) temperature compensation. */ if ((sc->flags & ATHN_FLAG_OLPC) && sc->olpc_ticks + 30 * hz < ticks) { - /* Compensate for temperature changes. */ sc->olpc_ticks = ticks; ops->olpc_temp_compensation(sc); } @@ -1190,9 +1197,11 @@ athn_init_calib(struct athn_softc *sc, struct ieee80211_channel *c, if (!AR_SREV_9380_10_OR_LATER(sc)) { /* Do PA calibration. */ - if (AR_SREV_9285_11_OR_LATER(sc)) + if (AR_SREV_9285_11_OR_LATER(sc)) { + extern int ticks; + sc->pa_calib_ticks = ticks; ar9285_pa_calib(sc); - + } /* Do noisefloor calibration. */ ops->noisefloor_calib(sc); } diff --git a/sys/dev/ic/athnvar.h b/sys/dev/ic/athnvar.h index 356b29213a3..f89791ffd41 100644 --- a/sys/dev/ic/athnvar.h +++ b/sys/dev/ic/athnvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: athnvar.h,v 1.21 2010/08/12 16:32:31 damien Exp $ */ +/* $OpenBSD: athnvar.h,v 1.22 2010/08/12 16:51:30 damien Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -532,6 +532,7 @@ struct athn_softc { int nf_hist_cur; int16_t nf_priv[AR_MAX_CHAINS]; int16_t nf_ext_priv[AR_MAX_CHAINS]; + int pa_calib_ticks; struct athn_calib calib; struct athn_ani ani; |