diff options
author | Nick Kossifidis <mickflemm@gmail.com> | 2008-02-28 16:20:52 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-07 16:02:58 -0500 |
commit | 56c9054f16ecb62bd83e9c55032522604d2f626c (patch) | |
tree | 3bcf445b4e5927452ee8fc7735a060f31e8bd59a | |
parent | 74693a7f3096a52ecbf477d31dc4c595bf27a8d3 (diff) |
ath5k: Fixes for PCI-E cards
* Fix nic_wakeup for PCI-E chips (don't set AR5K_RESET_CTL_PCI bit)
* Fix dma size setting for PCI-E chips (thanx to Bob Copeland).
Changes-licensed-under: ISC
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath5k/ath5k.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/hw.c | 39 |
2 files changed, 34 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath5k/ath5k.h b/drivers/net/wireless/ath5k/ath5k.h index c0b65961f55f..04efceef95a8 100644 --- a/drivers/net/wireless/ath5k/ath5k.h +++ b/drivers/net/wireless/ath5k/ath5k.h | |||
@@ -171,13 +171,13 @@ struct ath5k_srev_name { | |||
171 | #define AR5K_SREV_VER_AR5213A 0x59 | 171 | #define AR5K_SREV_VER_AR5213A 0x59 |
172 | #define AR5K_SREV_VER_AR2413 0x78 | 172 | #define AR5K_SREV_VER_AR2413 0x78 |
173 | #define AR5K_SREV_VER_AR2414 0x79 | 173 | #define AR5K_SREV_VER_AR2414 0x79 |
174 | #define AR5K_SREV_VER_AR2424 0xa0 | 174 | #define AR5K_SREV_VER_AR2424 0xa0 /* PCI-E */ |
175 | #define AR5K_SREV_VER_AR5424 0xa3 | 175 | #define AR5K_SREV_VER_AR5424 0xa3 /* PCI-E */ |
176 | #define AR5K_SREV_VER_AR5413 0xa4 | 176 | #define AR5K_SREV_VER_AR5413 0xa4 |
177 | #define AR5K_SREV_VER_AR5414 0xa5 | 177 | #define AR5K_SREV_VER_AR5414 0xa5 |
178 | #define AR5K_SREV_VER_AR5416 0xc0 /* ? */ | 178 | #define AR5K_SREV_VER_AR5416 0xc0 /* PCI-E */ |
179 | #define AR5K_SREV_VER_AR5418 0xca | 179 | #define AR5K_SREV_VER_AR5418 0xca /* PCI-E */ |
180 | #define AR5K_SREV_VER_AR2425 0xe2 | 180 | #define AR5K_SREV_VER_AR2425 0xe2 /* PCI-E */ |
181 | 181 | ||
182 | #define AR5K_SREV_RAD_5110 0x00 | 182 | #define AR5K_SREV_RAD_5110 0x00 |
183 | #define AR5K_SREV_RAD_5111 0x10 | 183 | #define AR5K_SREV_RAD_5111 0x10 |
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c index bd1513d1460b..b275b1f234a5 100644 --- a/drivers/net/wireless/ath5k/hw.c +++ b/drivers/net/wireless/ath5k/hw.c | |||
@@ -300,7 +300,8 @@ err: | |||
300 | */ | 300 | */ |
301 | static int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial) | 301 | static int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial) |
302 | { | 302 | { |
303 | u32 turbo, mode, clock; | 303 | struct pci_dev *pdev = ah->ah_sc->pdev; |
304 | u32 turbo, mode, clock, bus_flags; | ||
304 | int ret; | 305 | int ret; |
305 | 306 | ||
306 | turbo = 0; | 307 | turbo = 0; |
@@ -377,9 +378,15 @@ static int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial) | |||
377 | AR5K_PHY_TURBO); | 378 | AR5K_PHY_TURBO); |
378 | } | 379 | } |
379 | 380 | ||
380 | /* ...reset chipset and PCI device */ | 381 | /* reseting PCI on PCI-E cards results card to hang |
381 | if (ah->ah_single_chip == false && ath5k_hw_nic_reset(ah, | 382 | * and always return 0xffff... so we ingore that flag |
382 | AR5K_RESET_CTL_CHIP | AR5K_RESET_CTL_PCI)) { | 383 | * for PCI-E cards */ |
384 | bus_flags = (pdev->is_pcie) ? 0 : AR5K_RESET_CTL_PCI; | ||
385 | |||
386 | /* Reset chipset */ | ||
387 | ret = ath5k_hw_nic_reset(ah, AR5K_RESET_CTL_PCU | | ||
388 | AR5K_RESET_CTL_BASEBAND | bus_flags); | ||
389 | if (ret) { | ||
383 | ATH5K_ERR(ah->ah_sc, "failed to reset the MAC Chip + PCI\n"); | 390 | ATH5K_ERR(ah->ah_sc, "failed to reset the MAC Chip + PCI\n"); |
384 | return -EIO; | 391 | return -EIO; |
385 | } | 392 | } |
@@ -588,7 +595,8 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, | |||
588 | struct ieee80211_channel *channel, bool change_channel) | 595 | struct ieee80211_channel *channel, bool change_channel) |
589 | { | 596 | { |
590 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; | 597 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; |
591 | u32 data, s_seq, s_ant, s_led[3]; | 598 | struct pci_dev *pdev = ah->ah_sc->pdev; |
599 | u32 data, s_seq, s_ant, s_led[3], dma_size; | ||
592 | unsigned int i, mode, freq, ee_mode, ant[2]; | 600 | unsigned int i, mode, freq, ee_mode, ant[2]; |
593 | int ret; | 601 | int ret; |
594 | 602 | ||
@@ -900,13 +908,24 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, | |||
900 | 908 | ||
901 | /* | 909 | /* |
902 | * Set Rx/Tx DMA Configuration | 910 | * Set Rx/Tx DMA Configuration |
903 | *(passing dma size not available on 5210) | 911 | * |
912 | * Set maximum DMA size (512) except for PCI-E cards since | ||
913 | * it causes rx overruns and tx errors (tested on 5424 but since | ||
914 | * rx overruns also occur on 5416/5418 with madwifi we set 128 | ||
915 | * for all PCI-E cards to be safe). | ||
916 | * | ||
917 | * In dumps this is 128 for allchips. | ||
918 | * | ||
919 | * XXX: need to check 5210 for this | ||
920 | * TODO: Check out tx triger level, it's always 64 on dumps but I | ||
921 | * guess we can tweak it and see how it goes ;-) | ||
904 | */ | 922 | */ |
923 | dma_size = (pdev->is_pcie) ? AR5K_DMASIZE_128B : AR5K_DMASIZE_512B; | ||
905 | if (ah->ah_version != AR5K_AR5210) { | 924 | if (ah->ah_version != AR5K_AR5210) { |
906 | AR5K_REG_WRITE_BITS(ah, AR5K_TXCFG, AR5K_TXCFG_SDMAMR, | 925 | AR5K_REG_WRITE_BITS(ah, AR5K_TXCFG, |
907 | AR5K_DMASIZE_512B | AR5K_TXCFG_DMASIZE); | 926 | AR5K_TXCFG_SDMAMR, dma_size); |
908 | AR5K_REG_WRITE_BITS(ah, AR5K_RXCFG, AR5K_RXCFG_SDMAMW, | 927 | AR5K_REG_WRITE_BITS(ah, AR5K_RXCFG, |
909 | AR5K_DMASIZE_512B); | 928 | AR5K_RXCFG_SDMAMW, dma_size); |
910 | } | 929 | } |
911 | 930 | ||
912 | /* | 931 | /* |