diff options
author | adrian <adrian@FreeBSD.org> | 2014-03-20 05:08:31 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2014-03-20 05:08:31 +0000 |
commit | 91585205976a530182e788c76eb47eb581659281 (patch) | |
tree | ec5b67ef13f70ed86ddb81a54ea72c6dbf26cbef /sys/dev | |
parent | 754a06c6fc9ffa8d5472e8eb24739513a9fb1ee1 (diff) | |
download | FreeBSD-src-91585205976a530182e788c76eb47eb581659281.zip FreeBSD-src-91585205976a530182e788c76eb47eb581659281.tar.gz |
Shuffle ah_powerMode to be in a sane spot for the given power operation.
This way the state changes from sleep->awake before the registers are poked
and from awake->sleep after the registers are poked.
This way spurious warnings aren't printed by my (to be committed)
debugging code.
Tested:
* AR5416, STA
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ath/ath_hal/ar5416/ar5416_power.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_power.c b/sys/dev/ath/ath_hal/ar5416/ar5416_power.c index bbd9b4c..c70a8e7 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_power.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_power.c @@ -140,20 +140,22 @@ ar5416SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip) modes[ah->ah_powerMode], modes[mode], setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: + ah->ah_powerMode = mode; status = ar5416SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5416SetPowerModeSleep(ah, setChip); + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5416SetPowerModeNetworkSleep(ah, setChip); + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode 0x%x\n", __func__, mode); return AH_FALSE; } - ah->ah_powerMode = mode; return status; } |