diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2010-08-12 16:04:52 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2010-08-12 16:04:52 +0000 |
commit | 8dda537fe7f2a5380b3fff938b17b0d3c28f078c (patch) | |
tree | ab66253aff2fe0150ba2aa2fff178f0cfaaa7461 /sys | |
parent | 28df7a8f22deae9662a3826a934c7533f9078393 (diff) |
Fix look-up of the power control digital-to-analog converter (PCDAC)
value in the Tx gain table.
This fixes AR9280/AR9281 chips in open-loop power control mode, like
the high power solution found in the Acer Aspire One.
tested by ray@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/ar9280.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/ic/ar9280.c b/sys/dev/ic/ar9280.c index 128dd65653a..edb5c212ee0 100644 --- a/sys/dev/ic/ar9280.c +++ b/sys/dev/ic/ar9280.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar9280.c,v 1.10 2010/07/15 20:37:38 damien Exp $ */ +/* $OpenBSD: ar9280.c,v 1.11 2010/08/12 16:04:51 damien Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -427,12 +427,15 @@ ar9280_olpc_get_pdadcs(struct athn_softc *sc, struct ieee80211_channel *c, pwr = (pierdata[lo].pwrPdg[0][0] + pierdata[hi].pwrPdg[0][0]) / 2; pwr /= 2; /* Convert to dB. */ - pcdac = pierdata[hi].pcdac[0][0]; /* XXX lo??? */ + pcdac = pierdata[hi].pcdac[0][0]; for (idx = 0; idx < AR9280_TX_GAIN_TABLE_SIZE - 1; idx++) - if (pcdac > sc->tx_gain_tbl[idx]) + if (pcdac <= sc->tx_gain_tbl[idx]) break; *txgain = idx; + DPRINTFN(3, ("fbin=%d lo=%d hi=%d pwr=%d pcdac=%d txgain=%d\n", + fbin, lo, hi, pwr, pcdac, idx)); + for (i = 0; i < AR_NUM_PDADC_VALUES; i++) pdadcs[i] = (i < pwr) ? 0x00 : 0xff; |