svn commit: r263417 - head/sys/dev/ath/ath_hal/ar5416

Adrian Chadd adrian at FreeBSD.org
Thu Mar 20 05:08:31 UTC 2014


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;
 }
 


More information about the svn-src-all mailing list