From owner-svn-src-head@FreeBSD.ORG Tue Jan 31 22:31:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A84BC106566B; Tue, 31 Jan 2012 22:31:17 +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 7C6AA8FC16; Tue, 31 Jan 2012 22:31:17 +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 q0VMVHn1057882; Tue, 31 Jan 2012 22:31:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VMVHY1057879; Tue, 31 Jan 2012 22:31:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201312231.q0VMVHY1057879@svn.freebsd.org> From: Adrian Chadd Date: Tue, 31 Jan 2012 22:31:17 +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: r230847 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 22:31:17 -0000 Author: adrian Date: Tue Jan 31 22:31:16 2012 New Revision: 230847 URL: http://svn.freebsd.org/changeset/base/230847 Log: Support AR9281/AR5B91 - a 1x2 stream device based on the AR9280. * Override the TX/RX stream count if the EEPROM reports a single RX or TX stream, rather than assuming the device will always be a 2x2 strea device. * For AR9280 devices, don't hard-code 2x2 stream. Instead, allow the ar5416FillCapabilityInfo() routine to correctly determine things. The latter should be done for all 11n chips now that ar5416FillCapabilityInfo() will set the TX/RX stream count based on the active TX/RX chainmask in the EEPROM. Thanks to Maciej Milewski for donating some AR9281 NICs to me for testing. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Jan 31 22:27:35 2012 (r230846) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Jan 31 22:31:16 2012 (r230847) @@ -884,6 +884,15 @@ ar5416FillCapabilityInfo(struct ath_hal /* AR5416 may have 3 antennas but is a 2x2 stream device */ pCap->halTxStreams = 2; pCap->halRxStreams = 2; + /* + * If the TX or RX chainmask has less than 2 chains active, + * mark it as a 1-stream device for the relevant stream. + */ + if (owl_get_ntxchains(pCap->halTxChainMask) == 1) + pCap->halTxStreams = 1; + /* XXX Eww */ + if (owl_get_ntxchains(pCap->halRxChainMask) == 1) + pCap->halRxStreams = 1; pCap->halRtsAggrLimit = 8*1024; /* Owl 2.0 limit */ pCap->halMbssidAggrSupport = AH_FALSE; /* Broken on Owl */ pCap->halForcePpmSupport = AH_TRUE; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Jan 31 22:27:35 2012 (r230846) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Jan 31 22:31:16 2012 (r230847) @@ -822,10 +822,6 @@ ar9280FillCapabilityInfo(struct ath_hal #if 0 pCap->halWowMatchPatternDword = AH_TRUE; #endif - /* AR9280 is a 2x2 stream device */ - pCap->halTxStreams = 2; - pCap->halRxStreams = 2; - pCap->halCSTSupport = AH_TRUE; pCap->halRifsRxSupport = AH_TRUE; pCap->halRifsTxSupport = AH_TRUE;