From owner-svn-src-all@FreeBSD.ORG Sun Apr 24 15:53:57 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 C3AAF106564A; Sun, 24 Apr 2011 15:53:57 +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 A7B148FC19; Sun, 24 Apr 2011 15:53:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3OFrv4t037801; Sun, 24 Apr 2011 15:53:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3OFrvIi037797; Sun, 24 Apr 2011 15:53:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201104241553.p3OFrvIi037797@svn.freebsd.org> From: Adrian Chadd Date: Sun, 24 Apr 2011 15:53:57 +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: r220990 - 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, 24 Apr 2011 15:53:58 -0000 Author: adrian Date: Sun Apr 24 15:53:57 2011 New Revision: 220990 URL: http://svn.freebsd.org/changeset/base/220990 Log: Break out the PLL setup into an overridable method. The only method right now is ar5416InitPLL() which handles multiple chipsets; this can now be overridden by newer chipset HAL code. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Apr 24 15:48:07 2011 (r220989) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Apr 24 15:53:57 2011 (r220990) @@ -103,6 +103,10 @@ struct ath_hal_5416 { const struct ieee80211_channel *chan, int16_t *pTxPowerIndexOffset); + /* baseband operations */ + void (*ah_initPLL) (struct ath_hal *ah, + const struct ieee80211_channel *chan); + u_int ah_globaltxtimeout; /* global tx timeout */ u_int ah_gpioMask; int ah_hangs; /* h/w hangs state */ @@ -248,6 +252,8 @@ extern void ar5416EepromSetAddac(struct const struct ieee80211_channel *chan); extern uint16_t ar5416GetMaxEdgePower(uint16_t freq, CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz); +extern void ar5416InitPLL(struct ath_hal *ah, + const struct ieee80211_channel *chan); /* TX power setup related routines in ar5416_reset.c */ extern void ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sun Apr 24 15:48:07 2011 (r220989) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sun Apr 24 15:53:57 2011 (r220990) @@ -181,6 +181,9 @@ ar5416InitState(struct ath_hal_5416 *ahp AH5416(ah)->ah_writeIni = ar5416WriteIni; AH5416(ah)->ah_spurMitigate = ar5416SpurMitigate; + /* Internal baseband ops */ + AH5416(ah)->ah_initPLL = ar5416InitPLL; + /* Internal calibration ops */ AH5416(ah)->ah_cal_initcal = ar5416InitCalHardware; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Apr 24 15:48:07 2011 (r220989) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Apr 24 15:53:57 2011 (r220990) @@ -54,7 +54,6 @@ static void ar5416SetDeltaSlope(struct a static HAL_BOOL ar5416SetResetPowerOn(struct ath_hal *ah); static HAL_BOOL ar5416SetReset(struct ath_hal *ah, int type); -static void ar5416InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan); static HAL_BOOL ar5416SetPowerPerRateTable(struct ath_hal *ah, struct ar5416eeprom *pEepData, const struct ieee80211_channel *chan, int16_t *ratesArray, @@ -513,7 +512,7 @@ ar5416InitBB(struct ath_hal *ah, const s /* Turn on PLL on 5416 */ HALDEBUG(ah, HAL_DEBUG_RESET, "%s %s channel\n", __func__, IEEE80211_IS_CHAN_5GHZ(chan) ? "5GHz" : "2GHz"); - ar5416InitPLL(ah, chan); + AH5416(ah)->ah_initPLL(ah, chan); /* Activate the PHY (includes baseband activate and synthesizer on) */ OS_REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN); @@ -655,7 +654,7 @@ ar5416ChipReset(struct ath_hal *ah, cons if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) return AH_FALSE; - ar5416InitPLL(ah, chan); + AH5416(ah)->ah_initPLL(ah, chan); /* * Perform warm reset before the mode/PLL/turbo registers @@ -1221,7 +1220,7 @@ ar5416SetReset(struct ath_hal *ah, int t OS_REG_WRITE(ah, AR_CFG, INIT_CONFIG_STATUS); } - ar5416InitPLL(ah, AH_NULL); + AH5416(ah)->ah_initPLL(ah, AH_NULL); return AH_TRUE; } @@ -1278,7 +1277,7 @@ ar5416UpdateChainMasks(struct ath_hal *a #define IS_5GHZ_FAST_CLOCK_EN(ah, chan) AH_FALSE #endif -static void +void ar5416InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan) { uint32_t pll;