diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-04-19 15:18:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-23 15:35:31 -0400 |
commit | 7c5adc8d83c344dbad251091879baf1244007564 (patch) | |
tree | 05494972ed0de7a8f9e0f634276400b597a126c2 /drivers/net/wireless/ath/ath9k/ar9003_phy.c | |
parent | 3e61d3f9b2f6381f6f30d3d0ff874251a3491d05 (diff) |
ath9k_hw: fix and clean up PHY activation delay
The delay calculation is the same for all chips, however some parts of the
code missed the extra delay factor for half/quarter.
Clean up the code and move the delay calculation to a common place.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9003_phy.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_phy.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index 4c8d0d770945..a1c0879a5d4e 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -526,22 +526,10 @@ static void ar9003_hw_init_bb(struct ath_hw *ah, | |||
526 | * Value is in 100ns increments. | 526 | * Value is in 100ns increments. |
527 | */ | 527 | */ |
528 | synthDelay = REG_READ(ah, AR_PHY_RX_DELAY) & AR_PHY_RX_DELAY_DELAY; | 528 | synthDelay = REG_READ(ah, AR_PHY_RX_DELAY) & AR_PHY_RX_DELAY_DELAY; |
529 | if (IS_CHAN_B(chan)) | ||
530 | synthDelay = (4 * synthDelay) / 22; | ||
531 | else | ||
532 | synthDelay /= 10; | ||
533 | 529 | ||
534 | /* Activate the PHY (includes baseband activate + synthesizer on) */ | 530 | /* Activate the PHY (includes baseband activate + synthesizer on) */ |
535 | REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN); | 531 | REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN); |
536 | 532 | ath9k_hw_synth_delay(ah, chan, synthDelay); | |
537 | /* | ||
538 | * There is an issue if the AP starts the calibration before | ||
539 | * the base band timeout completes. This could result in the | ||
540 | * rx_clear false triggering. As a workaround we add delay an | ||
541 | * extra BASE_ACTIVATE_DELAY usecs to ensure this condition | ||
542 | * does not happen. | ||
543 | */ | ||
544 | udelay(synthDelay + BASE_ACTIVATE_DELAY); | ||
545 | } | 533 | } |
546 | 534 | ||
547 | static void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx) | 535 | static void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx) |
@@ -801,12 +789,8 @@ static bool ar9003_hw_rfbus_req(struct ath_hw *ah) | |||
801 | static void ar9003_hw_rfbus_done(struct ath_hw *ah) | 789 | static void ar9003_hw_rfbus_done(struct ath_hw *ah) |
802 | { | 790 | { |
803 | u32 synthDelay = REG_READ(ah, AR_PHY_RX_DELAY) & AR_PHY_RX_DELAY_DELAY; | 791 | u32 synthDelay = REG_READ(ah, AR_PHY_RX_DELAY) & AR_PHY_RX_DELAY_DELAY; |
804 | if (IS_CHAN_B(ah->curchan)) | ||
805 | synthDelay = (4 * synthDelay) / 22; | ||
806 | else | ||
807 | synthDelay /= 10; | ||
808 | 792 | ||
809 | udelay(synthDelay + BASE_ACTIVATE_DELAY); | 793 | ath9k_hw_synth_delay(ah, ah->curchan, synthDelay); |
810 | 794 | ||
811 | REG_WRITE(ah, AR_PHY_RFBUS_REQ, 0); | 795 | REG_WRITE(ah, AR_PHY_RFBUS_REQ, 0); |
812 | } | 796 | } |