From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 00:30:44 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 4EAC71065672; Sun, 6 Mar 2011 00:30:44 +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 3D00E8FC13; Sun, 6 Mar 2011 00:30:44 +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 p260Ui48080938; Sun, 6 Mar 2011 00:30:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p260Uifd080935; Sun, 6 Mar 2011 00:30:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103060030.p260Uifd080935@svn.freebsd.org> From: Adrian Chadd Date: Sun, 6 Mar 2011 00:30:44 +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: r219318 - head/sys/dev/ath/ath_hal 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, 06 Mar 2011 00:30:44 -0000 Author: adrian Date: Sun Mar 6 00:30:43 2011 New Revision: 219318 URL: http://svn.freebsd.org/changeset/base/219318 Log: Add an EEPROM op that extracts out the power table offset. It defaults to -5 dBm for eeproms earlier than v21. This apparently only applies to Merlin (AR9280) or later, earlier 11n chipsets have a power table offset of 0. All the code in ath9k which checks the power table offset and takes it into account first ensures the chip is Merlin or later. Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom.h Sat Mar 5 22:31:03 2011 (r219317) +++ head/sys/dev/ath/ath_hal/ah_eeprom.h Sun Mar 6 00:30:43 2011 (r219318) @@ -100,6 +100,7 @@ enum { AR_EEP_ANTGAINMAX_5, /* int8_t* */ AR_EEP_ANTGAINMAX_2, /* int8_t* */ AR_EEP_WRITEPROTECT, /* use ath_hal_eepromGetFlag */ + AR_EEP_PWR_TABLE_OFFSET /* int8_t* */ }; typedef struct { Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Sat Mar 5 22:31:03 2011 (r219317) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Sun Mar 6 00:30:43 2011 (r219318) @@ -126,6 +126,13 @@ v14EepromGet(struct ath_hal *ah, int par case AR_EEP_ANTGAINMAX_5: *(int8_t *) val = ee->ee_antennaGainMax[0]; return HAL_OK; + case AR_EEP_PWR_TABLE_OFFSET: + if (IS_VERS(>=, AR5416_EEP_MINOR_VER_21)) + *(int8_t *) val = pBase->pwr_table_offset; + else + *(int8_t *) val = AR5416_PWR_TABLE_OFFSET_DB; + return HAL_OK; + default: HALASSERT(0); return HAL_EINVAL;