diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/phy.c')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/phy.c | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c index eff3323efb4b..a8adca62e527 100644 --- a/drivers/net/wireless/ath/ath5k/phy.c +++ b/drivers/net/wireless/ath/ath5k/phy.c | |||
@@ -20,8 +20,6 @@ | |||
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define _ATH5K_PHY | ||
24 | |||
25 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
26 | 24 | ||
27 | #include "ath5k.h" | 25 | #include "ath5k.h" |
@@ -1190,7 +1188,7 @@ static s16 ath5k_hw_get_median_noise_floor(struct ath5k_hw *ah) | |||
1190 | * The median of the values in the history is then loaded into the | 1188 | * The median of the values in the history is then loaded into the |
1191 | * hardware for its own use for RSSI and CCA measurements. | 1189 | * hardware for its own use for RSSI and CCA measurements. |
1192 | */ | 1190 | */ |
1193 | void ath5k_hw_update_noise_floor(struct ath5k_hw *ah) | 1191 | static void ath5k_hw_update_noise_floor(struct ath5k_hw *ah) |
1194 | { | 1192 | { |
1195 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; | 1193 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; |
1196 | u32 val; | 1194 | u32 val; |
@@ -1399,7 +1397,11 @@ static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah, | |||
1399 | } | 1397 | } |
1400 | 1398 | ||
1401 | i_coffd = ((i_pwr >> 1) + (q_pwr >> 1)) >> 7; | 1399 | i_coffd = ((i_pwr >> 1) + (q_pwr >> 1)) >> 7; |
1402 | q_coffd = q_pwr >> 7; | 1400 | |
1401 | if (ah->ah_version == AR5K_AR5211) | ||
1402 | q_coffd = q_pwr >> 6; | ||
1403 | else | ||
1404 | q_coffd = q_pwr >> 7; | ||
1403 | 1405 | ||
1404 | /* protect against divide by 0 and loss of sign bits */ | 1406 | /* protect against divide by 0 and loss of sign bits */ |
1405 | if (i_coffd == 0 || q_coffd < 2) | 1407 | if (i_coffd == 0 || q_coffd < 2) |
@@ -1768,7 +1770,7 @@ u16 ath5k_hw_radio_revision(struct ath5k_hw *ah, unsigned int chan) | |||
1768 | * Antenna control * | 1770 | * Antenna control * |
1769 | \*****************/ | 1771 | \*****************/ |
1770 | 1772 | ||
1771 | void /*TODO:Boundary check*/ | 1773 | static void /*TODO:Boundary check*/ |
1772 | ath5k_hw_set_def_antenna(struct ath5k_hw *ah, u8 ant) | 1774 | ath5k_hw_set_def_antenna(struct ath5k_hw *ah, u8 ant) |
1773 | { | 1775 | { |
1774 | ATH5K_TRACE(ah->ah_sc); | 1776 | ATH5K_TRACE(ah->ah_sc); |
@@ -1777,16 +1779,6 @@ ath5k_hw_set_def_antenna(struct ath5k_hw *ah, u8 ant) | |||
1777 | ath5k_hw_reg_write(ah, ant & 0x7, AR5K_DEFAULT_ANTENNA); | 1779 | ath5k_hw_reg_write(ah, ant & 0x7, AR5K_DEFAULT_ANTENNA); |
1778 | } | 1780 | } |
1779 | 1781 | ||
1780 | unsigned int ath5k_hw_get_def_antenna(struct ath5k_hw *ah) | ||
1781 | { | ||
1782 | ATH5K_TRACE(ah->ah_sc); | ||
1783 | |||
1784 | if (ah->ah_version != AR5K_AR5210) | ||
1785 | return ath5k_hw_reg_read(ah, AR5K_DEFAULT_ANTENNA) & 0x7; | ||
1786 | |||
1787 | return false; /*XXX: What do we return for 5210 ?*/ | ||
1788 | } | ||
1789 | |||
1790 | /* | 1782 | /* |
1791 | * Enable/disable fast rx antenna diversity | 1783 | * Enable/disable fast rx antenna diversity |
1792 | */ | 1784 | */ |
@@ -1930,6 +1922,7 @@ ath5k_hw_set_antenna_mode(struct ath5k_hw *ah, u8 ant_mode) | |||
1930 | 1922 | ||
1931 | ah->ah_tx_ant = tx_ant; | 1923 | ah->ah_tx_ant = tx_ant; |
1932 | ah->ah_ant_mode = ant_mode; | 1924 | ah->ah_ant_mode = ant_mode; |
1925 | ah->ah_def_ant = def_ant; | ||
1933 | 1926 | ||
1934 | sta_id1 |= use_def_for_tx ? AR5K_STA_ID1_DEFAULT_ANTENNA : 0; | 1927 | sta_id1 |= use_def_for_tx ? AR5K_STA_ID1_DEFAULT_ANTENNA : 0; |
1935 | sta_id1 |= update_def_on_tx ? AR5K_STA_ID1_DESC_ANTENNA : 0; | 1928 | sta_id1 |= update_def_on_tx ? AR5K_STA_ID1_DESC_ANTENNA : 0; |
@@ -2440,19 +2433,6 @@ ath5k_combine_linear_pcdac_curves(struct ath5k_hw *ah, s16* table_min, | |||
2440 | pcdac_tmp = pcdac_high_pwr; | 2433 | pcdac_tmp = pcdac_high_pwr; |
2441 | 2434 | ||
2442 | edge_flag = 0x40; | 2435 | edge_flag = 0x40; |
2443 | #if 0 | ||
2444 | /* If both min and max power limits are in lower | ||
2445 | * power curve's range, only use the low power curve. | ||
2446 | * TODO: min/max levels are related to target | ||
2447 | * power values requested from driver/user | ||
2448 | * XXX: Is this really needed ? */ | ||
2449 | if (min_pwr < table_max[1] && | ||
2450 | max_pwr < table_max[1]) { | ||
2451 | edge_flag = 0; | ||
2452 | pcdac_tmp = pcdac_low_pwr; | ||
2453 | max_pwr_idx = (table_max[1] - table_min[1])/2; | ||
2454 | } | ||
2455 | #endif | ||
2456 | } else { | 2436 | } else { |
2457 | pcdac_low_pwr = ah->ah_txpower.tmpL[1]; /* Zeroed */ | 2437 | pcdac_low_pwr = ah->ah_txpower.tmpL[1]; /* Zeroed */ |
2458 | pcdac_high_pwr = ah->ah_txpower.tmpL[0]; | 2438 | pcdac_high_pwr = ah->ah_txpower.tmpL[0]; |
@@ -3143,5 +3123,3 @@ int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower) | |||
3143 | 3123 | ||
3144 | return ath5k_hw_txpower(ah, channel, ee_mode, txpower); | 3124 | return ath5k_hw_txpower(ah, channel, ee_mode, txpower); |
3145 | } | 3125 | } |
3146 | |||
3147 | #undef _ATH5K_PHY | ||