From 0972b395c29301c6c85b5b87ecdbfebed8bde8e9 Mon Sep 17 00:00:00 2001 From: adrian Date: Sat, 14 Aug 2010 15:29:21 +0000 Subject: [PATCH] Merge in a fix for the power/(gain?) calculation. Apply it to both the 5416/9160 and 9285 code paths. Obtained from: OpenWRT r22123, 522-ath9k_pwrcal_fix.patch --- sys/dev/ath/ath_hal/ar5416/ar5416_reset.c | 2 +- sys/dev/ath/ath_hal/ar5416/ar9285_reset.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c index 6f0e62ed95a2..0828d72ba555 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c @@ -2008,7 +2008,7 @@ ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah, * for last gain, pdGainBoundary == Pmax_t2, so will * have to extrapolate */ - if (tgtIndex > maxIndex) { /* need to extrapolate above */ + if (tgtIndex >= maxIndex) { /* need to extrapolate above */ while ((ss <= tgtIndex) && (k < (AR5416_NUM_PDADC_VALUES - 1))) { tmpVal = (int16_t)((vpdTableI[i][sizeCurrVpdTable - 1] + (ss - maxIndex +1) * vpdStep)); diff --git a/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c b/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c index 835f9429eb95..1f75c9260f32 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c +++ b/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c @@ -792,7 +792,7 @@ ar9285GetGainBoundariesAndPdadcs(struct ath_hal *ah, * for last gain, pdGainBoundary == Pmax_t2, so will * have to extrapolate */ - if (tgtIndex > maxIndex) { /* need to extrapolate above */ + if (tgtIndex >= maxIndex) { /* need to extrapolate above */ while ((ss <= tgtIndex) && (k < (AR5416_NUM_PDADC_VALUES - 1))) { tmpVal = (int16_t)((vpdTableI[i][sizeCurrVpdTable - 1] + (ss - maxIndex +1) * vpdStep));