Author: adrian
Date: Thu Mar 20 05:08:31 2014
New Revision: 263417
URL: http://svnweb.freebsd.org/changeset/base/263417

Log:
  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

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c      Thu Mar 20 04:47:34 
2014        (r263416)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c      Thu Mar 20 05:08:31 
2014        (r263417)
@@ -140,20 +140,22 @@ ar5416SetPowerMode(struct ath_hal *ah, H
            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;
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to