diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9003_hw.c')
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_hw.c | 101 |
1 files changed, 94 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c index aebaad97b190..a55eddbb2589 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include "ar9003_mac.h" | 18 | #include "ar9003_mac.h" |
| 19 | #include "ar9003_2p2_initvals.h" | 19 | #include "ar9003_2p2_initvals.h" |
| 20 | #include "ar9485_initvals.h" | 20 | #include "ar9485_initvals.h" |
| 21 | #include "ar9340_initvals.h" | ||
| 21 | 22 | ||
| 22 | /* General hardware code for the AR9003 hadware family */ | 23 | /* General hardware code for the AR9003 hadware family */ |
| 23 | 24 | ||
| @@ -28,7 +29,63 @@ | |||
| 28 | */ | 29 | */ |
| 29 | static void ar9003_hw_init_mode_regs(struct ath_hw *ah) | 30 | static void ar9003_hw_init_mode_regs(struct ath_hw *ah) |
| 30 | { | 31 | { |
| 31 | if (AR_SREV_9485_11(ah)) { | 32 | if (AR_SREV_9340(ah)) { |
| 33 | /* mac */ | ||
| 34 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_PRE], NULL, 0, 0); | ||
| 35 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], | ||
| 36 | ar9340_1p0_mac_core, | ||
| 37 | ARRAY_SIZE(ar9340_1p0_mac_core), 2); | ||
| 38 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], | ||
| 39 | ar9340_1p0_mac_postamble, | ||
| 40 | ARRAY_SIZE(ar9340_1p0_mac_postamble), 5); | ||
| 41 | |||
| 42 | /* bb */ | ||
| 43 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_PRE], NULL, 0, 0); | ||
| 44 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], | ||
| 45 | ar9340_1p0_baseband_core, | ||
| 46 | ARRAY_SIZE(ar9340_1p0_baseband_core), 2); | ||
| 47 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], | ||
| 48 | ar9340_1p0_baseband_postamble, | ||
| 49 | ARRAY_SIZE(ar9340_1p0_baseband_postamble), 5); | ||
| 50 | |||
| 51 | /* radio */ | ||
| 52 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_PRE], NULL, 0, 0); | ||
| 53 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], | ||
| 54 | ar9340_1p0_radio_core, | ||
| 55 | ARRAY_SIZE(ar9340_1p0_radio_core), 2); | ||
| 56 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST], | ||
| 57 | ar9340_1p0_radio_postamble, | ||
| 58 | ARRAY_SIZE(ar9340_1p0_radio_postamble), 5); | ||
| 59 | |||
| 60 | /* soc */ | ||
| 61 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], | ||
| 62 | ar9340_1p0_soc_preamble, | ||
| 63 | ARRAY_SIZE(ar9340_1p0_soc_preamble), 2); | ||
| 64 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_CORE], NULL, 0, 0); | ||
| 65 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST], | ||
| 66 | ar9340_1p0_soc_postamble, | ||
| 67 | ARRAY_SIZE(ar9340_1p0_soc_postamble), 5); | ||
| 68 | |||
| 69 | /* rx/tx gain */ | ||
| 70 | INIT_INI_ARRAY(&ah->iniModesRxGain, | ||
| 71 | ar9340Common_wo_xlna_rx_gain_table_1p0, | ||
| 72 | ARRAY_SIZE(ar9340Common_wo_xlna_rx_gain_table_1p0), | ||
| 73 | 5); | ||
| 74 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
| 75 | ar9340Modes_high_ob_db_tx_gain_table_1p0, | ||
| 76 | ARRAY_SIZE(ar9340Modes_high_ob_db_tx_gain_table_1p0), | ||
| 77 | 5); | ||
| 78 | |||
| 79 | INIT_INI_ARRAY(&ah->iniModesAdditional, | ||
| 80 | ar9340Modes_fast_clock_1p0, | ||
| 81 | ARRAY_SIZE(ar9340Modes_fast_clock_1p0), | ||
| 82 | 3); | ||
| 83 | |||
| 84 | INIT_INI_ARRAY(&ah->iniModesAdditional_40M, | ||
| 85 | ar9340_1p0_radio_core_40M, | ||
| 86 | ARRAY_SIZE(ar9340_1p0_radio_core_40M), | ||
| 87 | 2); | ||
| 88 | } else if (AR_SREV_9485_11(ah)) { | ||
| 32 | /* mac */ | 89 | /* mac */ |
| 33 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_PRE], NULL, 0, 0); | 90 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_PRE], NULL, 0, 0); |
| 34 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], | 91 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
| @@ -163,7 +220,12 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah) | |||
| 163 | switch (ar9003_hw_get_tx_gain_idx(ah)) { | 220 | switch (ar9003_hw_get_tx_gain_idx(ah)) { |
| 164 | case 0: | 221 | case 0: |
| 165 | default: | 222 | default: |
| 166 | if (AR_SREV_9485_11(ah)) | 223 | if (AR_SREV_9340(ah)) |
| 224 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
| 225 | ar9340Modes_lowest_ob_db_tx_gain_table_1p0, | ||
| 226 | ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0), | ||
| 227 | 5); | ||
| 228 | else if (AR_SREV_9485_11(ah)) | ||
| 167 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 229 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 168 | ar9485_modes_lowest_ob_db_tx_gain_1_1, | 230 | ar9485_modes_lowest_ob_db_tx_gain_1_1, |
| 169 | ARRAY_SIZE(ar9485_modes_lowest_ob_db_tx_gain_1_1), | 231 | ARRAY_SIZE(ar9485_modes_lowest_ob_db_tx_gain_1_1), |
| @@ -175,7 +237,12 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah) | |||
| 175 | 5); | 237 | 5); |
| 176 | break; | 238 | break; |
| 177 | case 1: | 239 | case 1: |
| 178 | if (AR_SREV_9485_11(ah)) | 240 | if (AR_SREV_9340(ah)) |
| 241 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
| 242 | ar9340Modes_lowest_ob_db_tx_gain_table_1p0, | ||
| 243 | ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0), | ||
| 244 | 5); | ||
| 245 | else if (AR_SREV_9485_11(ah)) | ||
| 179 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 246 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 180 | ar9485Modes_high_ob_db_tx_gain_1_1, | 247 | ar9485Modes_high_ob_db_tx_gain_1_1, |
| 181 | ARRAY_SIZE(ar9485Modes_high_ob_db_tx_gain_1_1), | 248 | ARRAY_SIZE(ar9485Modes_high_ob_db_tx_gain_1_1), |
| @@ -187,7 +254,12 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah) | |||
| 187 | 5); | 254 | 5); |
| 188 | break; | 255 | break; |
| 189 | case 2: | 256 | case 2: |
| 190 | if (AR_SREV_9485_11(ah)) | 257 | if (AR_SREV_9340(ah)) |
| 258 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
| 259 | ar9340Modes_lowest_ob_db_tx_gain_table_1p0, | ||
| 260 | ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0), | ||
| 261 | 5); | ||
| 262 | else if (AR_SREV_9485_11(ah)) | ||
| 191 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 263 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 192 | ar9485Modes_low_ob_db_tx_gain_1_1, | 264 | ar9485Modes_low_ob_db_tx_gain_1_1, |
| 193 | ARRAY_SIZE(ar9485Modes_low_ob_db_tx_gain_1_1), | 265 | ARRAY_SIZE(ar9485Modes_low_ob_db_tx_gain_1_1), |
| @@ -199,7 +271,12 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah) | |||
| 199 | 5); | 271 | 5); |
| 200 | break; | 272 | break; |
| 201 | case 3: | 273 | case 3: |
| 202 | if (AR_SREV_9485_11(ah)) | 274 | if (AR_SREV_9340(ah)) |
| 275 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
| 276 | ar9340Modes_lowest_ob_db_tx_gain_table_1p0, | ||
| 277 | ARRAY_SIZE(ar9340Modes_lowest_ob_db_tx_gain_table_1p0), | ||
| 278 | 5); | ||
| 279 | else if (AR_SREV_9485_11(ah)) | ||
| 203 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 280 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 204 | ar9485Modes_high_power_tx_gain_1_1, | 281 | ar9485Modes_high_power_tx_gain_1_1, |
| 205 | ARRAY_SIZE(ar9485Modes_high_power_tx_gain_1_1), | 282 | ARRAY_SIZE(ar9485Modes_high_power_tx_gain_1_1), |
| @@ -218,7 +295,12 @@ static void ar9003_rx_gain_table_apply(struct ath_hw *ah) | |||
| 218 | switch (ar9003_hw_get_rx_gain_idx(ah)) { | 295 | switch (ar9003_hw_get_rx_gain_idx(ah)) { |
| 219 | case 0: | 296 | case 0: |
| 220 | default: | 297 | default: |
| 221 | if (AR_SREV_9485_11(ah)) | 298 | if (AR_SREV_9340(ah)) |
| 299 | INIT_INI_ARRAY(&ah->iniModesRxGain, | ||
| 300 | ar9340Common_rx_gain_table_1p0, | ||
| 301 | ARRAY_SIZE(ar9340Common_rx_gain_table_1p0), | ||
| 302 | 2); | ||
| 303 | else if (AR_SREV_9485_11(ah)) | ||
| 222 | INIT_INI_ARRAY(&ah->iniModesRxGain, | 304 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
| 223 | ar9485Common_wo_xlna_rx_gain_1_1, | 305 | ar9485Common_wo_xlna_rx_gain_1_1, |
| 224 | ARRAY_SIZE(ar9485Common_wo_xlna_rx_gain_1_1), | 306 | ARRAY_SIZE(ar9485Common_wo_xlna_rx_gain_1_1), |
| @@ -230,7 +312,12 @@ static void ar9003_rx_gain_table_apply(struct ath_hw *ah) | |||
| 230 | 2); | 312 | 2); |
| 231 | break; | 313 | break; |
| 232 | case 1: | 314 | case 1: |
| 233 | if (AR_SREV_9485_11(ah)) | 315 | if (AR_SREV_9340(ah)) |
| 316 | INIT_INI_ARRAY(&ah->iniModesRxGain, | ||
| 317 | ar9340Common_wo_xlna_rx_gain_table_1p0, | ||
| 318 | ARRAY_SIZE(ar9340Common_wo_xlna_rx_gain_table_1p0), | ||
| 319 | 2); | ||
| 320 | else if (AR_SREV_9485_11(ah)) | ||
| 234 | INIT_INI_ARRAY(&ah->iniModesRxGain, | 321 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
| 235 | ar9485Common_wo_xlna_rx_gain_1_1, | 322 | ar9485Common_wo_xlna_rx_gain_1_1, |
| 236 | ARRAY_SIZE(ar9485Common_wo_xlna_rx_gain_1_1), | 323 | ARRAY_SIZE(ar9485Common_wo_xlna_rx_gain_1_1), |
