From owner-svn-src-all@FreeBSD.ORG Sat Dec 1 03:48:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1F1FDFF; Sat, 1 Dec 2012 03:48:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF198FC08; Sat, 1 Dec 2012 03:48:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB13mB7d017387; Sat, 1 Dec 2012 03:48:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB13mBpZ017385; Sat, 1 Dec 2012 03:48:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212010348.qB13mBpZ017385@svn.freebsd.org> From: Adrian Chadd Date: Sat, 1 Dec 2012 03:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243743 - in head/sys/dev/ath/ath_hal: . 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.14 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: Sat, 01 Dec 2012 03:48:12 -0000 Author: adrian Date: Sat Dec 1 03:48:11 2012 New Revision: 243743 URL: http://svnweb.freebsd.org/changeset/base/243743 Log: Add a new HAL capability - check and enforce whether the NIC supports enforcing the TXOP and TBTT limits: * Frames which will overlap with TBTT will not TX; * Frames which will exceed TXOP will be filtered. This is not enabled by default; it's intended to be enabled by the TDMA code on 802.11n capable chipsets. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Sat Dec 1 02:02:19 2012 (r243742) +++ head/sys/dev/ath/ath_hal/ah.h Sat Dec 1 03:48:11 2012 (r243743) @@ -192,6 +192,7 @@ typedef enum { HAL_CAP_LONG_RXDESC_TSF = 243, /* hardware supports 32bit TSF in RX descriptor */ HAL_CAP_BB_READ_WAR = 244, /* baseband read WAR */ HAL_CAP_SERIALISE_WAR = 245, /* serialise register access on PCI */ + HAL_CAP_ENFORCE_TXOP = 246, /* Enforce TXOP if supported */ } HAL_CAPABILITY_TYPE; /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Dec 1 02:02:19 2012 (r243742) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Dec 1 03:48:11 2012 (r243743) @@ -451,6 +451,10 @@ ar5416GetCapability(struct ath_hal *ah, HAL_OK : HAL_ENOTSUPP; case HAL_CAP_DIVERSITY: /* disable classic fast diversity */ return HAL_ENXIO; + case HAL_CAP_ENFORCE_TXOP: + (*result) = + !! (AH5212(ah)->ah_miscMode & AR_PCU_TXOP_TBTT_LIMIT_ENA); + return (HAL_OK); default: break; } @@ -480,6 +484,19 @@ ar5416SetCapability(struct ath_hal *ah, else pCap->halTxStreams = 1; return AH_TRUE; + case HAL_CAP_ENFORCE_TXOP: + if (setting) { + AH5212(ah)->ah_miscMode + |= AR_PCU_TXOP_TBTT_LIMIT_ENA; + OS_REG_SET_BIT(ah, AR_MISC_MODE, + AR_PCU_TXOP_TBTT_LIMIT_ENA); + } else { + AH5212(ah)->ah_miscMode + &= ~AR_PCU_TXOP_TBTT_LIMIT_ENA; + OS_REG_CLR_BIT(ah, AR_MISC_MODE, + AR_PCU_TXOP_TBTT_LIMIT_ENA); + } + return AH_TRUE; default: break; }