From owner-svn-src-all@FreeBSD.ORG Wed Aug 3 13:39:11 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 D2EE31065670; Wed, 3 Aug 2011 13:39:11 +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 B7F0F8FC1F; Wed, 3 Aug 2011 13:39:11 +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 p73DdBnm015689; Wed, 3 Aug 2011 13:39:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p73DdBKr015685; Wed, 3 Aug 2011 13:39:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108031339.p73DdBKr015685@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 13:39:11 +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: r224634 - head/sys/dev/ath/ath_hal/ar9002 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: Wed, 03 Aug 2011 13:39:12 -0000 Author: adrian Date: Wed Aug 3 13:39:11 2011 New Revision: 224634 URL: http://svn.freebsd.org/changeset/base/224634 Log: Add in a dirty hack that allows for AR9280/AR9285/AR9287 embedded systems, in the same way that AR9130 embedded systems work. This isn't -everything- that is required - the PCI glue still needs to be taught about the eepromdata hint, along the same lines as the AHB glue. Approved by: re (kib, blanket) Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Wed Aug 3 13:36:14 2011 (r224633) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Wed Aug 3 13:39:11 2011 (r224634) @@ -28,6 +28,8 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" +#include "ar9001/ar9130_eeprom.h" + #include "ar9002/ar9280v1.ini" #include "ar9002/ar9280v2.ini" #include "ar9002/ar9280_olc.h" @@ -191,6 +193,12 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_rx_chainmask = AR9280_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR9280_DEFAULT_TXCHAINMASK; + if (eepromdata) { + AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead; + AH_PRIVATE((ah))->ah_eepromWrite = NULL; + ah->ah_eepromdata = eepromdata; + } + if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { /* reset chip */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't reset chip\n", Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Aug 3 13:36:14 2011 (r224633) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Aug 3 13:39:11 2011 (r224634) @@ -29,6 +29,8 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" +#include "ar9001/ar9130_eeprom.h" + #include "ar9002/ar9285.ini" #include "ar9002/ar9285v2.ini" #include "ar9002/ar9280v2.ini" /* XXX ini for tx/rx gain */ @@ -153,7 +155,13 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_writeIni = ar9285WriteIni; AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR9285_DEFAULT_TXCHAINMASK; - + + if (eepromdata) { + AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead; + AH_PRIVATE((ah))->ah_eepromWrite = NULL; + ah->ah_eepromdata = eepromdata; + } + ahp->ah_maxTxTrigLev = MAX_TX_FIFO_THRESHOLD >> 1; if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Aug 3 13:36:14 2011 (r224633) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Aug 3 13:39:11 2011 (r224634) @@ -30,6 +30,8 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" +#include "ar9001/ar9130_eeprom.h" + #include "ar9002/ar9287_cal.h" #include "ar9002/ar9287_reset.h" #include "ar9002/ar9287_olc.h" @@ -168,6 +170,12 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_rx_chainmask = AR9287_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR9287_DEFAULT_TXCHAINMASK; + if (eepromdata) { + AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead; + AH_PRIVATE((ah))->ah_eepromWrite = NULL; + ah->ah_eepromdata = eepromdata; + } + if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { /* reset chip */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't reset chip\n",