diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-07-15 13:53:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-17 15:11:34 -0400 |
commit | b05a01110ed10a93203d936a06aa01bf80837c39 (patch) | |
tree | 29d6e0f3bdca536d35758b37221b2779caef9e66 /drivers | |
parent | 00f97b4fd578328a6a54d4e2c3cfa74c6c32683f (diff) |
ath9k_hw: fix tx gain tables for AR934x
Use the EEPROM information to choose the right tx gain table
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_hw.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c index 41e88c660e48..718241d4ec49 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c | |||
@@ -561,8 +561,8 @@ static void ar9003_tx_gain_table_mode1(struct ath_hw *ah) | |||
561 | 5); | 561 | 5); |
562 | else if (AR_SREV_9340(ah)) | 562 | else if (AR_SREV_9340(ah)) |
563 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 563 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
564 | ar9340Modes_lowest_ob_db_tx_gain_table_1p0, | 564 | ar9340Modes_high_ob_db_tx_gain_table_1p0, |
565 | ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0), | 565 | ARRAY_SIZE(ar9340Modes_high_ob_db_tx_gain_table_1p0), |
566 | 5); | 566 | 5); |
567 | else if (AR_SREV_9485_11(ah)) | 567 | else if (AR_SREV_9485_11(ah)) |
568 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 568 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
@@ -605,8 +605,8 @@ static void ar9003_tx_gain_table_mode2(struct ath_hw *ah) | |||
605 | 5); | 605 | 5); |
606 | else if (AR_SREV_9340(ah)) | 606 | else if (AR_SREV_9340(ah)) |
607 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 607 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
608 | ar9340Modes_lowest_ob_db_tx_gain_table_1p0, | 608 | ar9340Modes_low_ob_db_tx_gain_table_1p0, |
609 | ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0), | 609 | ARRAY_SIZE(ar9340Modes_low_ob_db_tx_gain_table_1p0), |
610 | 5); | 610 | 5); |
611 | else if (AR_SREV_9485_11(ah)) | 611 | else if (AR_SREV_9485_11(ah)) |
612 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 612 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
@@ -639,8 +639,8 @@ static void ar9003_tx_gain_table_mode3(struct ath_hw *ah) | |||
639 | 5); | 639 | 5); |
640 | else if (AR_SREV_9340(ah)) | 640 | else if (AR_SREV_9340(ah)) |
641 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 641 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
642 | ar9340Modes_lowest_ob_db_tx_gain_table_1p0, | 642 | ar9340Modes_high_power_tx_gain_table_1p0, |
643 | ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0), | 643 | ARRAY_SIZE(ar9340Modes_high_power_tx_gain_table_1p0), |
644 | 5); | 644 | 5); |
645 | else if (AR_SREV_9485_11(ah)) | 645 | else if (AR_SREV_9485_11(ah)) |
646 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 646 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
@@ -659,6 +659,20 @@ static void ar9003_tx_gain_table_mode3(struct ath_hw *ah) | |||
659 | 5); | 659 | 5); |
660 | } | 660 | } |
661 | 661 | ||
662 | static void ar9003_tx_gain_table_mode4(struct ath_hw *ah) | ||
663 | { | ||
664 | if (AR_SREV_9340(ah)) | ||
665 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
666 | ar9340Modes_mixed_ob_db_tx_gain_table_1p0, | ||
667 | ARRAY_SIZE(ar9340Modes_mixed_ob_db_tx_gain_table_1p0), | ||
668 | 5); | ||
669 | else if (AR_SREV_9580(ah)) | ||
670 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
671 | ar9580_1p0_mixed_ob_db_tx_gain_table, | ||
672 | ARRAY_SIZE(ar9580_1p0_mixed_ob_db_tx_gain_table), | ||
673 | 5); | ||
674 | } | ||
675 | |||
662 | static void ar9003_tx_gain_table_apply(struct ath_hw *ah) | 676 | static void ar9003_tx_gain_table_apply(struct ath_hw *ah) |
663 | { | 677 | { |
664 | switch (ar9003_hw_get_tx_gain_idx(ah)) { | 678 | switch (ar9003_hw_get_tx_gain_idx(ah)) { |
@@ -675,6 +689,9 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah) | |||
675 | case 3: | 689 | case 3: |
676 | ar9003_tx_gain_table_mode3(ah); | 690 | ar9003_tx_gain_table_mode3(ah); |
677 | break; | 691 | break; |
692 | case 4: | ||
693 | ar9003_tx_gain_table_mode4(ah); | ||
694 | break; | ||
678 | } | 695 | } |
679 | } | 696 | } |
680 | 697 | ||