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
This commit is contained in:
adrian 2010-08-14 15:29:21 +00:00
parent 4759296b2b
commit 0972b395c2
2 changed files with 2 additions and 2 deletions

View File

@ -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));

View File

@ -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));