diff options
author | 2010-08-12 16:04:51 +0000 | |
---|---|---|
committer | 2010-08-12 16:04:51 +0000 | |
commit | 567a8ba62130585ff97d71d1f87cf761ed308d9a (patch) | |
tree | 716f8ee4f4d37f2b075df2d8ac63ec77c3a175aa | |
parent | Print the real device name followed by the disklabel UID in parenthesis (diff) | |
download | wireguard-openbsd-567a8ba62130585ff97d71d1f87cf761ed308d9a.tar.xz wireguard-openbsd-567a8ba62130585ff97d71d1f87cf761ed308d9a.zip |
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@
-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; |