From owner-svn-src-all@FreeBSD.ORG Wed Apr 30 02:03:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93AEC9D8; Wed, 30 Apr 2014 02:03:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7415015A8; Wed, 30 Apr 2014 02:03:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U23ERs063554; Wed, 30 Apr 2014 02:03:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U23DNk063550; Wed, 30 Apr 2014 02:03:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404300203.s3U23DNk063550@svn.freebsd.org> From: Adrian Chadd Date: Wed, 30 Apr 2014 02:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265112 - in head/sys/dev/ath/ath_hal: ar5210 ar5211 ar5212 ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 02:03:14 -0000 Author: adrian Date: Wed Apr 30 02:03:13 2014 New Revision: 265112 URL: http://svnweb.freebsd.org/changeset/base/265112 Log: * Only update ah_powerMode if we're setting the chip sleep state. Some code will appear soon that is actually setting the chip powerstate separate from the self-generated frames power state. * Allow the AR5416 family chips to actually have the power state changed from the self generated state change. Tested (STA mode): * AR5210 * AR5211 * AR5412 * AR5413 * AR5416 * AR9285 Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Tue Apr 29 23:29:28 2014 (r265111) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Wed Apr 30 02:03:13 2014 (r265112) @@ -108,16 +108,19 @@ ar5210SetPowerMode(struct ath_hal *ah, H setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; status = ar5210SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5210SetPowerModeSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5210SetPowerModeAuto(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode %u\n", Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Tue Apr 29 23:29:28 2014 (r265111) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Wed Apr 30 02:03:13 2014 (r265112) @@ -110,16 +110,19 @@ ar5211SetPowerMode(struct ath_hal *ah, H setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; status = ar5211SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5211SetPowerModeSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5211SetPowerModeNetworkSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode %u\n", Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c Tue Apr 29 23:29:28 2014 (r265111) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c Wed Apr 30 02:03:13 2014 (r265112) @@ -134,16 +134,19 @@ ar5212SetPowerMode(struct ath_hal *ah, H setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; status = ar5212SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5212SetPowerModeSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5212SetPowerModeNetworkSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode %u\n", Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Tue Apr 29 23:29:28 2014 (r265111) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Wed Apr 30 02:03:13 2014 (r265112) @@ -133,23 +133,29 @@ ar5416SetPowerMode(struct ath_hal *ah, H }; #endif int status = AH_TRUE; + +#if 0 if (!setChip) return AH_TRUE; +#endif HALDEBUG(ah, HAL_DEBUG_POWER, "%s: %s -> %s (%s)\n", __func__, modes[ah->ah_powerMode], modes[mode], setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; status = ar5416SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5416SetPowerModeSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5416SetPowerModeNetworkSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode 0x%x\n",