aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/hw.c
diff options
context:
space:
mode:
authorNick Kossifidis <mick@madwifi.org>2008-07-30 06:18:59 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-01 15:31:31 -0400
commit0bacdf303f72a3ed34252934114bc04e79222687 (patch)
tree59f6144374b22822a0db710e8f6061d7982cd1b3 /drivers/net/wireless/ath5k/hw.c
parent00b1304c4ca81dd893973cc620b87a5c3ff3f660 (diff)
ath5k: Update register list
* Update list of registers * Use updated register macros inside hw.c, initvals.c and debug.c Changes-licensed-under: ISC Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k/hw.c')
-rw-r--r--drivers/net/wireless/ath5k/hw.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
index 7ca87a557312..42ef41ed5d18 100644
--- a/drivers/net/wireless/ath5k/hw.c
+++ b/drivers/net/wireless/ath5k/hw.c
@@ -843,27 +843,26 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
843 * Write some more initial register settings 843 * Write some more initial register settings
844 */ 844 */
845 if (ah->ah_version == AR5K_AR5212) { 845 if (ah->ah_version == AR5K_AR5212) {
846 ath5k_hw_reg_write(ah, 0x0002a002, AR5K_PHY(11)); 846 ath5k_hw_reg_write(ah, 0x0002a002, 0x982c);
847 847
848 if (channel->hw_value == CHANNEL_G) 848 if (channel->hw_value == CHANNEL_G)
849 if (ah->ah_mac_srev < AR5K_SREV_VER_AR2413) 849 if (ah->ah_mac_srev < AR5K_SREV_VER_AR2413)
850 ath5k_hw_reg_write(ah, 0x00f80d80, 850 ath5k_hw_reg_write(ah, 0x00f80d80,
851 AR5K_PHY(83)); 851 0x994c);
852 else if (ah->ah_mac_srev < AR5K_SREV_VER_AR2424) 852 else if (ah->ah_mac_srev < AR5K_SREV_VER_AR2424)
853 ath5k_hw_reg_write(ah, 0x00380140, 853 ath5k_hw_reg_write(ah, 0x00380140,
854 AR5K_PHY(83)); 854 0x994c);
855 else if (ah->ah_mac_srev < AR5K_SREV_VER_AR2425) 855 else if (ah->ah_mac_srev < AR5K_SREV_VER_AR2425)
856 ath5k_hw_reg_write(ah, 0x00fc0ec0, 856 ath5k_hw_reg_write(ah, 0x00fc0ec0,
857 AR5K_PHY(83)); 857 0x994c);
858 else /* 2425 */ 858 else /* 2425 */
859 ath5k_hw_reg_write(ah, 0x00fc0fc0, 859 ath5k_hw_reg_write(ah, 0x00fc0fc0,
860 AR5K_PHY(83)); 860 0x994c);
861 else 861 else
862 ath5k_hw_reg_write(ah, 0x00000000, 862 ath5k_hw_reg_write(ah, 0x00000000, 0x994c);
863 AR5K_PHY(83));
864 863
865 ath5k_hw_reg_write(ah, 0x000009b5, 0xa228); 864 ath5k_hw_reg_write(ah, 0x000009b5, 0xa228);
866 ath5k_hw_reg_write(ah, 0x0000000f, 0x8060); 865 ath5k_hw_reg_write(ah, 0x0000000f, AR5K_SEQ_MASK);
867 ath5k_hw_reg_write(ah, 0x00000000, 0xa254); 866 ath5k_hw_reg_write(ah, 0x00000000, 0xa254);
868 ath5k_hw_reg_write(ah, 0x0000000e, AR5K_PHY_SCAL); 867 ath5k_hw_reg_write(ah, 0x0000000e, AR5K_PHY_SCAL);
869 } 868 }
@@ -935,7 +934,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
935 return ret; 934 return ret;
936 935
937 /* Set antenna mode */ 936 /* Set antenna mode */
938 AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x44), 937 AR5K_REG_MASKED_BITS(ah, AR5K_PHY_ANT_CTL,
939 ah->ah_antenna[ee_mode][0], 0xfffffc06); 938 ah->ah_antenna[ee_mode][0], 0xfffffc06);
940 939
941 /* 940 /*
@@ -965,15 +964,15 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
965 964
966 ath5k_hw_reg_write(ah, 965 ath5k_hw_reg_write(ah,
967 AR5K_PHY_NF_SVAL(ee->ee_noise_floor_thr[ee_mode]), 966 AR5K_PHY_NF_SVAL(ee->ee_noise_floor_thr[ee_mode]),
968 AR5K_PHY(0x5a)); 967 AR5K_PHY_NFTHRES);
969 968
970 AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x11), 969 AR5K_REG_MASKED_BITS(ah, AR5K_PHY_SETTLING,
971 (ee->ee_switch_settling[ee_mode] << 7) & 0x3f80, 970 (ee->ee_switch_settling[ee_mode] << 7) & 0x3f80,
972 0xffffc07f); 971 0xffffc07f);
973 AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x12), 972 AR5K_REG_MASKED_BITS(ah, AR5K_PHY_GAIN,
974 (ee->ee_ant_tx_rx[ee_mode] << 12) & 0x3f000, 973 (ee->ee_ant_tx_rx[ee_mode] << 12) & 0x3f000,
975 0xfffc0fff); 974 0xfffc0fff);
976 AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x14), 975 AR5K_REG_MASKED_BITS(ah, AR5K_PHY_DESIRED_SIZE,
977 (ee->ee_adc_desired_size[ee_mode] & 0x00ff) | 976 (ee->ee_adc_desired_size[ee_mode] & 0x00ff) |
978 ((ee->ee_pga_desired_size[ee_mode] << 8) & 0xff00), 977 ((ee->ee_pga_desired_size[ee_mode] << 8) & 0xff00),
979 0xffff0000); 978 0xffff0000);
@@ -982,13 +981,13 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
982 (ee->ee_tx_end2xpa_disable[ee_mode] << 24) | 981 (ee->ee_tx_end2xpa_disable[ee_mode] << 24) |
983 (ee->ee_tx_end2xpa_disable[ee_mode] << 16) | 982 (ee->ee_tx_end2xpa_disable[ee_mode] << 16) |
984 (ee->ee_tx_frm2xpa_enable[ee_mode] << 8) | 983 (ee->ee_tx_frm2xpa_enable[ee_mode] << 8) |
985 (ee->ee_tx_frm2xpa_enable[ee_mode]), AR5K_PHY(0x0d)); 984 (ee->ee_tx_frm2xpa_enable[ee_mode]), AR5K_PHY_RF_CTL4);
986 985
987 AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x0a), 986 AR5K_REG_MASKED_BITS(ah, AR5K_PHY_RF_CTL3,
988 ee->ee_tx_end2xlna_enable[ee_mode] << 8, 0xffff00ff); 987 ee->ee_tx_end2xlna_enable[ee_mode] << 8, 0xffff00ff);
989 AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x19), 988 AR5K_REG_MASKED_BITS(ah, AR5K_PHY_NF,
990 (ee->ee_thr_62[ee_mode] << 12) & 0x7f000, 0xfff80fff); 989 (ee->ee_thr_62[ee_mode] << 12) & 0x7f000, 0xfff80fff);
991 AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x49), 4, 0xffffff01); 990 AR5K_REG_MASKED_BITS(ah, AR5K_PHY_OFDM_SELFCORR, 4, 0xffffff01);
992 991
993 AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ, 992 AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ,
994 AR5K_PHY_IQ_CORR_ENABLE | 993 AR5K_PHY_IQ_CORR_ENABLE |
@@ -3363,11 +3362,13 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
3363 ath5k_hw_reg_write(ah, ah->ah_turbo ? 3362 ath5k_hw_reg_write(ah, ah->ah_turbo ?
3364 AR5K_INIT_PROTO_TIME_CNTRL_TURBO : 3363 AR5K_INIT_PROTO_TIME_CNTRL_TURBO :
3365 AR5K_INIT_PROTO_TIME_CNTRL, AR5K_IFS1); 3364 AR5K_INIT_PROTO_TIME_CNTRL, AR5K_IFS1);
3366 /* Set PHY register 0x9844 (??) */ 3365 /* Set AR5K_PHY_SETTLING */
3367 ath5k_hw_reg_write(ah, ah->ah_turbo ? 3366 ath5k_hw_reg_write(ah, ah->ah_turbo ?
3368 (ath5k_hw_reg_read(ah, AR5K_PHY(17)) & ~0x7F) | 0x38 : 3367 (ath5k_hw_reg_read(ah, AR5K_PHY_SETTLING) & ~0x7F)
3369 (ath5k_hw_reg_read(ah, AR5K_PHY(17)) & ~0x7F) | 0x1C, 3368 | 0x38 :
3370 AR5K_PHY(17)); 3369 (ath5k_hw_reg_read(ah, AR5K_PHY_SETTLING) & ~0x7F)
3370 | 0x1C,
3371 AR5K_PHY_SETTLING);
3371 /* Set Frame Control Register */ 3372 /* Set Frame Control Register */
3372 ath5k_hw_reg_write(ah, ah->ah_turbo ? 3373 ath5k_hw_reg_write(ah, ah->ah_turbo ?
3373 (AR5K_PHY_FRAME_CTL_INI | AR5K_PHY_TURBO_MODE | 3374 (AR5K_PHY_FRAME_CTL_INI | AR5K_PHY_TURBO_MODE |