aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/base.c
diff options
context:
space:
mode:
authorNick Kossifidis <mick@madwifi-project.org>2009-08-09 20:29:02 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:56 -0400
commitedd7fc7003f31da48d06e215a93ea966a22c2a03 (patch)
tree5627da2c85e9a5e28ec047c3914cdf75425187c9 /drivers/net/wireless/ath/ath5k/base.c
parentd1cb0bdac180a4afdd3c001acb2618d2a62d9abe (diff)
ath5k: Wakeup fixes
* Don't put chip to full sleep because there are problems during wakeup. Instead hold MAC/Baseband on warm reset state via a new function ath5k_hw_on_hold. * Minor cleanups Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Tested-by: Ben Greear <greearb@candelatech.com> Tested-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 5d5028538ac2..0370cba8356c 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2446,27 +2446,29 @@ ath5k_stop_hw(struct ath5k_softc *sc)
2446 ret = ath5k_stop_locked(sc); 2446 ret = ath5k_stop_locked(sc);
2447 if (ret == 0 && !test_bit(ATH_STAT_INVALID, sc->status)) { 2447 if (ret == 0 && !test_bit(ATH_STAT_INVALID, sc->status)) {
2448 /* 2448 /*
2449 * Set the chip in full sleep mode. Note that we are 2449 * Don't set the card in full sleep mode!
2450 * careful to do this only when bringing the interface 2450 *
2451 * completely to a stop. When the chip is in this state 2451 * a) When the device is in this state it must be carefully
2452 * it must be carefully woken up or references to 2452 * woken up or references to registers in the PCI clock
2453 * registers in the PCI clock domain may freeze the bus 2453 * domain may freeze the bus (and system). This varies
2454 * (and system). This varies by chip and is mostly an 2454 * by chip and is mostly an issue with newer parts
2455 * issue with newer parts that go to sleep more quickly. 2455 * (madwifi sources mentioned srev >= 0x78) that go to
2456 */ 2456 * sleep more quickly.
2457 if (sc->ah->ah_mac_srev >= 0x78) { 2457 *
2458 /* 2458 * b) On older chips full sleep results a weird behaviour
2459 * XXX 2459 * during wakeup. I tested various cards with srev < 0x78
2460 * don't put newer MAC revisions > 7.8 to sleep because 2460 * and they don't wake up after module reload, a second
2461 * of the above mentioned problems 2461 * module reload is needed to bring the card up again.
2462 */ 2462 *
2463 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "mac version > 7.8, " 2463 * Until we figure out what's going on don't enable
2464 "not putting device to sleep\n"); 2464 * full chip reset on any chip (this is what Legacy HAL
2465 } else { 2465 * and Sam's HAL do anyway). Instead Perform a full reset
2466 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, 2466 * on the device (same as initial state after attach) and
2467 "putting device to full sleep\n"); 2467 * leave it idle (keep MAC/BB on warm reset) */
2468 ath5k_hw_set_power(sc->ah, AR5K_PM_FULL_SLEEP, true, 0); 2468 ret = ath5k_hw_on_hold(sc->ah);
2469 } 2469
2470 ATH5K_DBG(sc, ATH5K_DEBUG_RESET,
2471 "putting device to sleep\n");
2470 } 2472 }
2471 ath5k_txbuf_free(sc, sc->bbuf); 2473 ath5k_txbuf_free(sc, sc->bbuf);
2472 2474