From owner-svn-src-all@FreeBSD.ORG Sun Apr 17 13:46:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 439C41065670; Sun, 17 Apr 2011 13:46:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30BB18FC13; Sun, 17 Apr 2011 13:46:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p3HDkEV2039599; Sun, 17 Apr 2011 13:46:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3HDkEhN039597; Sun, 17 Apr 2011 13:46:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201104171346.p3HDkEhN039597@svn.freebsd.org> From: Adrian Chadd Date: Sun, 17 Apr 2011 13:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220738 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 17 Apr 2011 13:46:14 -0000 Author: adrian Date: Sun Apr 17 13:46:13 2011 New Revision: 220738 URL: http://svn.freebsd.org/changeset/base/220738 Log: Mark the PHY as inactive before the chip is reset. It's also marked inactive by the initvals, and enabled after the baseband/PLL has been configured, but before the RF registers have been programmed. The origin and reason for this particular change is currently unknown. Obtained from: Linux ath9k Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Apr 17 11:35:22 2011 (r220737) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Apr 17 13:46:13 2011 (r220738) @@ -62,6 +62,7 @@ static HAL_BOOL ar5416SetPowerPerRateTab uint16_t twiceMaxRegulatoryPower, uint16_t powerLimit); static void ar5416Set11nRegs(struct ath_hal *ah, const struct ieee80211_channel *chan); +static void ar5416MarkPhyInactive(struct ath_hal *ah); /* * Places the device in and out of reset and then places sane @@ -148,6 +149,9 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO if (AR_SREV_MERLIN_20_OR_LATER(ah) && ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) tsf = ar5212GetTsf64(ah); + /* Mark PHY as inactive; marked active in ar5416InitBB() */ + ar5416MarkPhyInactive(ah); + if (!ar5416ChipReset(ah, chan)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: chip reset failed\n", __func__); FAIL(HAL_EIO); @@ -2493,3 +2497,8 @@ ar5416EepromSetAddac(struct ath_hal *ah, #undef XPA_LVL_FREQ } +static void +ar5416MarkPhyInactive(struct ath_hal *ah) +{ + OS_REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_DIS); +}