summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2010-08-12 16:51:31 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2010-08-12 16:51:31 +0000
commitde5938e60019448c40f039ca3daea63ef52f05ef (patch)
tree69b4b4b84f04f57cdb469b0103b9888c60222b8c /sys/dev/ic
parent5850f7c441fa9bd99d4e9b1be1bfef3452ad18a3 (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.c17
-rw-r--r--sys/dev/ic/athnvar.h3
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;