From owner-svn-src-all@FreeBSD.ORG Tue Feb 1 03:51:35 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 9A34F106566B; Tue, 1 Feb 2011 03:51:35 +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 877408FC18; Tue, 1 Feb 2011 03:51:35 +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 p113pZWT056403; Tue, 1 Feb 2011 03:51:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p113pZ1v056395; Tue, 1 Feb 2011 03:51:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102010351.p113pZ1v056395@svn.freebsd.org> From: Adrian Chadd Date: Tue, 1 Feb 2011 03:51:35 +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: r218150 - in head/sys/dev/ath/ath_hal: . ar5416 ar9001 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: Tue, 01 Feb 2011 03:51:35 -0000 Author: adrian Date: Tue Feb 1 03:51:35 2011 New Revision: 218150 URL: http://svn.freebsd.org/changeset/base/218150 Log: Add a new capability which reports the number of spatial streams a device supports. The higher levels (net80211, if_ath, ath_rate) need this to make correct choices about what MCS capabilities to advertise and what MCS rates are able to be TXed. In summary: * AR5416 - 2/3 antennas, 2x2 streams * AR9160 - 2/3 antennas, 2x2 streams * AR9220 - 2 antennas, 2x2 sstraems * AR9280 - 2 antennas, 2x2 streams * AR9285 - 2 antennas but with antenna diversity, 1x1 stream Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Tue Feb 1 01:05:11 2011 (r218149) +++ head/sys/dev/ath/ath_hal/ah.c Tue Feb 1 03:51:35 2011 (r218150) @@ -583,6 +583,17 @@ ath_hal_getcapability(struct ath_hal *ah return HAL_OK; case HAL_CAP_BSSIDMATCH: /* hardware has disable bssid match */ return pCap->halBssidMatchSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_STREAMS: /* number of 11n spatial streams */ + switch (capability) { + case 0: /* TX */ + *result = pCap->halTxStreams; + return HAL_OK; + case 1: /* RX */ + *result = pCap->halRxStreams; + return HAL_OK; + default: + return HAL_ENOTSUPP; + } default: return HAL_EINVAL; } Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue Feb 1 01:05:11 2011 (r218149) +++ head/sys/dev/ath/ath_hal/ah.h Tue Feb 1 03:51:35 2011 (r218150) @@ -111,6 +111,7 @@ typedef enum { HAL_CAP_MAC_HANG = 36, /* can MAC hang */ HAL_CAP_INTRMASK = 37, /* bitmask of supported interrupts */ HAL_CAP_BSSIDMATCH = 38, /* hardware has disable bssid match */ + HAL_CAP_STREAMS = 39, /* how many 802.11n spatial streams are available */ } HAL_CAPABILITY_TYPE; /* Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Tue Feb 1 01:05:11 2011 (r218149) +++ head/sys/dev/ath/ath_hal/ah_internal.h Tue Feb 1 03:51:35 2011 (r218150) @@ -209,6 +209,8 @@ typedef struct { uint8_t halNumAntCfg2GHz; uint8_t halNumAntCfg5GHz; uint32_t halIntrMask; + uint8_t halTxStreams; + uint8_t halRxStreams; } HAL_CAPABILITIES; struct regDomain; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Feb 1 01:05:11 2011 (r218149) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Feb 1 03:51:35 2011 (r218150) @@ -819,6 +819,9 @@ ar5416FillCapabilityInfo(struct ath_hal pCap->halTxChainMask = ath_hal_eepromGet(ah, AR_EEP_TXMASK, AH_NULL); /* XXX CB71 uses GPIO 0 to indicate 3 rx chains */ pCap->halRxChainMask = ath_hal_eepromGet(ah, AR_EEP_RXMASK, AH_NULL); + /* AR5416 may have 3 antennas but is a 2x2 stream device */ + pCap->halTxStreams = 2; + pCap->halRxStreams = 2; pCap->halRtsAggrLimit = 8*1024; /* Owl 2.0 limit */ pCap->halMbssidAggrSupport = AH_TRUE; pCap->halForcePpmSupport = AH_TRUE; Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Tue Feb 1 01:05:11 2011 (r218149) +++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Tue Feb 1 03:51:35 2011 (r218150) @@ -290,6 +290,10 @@ ar9160FillCapabilityInfo(struct ath_hal pCap->halRtsAggrLimit = 64*1024; /* 802.11n max */ pCap->halExtChanDfsSupport = AH_TRUE; pCap->halAutoSleepSupport = AH_FALSE; /* XXX? */ + /* AR9160 is a 2x2 stream device */ + pCap->halTxStreams = 2; + pCap->halRxStreams = 2; + return AH_TRUE; } Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Feb 1 01:05:11 2011 (r218149) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Feb 1 03:51:35 2011 (r218150) @@ -684,6 +684,10 @@ 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; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Tue Feb 1 01:05:11 2011 (r218149) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Tue Feb 1 03:51:35 2011 (r218150) @@ -370,6 +370,10 @@ ar9285FillCapabilityInfo(struct ath_hal #if 0 pCap->halWowMatchPatternDword = AH_TRUE; #endif + /* AR9285 has 2 antennas but is a 1x1 stream device */ + pCap->halTxStreams = 2; + pCap->halRxStreams = 2; + pCap->halCSTSupport = AH_TRUE; pCap->halRifsRxSupport = AH_TRUE; pCap->halRifsTxSupport = AH_TRUE;