Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Mar 2014 05:08:31 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263417 - head/sys/dev/ath/ath_hal/ar5416
Message-ID:  <201403200508.s2K58V6g035355@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403200508.s2K58V6g035355>