diff options
author | Bruno Randolf <br1@einfach.org> | 2010-12-21 03:30:37 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-22 15:43:28 -0500 |
commit | 26a51ad7f285236ca593c57cffcaadd40514084a (patch) | |
tree | 351792c771187012cdd9b18c4366f3bbc3d196bf /drivers/net/wireless | |
parent | 51f00622e5664ae77fd6c8670ddd402d9b77ccc8 (diff) |
ath5k: Remove ATH5K_INI_RFGAIN defines, use band instead
Remove redundant defines.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ath5k.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/phy.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/reset.c | 11 |
3 files changed, 10 insertions, 25 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h index 342da280c987..5de852017651 100644 --- a/drivers/net/wireless/ath/ath5k/ath5k.h +++ b/drivers/net/wireless/ath/ath5k/ath5k.h | |||
@@ -154,10 +154,6 @@ | |||
154 | udelay(1); \ | 154 | udelay(1); \ |
155 | } while (0) | 155 | } while (0) |
156 | 156 | ||
157 | /* Register dumps are done per operation mode */ | ||
158 | #define AR5K_INI_RFGAIN_5GHZ 0 | ||
159 | #define AR5K_INI_RFGAIN_2GHZ 1 | ||
160 | |||
161 | /* | 157 | /* |
162 | * Some tuneable values (these should be changeable by the user) | 158 | * Some tuneable values (these should be changeable by the user) |
163 | * TODO: Make use of them and add more options OR use debug/configfs | 159 | * TODO: Make use of them and add more options OR use debug/configfs |
@@ -1322,7 +1318,7 @@ void ath5k_hw_set_antenna_switch(struct ath5k_hw *ah, u8 ee_mode); | |||
1322 | int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower); | 1318 | int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower); |
1323 | /* Init function */ | 1319 | /* Init function */ |
1324 | int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, | 1320 | int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, |
1325 | u8 mode, u8 ee_mode, u8 freq, bool fast); | 1321 | u8 mode, u8 ee_mode, bool fast); |
1326 | 1322 | ||
1327 | /* | 1323 | /* |
1328 | * Functions used internaly | 1324 | * Functions used internaly |
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c index 18c58cdfde46..b6e96213e924 100644 --- a/drivers/net/wireless/ath/ath5k/phy.c +++ b/drivers/net/wireless/ath/ath5k/phy.c | |||
@@ -609,10 +609,10 @@ done: | |||
609 | /* Write initial RF gain table to set the RF sensitivity | 609 | /* Write initial RF gain table to set the RF sensitivity |
610 | * this one works on all RF chips and has nothing to do | 610 | * this one works on all RF chips and has nothing to do |
611 | * with gain_F calibration */ | 611 | * with gain_F calibration */ |
612 | static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq) | 612 | static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, enum ieee80211_band band) |
613 | { | 613 | { |
614 | const struct ath5k_ini_rfgain *ath5k_rfg; | 614 | const struct ath5k_ini_rfgain *ath5k_rfg; |
615 | unsigned int i, size; | 615 | unsigned int i, size, index; |
616 | 616 | ||
617 | switch (ah->ah_radio) { | 617 | switch (ah->ah_radio) { |
618 | case AR5K_RF5111: | 618 | case AR5K_RF5111: |
@@ -644,17 +644,11 @@ static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq) | |||
644 | return -EINVAL; | 644 | return -EINVAL; |
645 | } | 645 | } |
646 | 646 | ||
647 | switch (freq) { | 647 | index = (band == IEEE80211_BAND_2GHZ) ? 1 : 0; |
648 | case AR5K_INI_RFGAIN_2GHZ: | ||
649 | case AR5K_INI_RFGAIN_5GHZ: | ||
650 | break; | ||
651 | default: | ||
652 | return -EINVAL; | ||
653 | } | ||
654 | 648 | ||
655 | for (i = 0; i < size; i++) { | 649 | for (i = 0; i < size; i++) { |
656 | AR5K_REG_WAIT(i); | 650 | AR5K_REG_WAIT(i); |
657 | ath5k_hw_reg_write(ah, ath5k_rfg[i].rfg_value[freq], | 651 | ath5k_hw_reg_write(ah, ath5k_rfg[i].rfg_value[index], |
658 | (u32)ath5k_rfg[i].rfg_register); | 652 | (u32)ath5k_rfg[i].rfg_register); |
659 | } | 653 | } |
660 | 654 | ||
@@ -3246,7 +3240,7 @@ int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower) | |||
3246 | \*************/ | 3240 | \*************/ |
3247 | 3241 | ||
3248 | int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, | 3242 | int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, |
3249 | u8 mode, u8 ee_mode, u8 freq, bool fast) | 3243 | u8 mode, u8 ee_mode, bool fast) |
3250 | { | 3244 | { |
3251 | struct ieee80211_channel *curr_channel; | 3245 | struct ieee80211_channel *curr_channel; |
3252 | int ret, i; | 3246 | int ret, i; |
@@ -3305,7 +3299,7 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, | |||
3305 | * Write initial RF gain settings | 3299 | * Write initial RF gain settings |
3306 | * This should work for both 5111/5112 | 3300 | * This should work for both 5111/5112 |
3307 | */ | 3301 | */ |
3308 | ret = ath5k_hw_rfgain_init(ah, freq); | 3302 | ret = ath5k_hw_rfgain_init(ah, channel->band); |
3309 | if (ret) | 3303 | if (ret) |
3310 | return ret; | 3304 | return ret; |
3311 | 3305 | ||
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c index 7297d7b77043..e360e73b3260 100644 --- a/drivers/net/wireless/ath/ath5k/reset.c +++ b/drivers/net/wireless/ath/ath5k/reset.c | |||
@@ -1020,13 +1020,12 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
1020 | struct ieee80211_channel *channel, bool fast, bool skip_pcu) | 1020 | struct ieee80211_channel *channel, bool fast, bool skip_pcu) |
1021 | { | 1021 | { |
1022 | u32 s_seq[10], s_led[3], tsf_up, tsf_lo; | 1022 | u32 s_seq[10], s_led[3], tsf_up, tsf_lo; |
1023 | u8 mode, freq, ee_mode; | 1023 | u8 mode, ee_mode; |
1024 | int i, ret; | 1024 | int i, ret; |
1025 | 1025 | ||
1026 | ee_mode = 0; | 1026 | ee_mode = 0; |
1027 | tsf_up = 0; | 1027 | tsf_up = 0; |
1028 | tsf_lo = 0; | 1028 | tsf_lo = 0; |
1029 | freq = 0; | ||
1030 | mode = 0; | 1029 | mode = 0; |
1031 | 1030 | ||
1032 | /* | 1031 | /* |
@@ -1071,7 +1070,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
1071 | switch (channel->hw_value & CHANNEL_MODES) { | 1070 | switch (channel->hw_value & CHANNEL_MODES) { |
1072 | case CHANNEL_A: | 1071 | case CHANNEL_A: |
1073 | mode = AR5K_MODE_11A; | 1072 | mode = AR5K_MODE_11A; |
1074 | freq = AR5K_INI_RFGAIN_5GHZ; | ||
1075 | ee_mode = AR5K_EEPROM_MODE_11A; | 1073 | ee_mode = AR5K_EEPROM_MODE_11A; |
1076 | break; | 1074 | break; |
1077 | case CHANNEL_G: | 1075 | case CHANNEL_G: |
@@ -1083,7 +1081,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
1083 | } | 1081 | } |
1084 | 1082 | ||
1085 | mode = AR5K_MODE_11G; | 1083 | mode = AR5K_MODE_11G; |
1086 | freq = AR5K_INI_RFGAIN_2GHZ; | ||
1087 | ee_mode = AR5K_EEPROM_MODE_11G; | 1084 | ee_mode = AR5K_EEPROM_MODE_11G; |
1088 | break; | 1085 | break; |
1089 | case CHANNEL_B: | 1086 | case CHANNEL_B: |
@@ -1095,7 +1092,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
1095 | } | 1092 | } |
1096 | 1093 | ||
1097 | mode = AR5K_MODE_11B; | 1094 | mode = AR5K_MODE_11B; |
1098 | freq = AR5K_INI_RFGAIN_2GHZ; | ||
1099 | ee_mode = AR5K_EEPROM_MODE_11B; | 1095 | ee_mode = AR5K_EEPROM_MODE_11B; |
1100 | break; | 1096 | break; |
1101 | case CHANNEL_XR: | 1097 | case CHANNEL_XR: |
@@ -1105,7 +1101,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
1105 | return -EINVAL; | 1101 | return -EINVAL; |
1106 | } | 1102 | } |
1107 | mode = AR5K_MODE_XR; | 1103 | mode = AR5K_MODE_XR; |
1108 | freq = AR5K_INI_RFGAIN_5GHZ; | ||
1109 | ee_mode = AR5K_EEPROM_MODE_11A; | 1104 | ee_mode = AR5K_EEPROM_MODE_11A; |
1110 | break; | 1105 | break; |
1111 | default: | 1106 | default: |
@@ -1120,7 +1115,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
1120 | */ | 1115 | */ |
1121 | if (fast) { | 1116 | if (fast) { |
1122 | ret = ath5k_hw_phy_init(ah, channel, mode, | 1117 | ret = ath5k_hw_phy_init(ah, channel, mode, |
1123 | ee_mode, freq, true); | 1118 | ee_mode, true); |
1124 | if (ret) { | 1119 | if (ret) { |
1125 | ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_RESET, | 1120 | ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_RESET, |
1126 | "fast chan change failed, falling back to normal reset\n"); | 1121 | "fast chan change failed, falling back to normal reset\n"); |
@@ -1256,7 +1251,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
1256 | /* | 1251 | /* |
1257 | * Initialize PHY | 1252 | * Initialize PHY |
1258 | */ | 1253 | */ |
1259 | ret = ath5k_hw_phy_init(ah, channel, mode, ee_mode, freq, false); | 1254 | ret = ath5k_hw_phy_init(ah, channel, mode, ee_mode, false); |
1260 | if (ret) { | 1255 | if (ret) { |
1261 | ATH5K_ERR(ah->ah_sc, | 1256 | ATH5K_ERR(ah->ah_sc, |
1262 | "failed to initialize PHY (%i) !\n", ret); | 1257 | "failed to initialize PHY (%i) !\n", ret); |