Commit 26a51ad7 authored by Bruno Randolf's avatar Bruno Randolf Committed by John W. Linville

ath5k: Remove ATH5K_INI_RFGAIN defines, use band instead

Remove redundant defines.
Signed-off-by: default avatarBruno Randolf <br1@einfach.org>
Acked-by: default avatarNick Kossifidis <mickflemm@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 51f00622
...@@ -154,10 +154,6 @@ ...@@ -154,10 +154,6 @@
udelay(1); \ udelay(1); \
} while (0) } while (0)
/* Register dumps are done per operation mode */
#define AR5K_INI_RFGAIN_5GHZ 0
#define AR5K_INI_RFGAIN_2GHZ 1
/* /*
* Some tuneable values (these should be changeable by the user) * Some tuneable values (these should be changeable by the user)
* TODO: Make use of them and add more options OR use debug/configfs * 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,7 +1318,7 @@ void ath5k_hw_set_antenna_switch(struct ath5k_hw *ah, u8 ee_mode);
int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower); int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower);
/* Init function */ /* Init function */
int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
u8 mode, u8 ee_mode, u8 freq, bool fast); u8 mode, u8 ee_mode, bool fast);
/* /*
* Functions used internaly * Functions used internaly
......
...@@ -609,10 +609,10 @@ enum ath5k_rfgain ath5k_hw_gainf_calibrate(struct ath5k_hw *ah) ...@@ -609,10 +609,10 @@ enum ath5k_rfgain ath5k_hw_gainf_calibrate(struct ath5k_hw *ah)
/* Write initial RF gain table to set the RF sensitivity /* Write initial RF gain table to set the RF sensitivity
* this one works on all RF chips and has nothing to do * this one works on all RF chips and has nothing to do
* with gain_F calibration */ * with gain_F calibration */
static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq) static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, enum ieee80211_band band)
{ {
const struct ath5k_ini_rfgain *ath5k_rfg; const struct ath5k_ini_rfgain *ath5k_rfg;
unsigned int i, size; unsigned int i, size, index;
switch (ah->ah_radio) { switch (ah->ah_radio) {
case AR5K_RF5111: case AR5K_RF5111:
...@@ -644,17 +644,11 @@ static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq) ...@@ -644,17 +644,11 @@ static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq)
return -EINVAL; return -EINVAL;
} }
switch (freq) { index = (band == IEEE80211_BAND_2GHZ) ? 1 : 0;
case AR5K_INI_RFGAIN_2GHZ:
case AR5K_INI_RFGAIN_5GHZ:
break;
default:
return -EINVAL;
}
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
AR5K_REG_WAIT(i); AR5K_REG_WAIT(i);
ath5k_hw_reg_write(ah, ath5k_rfg[i].rfg_value[freq], ath5k_hw_reg_write(ah, ath5k_rfg[i].rfg_value[index],
(u32)ath5k_rfg[i].rfg_register); (u32)ath5k_rfg[i].rfg_register);
} }
...@@ -3246,7 +3240,7 @@ int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower) ...@@ -3246,7 +3240,7 @@ int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower)
\*************/ \*************/
int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
u8 mode, u8 ee_mode, u8 freq, bool fast) u8 mode, u8 ee_mode, bool fast)
{ {
struct ieee80211_channel *curr_channel; struct ieee80211_channel *curr_channel;
int ret, i; int ret, i;
...@@ -3305,7 +3299,7 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, ...@@ -3305,7 +3299,7 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
* Write initial RF gain settings * Write initial RF gain settings
* This should work for both 5111/5112 * This should work for both 5111/5112
*/ */
ret = ath5k_hw_rfgain_init(ah, freq); ret = ath5k_hw_rfgain_init(ah, channel->band);
if (ret) if (ret)
return ret; return ret;
......
...@@ -1020,13 +1020,12 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, ...@@ -1020,13 +1020,12 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
struct ieee80211_channel *channel, bool fast, bool skip_pcu) struct ieee80211_channel *channel, bool fast, bool skip_pcu)
{ {
u32 s_seq[10], s_led[3], tsf_up, tsf_lo; u32 s_seq[10], s_led[3], tsf_up, tsf_lo;
u8 mode, freq, ee_mode; u8 mode, ee_mode;
int i, ret; int i, ret;
ee_mode = 0; ee_mode = 0;
tsf_up = 0; tsf_up = 0;
tsf_lo = 0; tsf_lo = 0;
freq = 0;
mode = 0; mode = 0;
/* /*
...@@ -1071,7 +1070,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, ...@@ -1071,7 +1070,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
switch (channel->hw_value & CHANNEL_MODES) { switch (channel->hw_value & CHANNEL_MODES) {
case CHANNEL_A: case CHANNEL_A:
mode = AR5K_MODE_11A; mode = AR5K_MODE_11A;
freq = AR5K_INI_RFGAIN_5GHZ;
ee_mode = AR5K_EEPROM_MODE_11A; ee_mode = AR5K_EEPROM_MODE_11A;
break; break;
case CHANNEL_G: case CHANNEL_G:
...@@ -1083,7 +1081,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, ...@@ -1083,7 +1081,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
} }
mode = AR5K_MODE_11G; mode = AR5K_MODE_11G;
freq = AR5K_INI_RFGAIN_2GHZ;
ee_mode = AR5K_EEPROM_MODE_11G; ee_mode = AR5K_EEPROM_MODE_11G;
break; break;
case CHANNEL_B: case CHANNEL_B:
...@@ -1095,7 +1092,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, ...@@ -1095,7 +1092,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
} }
mode = AR5K_MODE_11B; mode = AR5K_MODE_11B;
freq = AR5K_INI_RFGAIN_2GHZ;
ee_mode = AR5K_EEPROM_MODE_11B; ee_mode = AR5K_EEPROM_MODE_11B;
break; break;
case CHANNEL_XR: case CHANNEL_XR:
...@@ -1105,7 +1101,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, ...@@ -1105,7 +1101,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
return -EINVAL; return -EINVAL;
} }
mode = AR5K_MODE_XR; mode = AR5K_MODE_XR;
freq = AR5K_INI_RFGAIN_5GHZ;
ee_mode = AR5K_EEPROM_MODE_11A; ee_mode = AR5K_EEPROM_MODE_11A;
break; break;
default: default:
...@@ -1120,7 +1115,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, ...@@ -1120,7 +1115,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
*/ */
if (fast) { if (fast) {
ret = ath5k_hw_phy_init(ah, channel, mode, ret = ath5k_hw_phy_init(ah, channel, mode,
ee_mode, freq, true); ee_mode, true);
if (ret) { if (ret) {
ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_RESET, ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_RESET,
"fast chan change failed, falling back to normal reset\n"); "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,7 +1251,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
/* /*
* Initialize PHY * Initialize PHY
*/ */
ret = ath5k_hw_phy_init(ah, channel, mode, ee_mode, freq, false); ret = ath5k_hw_phy_init(ah, channel, mode, ee_mode, false);
if (ret) { if (ret) {
ATH5K_ERR(ah->ah_sc, ATH5K_ERR(ah->ah_sc,
"failed to initialize PHY (%i) !\n", ret); "failed to initialize PHY (%i) !\n", ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment