From owner-svn-src-all@FreeBSD.ORG  Wed Feb 20 12:14:50 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id C32C5FD5;
 Wed, 20 Feb 2013 12:14:50 +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 B5C64CEC;
 Wed, 20 Feb 2013 12:14:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KCEopI064407;
 Wed, 20 Feb 2013 12:14:50 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KCEowf064406;
 Wed, 20 Feb 2013 12:14:50 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201302201214.r1KCEowf064406@svn.freebsd.org>
From: Adrian Chadd <adrian@FreeBSD.org>
Date: Wed, 20 Feb 2013 12:14:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r247033 - 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 &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Feb 2013 12:14:50 -0000

Author: adrian
Date: Wed Feb 20 12:14:49 2013
New Revision: 247033
URL: http://svnweb.freebsd.org/changeset/base/247033

Log:
  Configure larger TX FIFO default and maximum level values.
  
  This has reduced the number of TX delimiter and data underruns when
  doing large UDP transfers (>100mbit).
  
  This stops any HAL_INT_TXURN interrupts from occuring, which is a good
  sign!
  
  Obtained from:	Qualcomm Atheros

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Wed Feb 20 12:06:33 2013	(r247032)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Wed Feb 20 12:14:49 2013	(r247033)
@@ -241,8 +241,24 @@ ar5416InitState(struct ath_hal_5416 *ahp
 	/* Enable all ANI functions to begin with */
 	AH5416(ah)->ah_ani_function = 0xffffffff;
 
-        /* Set overridable ANI methods */
-        AH5212(ah)->ah_aniControl = ar5416AniControl;
+	/* Set overridable ANI methods */
+	AH5212(ah)->ah_aniControl = ar5416AniControl;
+
+	/* Default FIFO Trigger levels */
+#define	AR_FTRIG_512B	0x00000080 // 5 bits total
+	/* AR9285/AR9271 need to use half the TX FIFOs */
+	if (AR_SREV_KITE(ah) || AR_SREV_9271(ah)) {
+		AH5212(ah)->ah_txTrigLev = (AR_FTRIG_256B >> AR_FTRIG_S);
+		AH5212(ah)->ah_maxTxTrigLev = ((2048 / 64) - 1);
+	} else {
+		AH5212(ah)->ah_txTrigLev = (AR_FTRIG_512B >> AR_FTRIG_S);
+		AH5212(ah)->ah_maxTxTrigLev = ((4096 / 64) - 1);
+	}
+	ath_hal_printf(ah, "%s: trigLev=%d, maxTxTrigLev=%d\n",
+	    __func__,
+	    AH5212(ah)->ah_txTrigLev,
+	    AH5212(ah)->ah_maxTxTrigLev);
+#undef	AR_FTRIG_512B
 }
 
 uint32_t