|
@@ -20,7 +20,6 @@
|
|
|
#include "hw.h"
|
|
|
#include "hw-ops.h"
|
|
|
#include "rc.h"
|
|
|
-#include "ar9002_initvals.h"
|
|
|
|
|
|
#define ATH9K_CLOCK_RATE_CCK 22
|
|
|
#define ATH9K_CLOCK_RATE_5GHZ_OFDM 40
|
|
@@ -70,6 +69,14 @@ static u32 ath9k_hw_compute_pll_control(struct ath_hw *ah,
|
|
|
return ath9k_hw_private_ops(ah)->compute_pll_control(ah, chan);
|
|
|
}
|
|
|
|
|
|
+static void ath9k_hw_init_mode_gain_regs(struct ath_hw *ah)
|
|
|
+{
|
|
|
+ if (!ath9k_hw_private_ops(ah)->init_mode_gain_regs)
|
|
|
+ return;
|
|
|
+
|
|
|
+ ath9k_hw_private_ops(ah)->init_mode_gain_regs(ah);
|
|
|
+}
|
|
|
+
|
|
|
/********************/
|
|
|
/* Helper Functions */
|
|
|
/********************/
|
|
@@ -479,54 +486,6 @@ static int ath9k_hw_init_macaddr(struct ath_hw *ah)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static void ath9k_hw_init_rxgain_ini(struct ath_hw *ah)
|
|
|
-{
|
|
|
- u32 rxgain_type;
|
|
|
-
|
|
|
- if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >= AR5416_EEP_MINOR_VER_17) {
|
|
|
- rxgain_type = ah->eep_ops->get_eeprom(ah, EEP_RXGAIN_TYPE);
|
|
|
-
|
|
|
- if (rxgain_type == AR5416_EEP_RXGAIN_13DB_BACKOFF)
|
|
|
- INIT_INI_ARRAY(&ah->iniModesRxGain,
|
|
|
- ar9280Modes_backoff_13db_rxgain_9280_2,
|
|
|
- ARRAY_SIZE(ar9280Modes_backoff_13db_rxgain_9280_2), 6);
|
|
|
- else if (rxgain_type == AR5416_EEP_RXGAIN_23DB_BACKOFF)
|
|
|
- INIT_INI_ARRAY(&ah->iniModesRxGain,
|
|
|
- ar9280Modes_backoff_23db_rxgain_9280_2,
|
|
|
- ARRAY_SIZE(ar9280Modes_backoff_23db_rxgain_9280_2), 6);
|
|
|
- else
|
|
|
- INIT_INI_ARRAY(&ah->iniModesRxGain,
|
|
|
- ar9280Modes_original_rxgain_9280_2,
|
|
|
- ARRAY_SIZE(ar9280Modes_original_rxgain_9280_2), 6);
|
|
|
- } else {
|
|
|
- INIT_INI_ARRAY(&ah->iniModesRxGain,
|
|
|
- ar9280Modes_original_rxgain_9280_2,
|
|
|
- ARRAY_SIZE(ar9280Modes_original_rxgain_9280_2), 6);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-static void ath9k_hw_init_txgain_ini(struct ath_hw *ah)
|
|
|
-{
|
|
|
- u32 txgain_type;
|
|
|
-
|
|
|
- if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >= AR5416_EEP_MINOR_VER_19) {
|
|
|
- txgain_type = ah->eep_ops->get_eeprom(ah, EEP_TXGAIN_TYPE);
|
|
|
-
|
|
|
- if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER)
|
|
|
- INIT_INI_ARRAY(&ah->iniModesTxGain,
|
|
|
- ar9280Modes_high_power_tx_gain_9280_2,
|
|
|
- ARRAY_SIZE(ar9280Modes_high_power_tx_gain_9280_2), 6);
|
|
|
- else
|
|
|
- INIT_INI_ARRAY(&ah->iniModesTxGain,
|
|
|
- ar9280Modes_original_tx_gain_9280_2,
|
|
|
- ARRAY_SIZE(ar9280Modes_original_tx_gain_9280_2), 6);
|
|
|
- } else {
|
|
|
- INIT_INI_ARRAY(&ah->iniModesTxGain,
|
|
|
- ar9280Modes_original_tx_gain_9280_2,
|
|
|
- ARRAY_SIZE(ar9280Modes_original_tx_gain_9280_2), 6);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
static int ath9k_hw_post_init(struct ath_hw *ah)
|
|
|
{
|
|
|
int ecode;
|
|
@@ -565,61 +524,6 @@ static int ath9k_hw_post_init(struct ath_hw *ah)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static void ath9k_hw_init_mode_gain_regs(struct ath_hw *ah)
|
|
|
-{
|
|
|
- if (AR_SREV_9287_11_OR_LATER(ah))
|
|
|
- INIT_INI_ARRAY(&ah->iniModesRxGain,
|
|
|
- ar9287Modes_rx_gain_9287_1_1,
|
|
|
- ARRAY_SIZE(ar9287Modes_rx_gain_9287_1_1), 6);
|
|
|
- else if (AR_SREV_9287_10(ah))
|
|
|
- INIT_INI_ARRAY(&ah->iniModesRxGain,
|
|
|
- ar9287Modes_rx_gain_9287_1_0,
|
|
|
- ARRAY_SIZE(ar9287Modes_rx_gain_9287_1_0), 6);
|
|
|
- else if (AR_SREV_9280_20(ah))
|
|
|
- ath9k_hw_init_rxgain_ini(ah);
|
|
|
-
|
|
|
- if (AR_SREV_9287_11_OR_LATER(ah)) {
|
|
|
- INIT_INI_ARRAY(&ah->iniModesTxGain,
|
|
|
- ar9287Modes_tx_gain_9287_1_1,
|
|
|
- ARRAY_SIZE(ar9287Modes_tx_gain_9287_1_1), 6);
|
|
|
- } else if (AR_SREV_9287_10(ah)) {
|
|
|
- INIT_INI_ARRAY(&ah->iniModesTxGain,
|
|
|
- ar9287Modes_tx_gain_9287_1_0,
|
|
|
- ARRAY_SIZE(ar9287Modes_tx_gain_9287_1_0), 6);
|
|
|
- } else if (AR_SREV_9280_20(ah)) {
|
|
|
- ath9k_hw_init_txgain_ini(ah);
|
|
|
- } else if (AR_SREV_9285_12_OR_LATER(ah)) {
|
|
|
- u32 txgain_type = ah->eep_ops->get_eeprom(ah, EEP_TXGAIN_TYPE);
|
|
|
-
|
|
|
- /* txgain table */
|
|
|
- if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER) {
|
|
|
- if (AR_SREV_9285E_20(ah)) {
|
|
|
- INIT_INI_ARRAY(&ah->iniModesTxGain,
|
|
|
- ar9285Modes_XE2_0_high_power,
|
|
|
- ARRAY_SIZE(
|
|
|
- ar9285Modes_XE2_0_high_power), 6);
|
|
|
- } else {
|
|
|
- INIT_INI_ARRAY(&ah->iniModesTxGain,
|
|
|
- ar9285Modes_high_power_tx_gain_9285_1_2,
|
|
|
- ARRAY_SIZE(
|
|
|
- ar9285Modes_high_power_tx_gain_9285_1_2), 6);
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (AR_SREV_9285E_20(ah)) {
|
|
|
- INIT_INI_ARRAY(&ah->iniModesTxGain,
|
|
|
- ar9285Modes_XE2_0_normal_power,
|
|
|
- ARRAY_SIZE(
|
|
|
- ar9285Modes_XE2_0_normal_power), 6);
|
|
|
- } else {
|
|
|
- INIT_INI_ARRAY(&ah->iniModesTxGain,
|
|
|
- ar9285Modes_original_tx_gain_9285_1_2,
|
|
|
- ARRAY_SIZE(
|
|
|
- ar9285Modes_original_tx_gain_9285_1_2), 6);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
static void ath9k_hw_init_eeprom_fix(struct ath_hw *ah)
|
|
|
{
|
|
|
struct base_eep_header *pBase = &(ah->eeprom.def.baseEepHeader);
|