diff options
author | Nick Kossifidis <mick@madwifi.org> | 2008-09-16 20:33:19 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-24 16:18:01 -0400 |
commit | 84e463fa0786a105c39281b90f8e3b6fe1444a05 (patch) | |
tree | a7df8abb7d6239240f2a8559db9fe5507d8595ef | |
parent | 92ffe055c3ea45856183bebed62f8880f75fef3b (diff) |
ath5k: Fix bad udelay calls on AR5210 code
* Fix bad udelay calls (using > 2000us) in AR5210 code and clean up
some bits on nic_reset (AR5210 support is still in bad shape)
Changes-licensed-under: ISC
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath5k/phy.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/reg.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/reset.c | 20 |
3 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath5k/phy.c b/drivers/net/wireless/ath5k/phy.c index 1ea8ed962d26..e43f6563e61a 100644 --- a/drivers/net/wireless/ath5k/phy.c +++ b/drivers/net/wireless/ath5k/phy.c | |||
@@ -2124,7 +2124,7 @@ static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah, | |||
2124 | beacon = ath5k_hw_reg_read(ah, AR5K_BEACON_5210); | 2124 | beacon = ath5k_hw_reg_read(ah, AR5K_BEACON_5210); |
2125 | ath5k_hw_reg_write(ah, beacon & ~AR5K_BEACON_ENABLE, AR5K_BEACON_5210); | 2125 | ath5k_hw_reg_write(ah, beacon & ~AR5K_BEACON_ENABLE, AR5K_BEACON_5210); |
2126 | 2126 | ||
2127 | udelay(2300); | 2127 | mdelay(2); |
2128 | 2128 | ||
2129 | /* | 2129 | /* |
2130 | * Set the channel (with AGC turned off) | 2130 | * Set the channel (with AGC turned off) |
diff --git a/drivers/net/wireless/ath5k/reg.h b/drivers/net/wireless/ath5k/reg.h index a98832364448..410f99a6d616 100644 --- a/drivers/net/wireless/ath5k/reg.h +++ b/drivers/net/wireless/ath5k/reg.h | |||
@@ -820,8 +820,6 @@ | |||
820 | #define AR5K_RESET_CTL_MAC 0x00000004 /* MAC reset (PCU+Baseband ?) [5210] */ | 820 | #define AR5K_RESET_CTL_MAC 0x00000004 /* MAC reset (PCU+Baseband ?) [5210] */ |
821 | #define AR5K_RESET_CTL_PHY 0x00000008 /* PHY reset [5210] */ | 821 | #define AR5K_RESET_CTL_PHY 0x00000008 /* PHY reset [5210] */ |
822 | #define AR5K_RESET_CTL_PCI 0x00000010 /* PCI Core reset (interrupts etc) */ | 822 | #define AR5K_RESET_CTL_PCI 0x00000010 /* PCI Core reset (interrupts etc) */ |
823 | #define AR5K_RESET_CTL_CHIP (AR5K_RESET_CTL_PCU | AR5K_RESET_CTL_DMA | \ | ||
824 | AR5K_RESET_CTL_MAC | AR5K_RESET_CTL_PHY) | ||
825 | 823 | ||
826 | /* | 824 | /* |
827 | * Sleep control register | 825 | * Sleep control register |
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c index f5c3de890cdb..953ba3b19ff7 100644 --- a/drivers/net/wireless/ath5k/reset.c +++ b/drivers/net/wireless/ath5k/reset.c | |||
@@ -173,8 +173,10 @@ static int ath5k_hw_nic_reset(struct ath5k_hw *ah, u32 val) | |||
173 | udelay(15); | 173 | udelay(15); |
174 | 174 | ||
175 | if (ah->ah_version == AR5K_AR5210) { | 175 | if (ah->ah_version == AR5K_AR5210) { |
176 | val &= AR5K_RESET_CTL_CHIP; | 176 | val &= AR5K_RESET_CTL_PCU | AR5K_RESET_CTL_DMA |
177 | mask &= AR5K_RESET_CTL_CHIP; | 177 | | AR5K_RESET_CTL_MAC | AR5K_RESET_CTL_PHY; |
178 | mask &= AR5K_RESET_CTL_PCU | AR5K_RESET_CTL_DMA | ||
179 | | AR5K_RESET_CTL_MAC | AR5K_RESET_CTL_PHY; | ||
178 | } else { | 180 | } else { |
179 | val &= AR5K_RESET_CTL_PCU | AR5K_RESET_CTL_BASEBAND; | 181 | val &= AR5K_RESET_CTL_PCU | AR5K_RESET_CTL_BASEBAND; |
180 | mask &= AR5K_RESET_CTL_PCU | AR5K_RESET_CTL_BASEBAND; | 182 | mask &= AR5K_RESET_CTL_PCU | AR5K_RESET_CTL_BASEBAND; |
@@ -361,16 +363,20 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial) | |||
361 | bus_flags = (pdev->is_pcie) ? 0 : AR5K_RESET_CTL_PCI; | 363 | bus_flags = (pdev->is_pcie) ? 0 : AR5K_RESET_CTL_PCI; |
362 | 364 | ||
363 | /* Reset chipset */ | 365 | /* Reset chipset */ |
364 | ret = ath5k_hw_nic_reset(ah, AR5K_RESET_CTL_PCU | | 366 | if (ah->ah_version == AR5K_AR5210) { |
365 | AR5K_RESET_CTL_BASEBAND | bus_flags); | 367 | ret = ath5k_hw_nic_reset(ah, AR5K_RESET_CTL_PCU | |
368 | AR5K_RESET_CTL_MAC | AR5K_RESET_CTL_DMA | | ||
369 | AR5K_RESET_CTL_PHY | AR5K_RESET_CTL_PCI); | ||
370 | mdelay(2); | ||
371 | } else { | ||
372 | ret = ath5k_hw_nic_reset(ah, AR5K_RESET_CTL_PCU | | ||
373 | AR5K_RESET_CTL_BASEBAND | bus_flags); | ||
374 | } | ||
366 | if (ret) { | 375 | if (ret) { |
367 | ATH5K_ERR(ah->ah_sc, "failed to reset the MAC Chip\n"); | 376 | ATH5K_ERR(ah->ah_sc, "failed to reset the MAC Chip\n"); |
368 | return -EIO; | 377 | return -EIO; |
369 | } | 378 | } |
370 | 379 | ||
371 | if (ah->ah_version == AR5K_AR5210) | ||
372 | udelay(2300); | ||
373 | |||
374 | /* ...wakeup again!*/ | 380 | /* ...wakeup again!*/ |
375 | ret = ath5k_hw_set_power(ah, AR5K_PM_AWAKE, true, 0); | 381 | ret = ath5k_hw_set_power(ah, AR5K_PM_AWAKE, true, 0); |
376 | if (ret) { | 382 | if (ret) { |