aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/reset.c
diff options
context:
space:
mode:
authorNick Kossifidis <mick@madwifi-project.org>2009-04-30 15:55:49 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:56 -0400
commit2bed03ebf62f9d013a455209bf30d7e086120443 (patch)
tree35592ca12f0e4425213e317895612c3ce15ad3a5 /drivers/net/wireless/ath/ath5k/reset.c
parent6f5f39c95af519c24c0187950147eb79d07d1940 (diff)
ath5k: Implement antenna control
* Add code to support the various antenna scenarios supported by hw * For now hardcode the default scenario (single or dual omnis with tx/rx diversity working and tx antenna handled by session -hw keeps track on which antenna it got ack from each ap/station and maps each ap/station to one of the antennas-). Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/reset.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/reset.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c
index d419c6a3ded7..0e075bca384f 100644
--- a/drivers/net/wireless/ath/ath5k/reset.c
+++ b/drivers/net/wireless/ath/ath5k/reset.c
@@ -698,13 +698,13 @@ static void ath5k_hw_commit_eeprom_settings(struct ath5k_hw *ah,
698 /* Set antenna idle switch table */ 698 /* Set antenna idle switch table */
699 AR5K_REG_WRITE_BITS(ah, AR5K_PHY_ANT_CTL, 699 AR5K_REG_WRITE_BITS(ah, AR5K_PHY_ANT_CTL,
700 AR5K_PHY_ANT_CTL_SWTABLE_IDLE, 700 AR5K_PHY_ANT_CTL_SWTABLE_IDLE,
701 (ah->ah_antenna[ee_mode][0] | 701 (ah->ah_ant_ctl[ee_mode][0] |
702 AR5K_PHY_ANT_CTL_TXRX_EN)); 702 AR5K_PHY_ANT_CTL_TXRX_EN));
703 703
704 /* Set antenna switch table */ 704 /* Set antenna switch tables */
705 ath5k_hw_reg_write(ah, ah->ah_antenna[ee_mode][ant[0]], 705 ath5k_hw_reg_write(ah, ah->ah_ant_ctl[ee_mode][ant[0]],
706 AR5K_PHY_ANT_SWITCH_TABLE_0); 706 AR5K_PHY_ANT_SWITCH_TABLE_0);
707 ath5k_hw_reg_write(ah, ah->ah_antenna[ee_mode][ant[1]], 707 ath5k_hw_reg_write(ah, ah->ah_ant_ctl[ee_mode][ant[1]],
708 AR5K_PHY_ANT_SWITCH_TABLE_1); 708 AR5K_PHY_ANT_SWITCH_TABLE_1);
709 709
710 /* Noise floor threshold */ 710 /* Noise floor threshold */
@@ -1042,17 +1042,15 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
1042 1042
1043 /* 1043 /*
1044 * In case a fixed antenna was set as default 1044 * In case a fixed antenna was set as default
1045 * write the same settings on both AR5K_PHY_ANT_SWITCH_TABLE 1045 * use the same switch table twice.
1046 * registers.
1047 */ 1046 */
1048 if (s_ant != 0) { 1047 if (ah->ah_ant_mode == AR5K_ANTMODE_FIXED_A)
1049 if (s_ant == AR5K_ANT_FIXED_A) /* 1 - Main */ 1048 ant[0] = ant[1] = AR5K_ANT_SWTABLE_A;
1050 ant[0] = ant[1] = AR5K_ANT_FIXED_A; 1049 else if (ah->ah_ant_mode == AR5K_ANTMODE_FIXED_B)
1051 else /* 2 - Aux */ 1050 ant[0] = ant[1] = AR5K_ANT_SWTABLE_B;
1052 ant[0] = ant[1] = AR5K_ANT_FIXED_B; 1051 else {
1053 } else { 1052 ant[0] = AR5K_ANT_SWTABLE_A;
1054 ant[0] = AR5K_ANT_FIXED_A; 1053 ant[1] = AR5K_ANT_SWTABLE_B;
1055 ant[1] = AR5K_ANT_FIXED_B;
1056 } 1054 }
1057 1055
1058 /* Commit values from EEPROM */ 1056 /* Commit values from EEPROM */
@@ -1260,6 +1258,8 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
1260 */ 1258 */
1261 ath5k_hw_noise_floor_calibration(ah, channel->center_freq); 1259 ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
1262 1260
1261 /* Restore antenna mode */
1262 ath5k_hw_set_antenna_mode(ah, ah->ah_ant_mode);
1263 1263
1264 /* 1264 /*
1265 * Configure QCUs/DCUs 1265 * Configure QCUs/DCUs