From owner-svn-src-all@FreeBSD.ORG Wed May 8 01:11:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 211C6B14; Wed, 8 May 2013 01:11:27 +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 135E0BF7; Wed, 8 May 2013 01:11:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r481BQni060853; Wed, 8 May 2013 01:11:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r481BPRn060841; Wed, 8 May 2013 01:11:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305080111.r481BPRn060841@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 May 2013 01:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250346 - in head/sys/dev/ath: . ath_hal 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: Wed, 08 May 2013 01:11:27 -0000 Author: adrian Date: Wed May 8 01:11:25 2013 New Revision: 250346 URL: http://svnweb.freebsd.org/changeset/base/250346 Log: Implement STBC receive frame statistics. The AR9280 and later can receive STBC. This adds some statistics tracking to count these frames. A patch to athstats will be forthcoming. Modified: head/sys/dev/ath/ath_hal/ah_desc.h head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c head/sys/dev/ath/ath_hal/ar5416/ar5416desc.h head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/ath_hal/ah_desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_desc.h Wed May 8 01:03:41 2013 (r250345) +++ head/sys/dev/ath/ath_hal/ah_desc.h Wed May 8 01:11:25 2013 (r250346) @@ -155,6 +155,7 @@ struct ath_rx_status { #define HAL_RX_DECRYPT_BUSY 0x0040 /* decrypt was too slow */ #define HAL_RX_HI_RX_CHAIN 0x0080 /* SM power save: hi Rx chain control */ #define HAL_RX_IS_APSD 0x0100 /* Is ASPD trigger frame */ +#define HAL_RX_STBC 0x0200 /* Is an STBC frame */ enum { HAL_PHYERR_UNDERRUN = 0, /* Transmit underrun */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Wed May 8 01:03:41 2013 (r250345) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Wed May 8 01:11:25 2013 (r250346) @@ -209,6 +209,14 @@ ar5416ProcRxDesc(struct ath_hal *ah, str if (ads->ds_rxstatus3 & AR_2040) rs->rs_flags |= HAL_RX_2040; + /* + * Only the AR9280 and later chips support STBC RX, so + * ensure we only set this bit for those chips. + */ + if (AR_SREV_MERLIN_10_OR_LATER(ah) + && ads->ds_rxstatus3 & AR_STBCFrame) + rs->rs_flags |= HAL_RX_STBC; + if (ads->ds_rxstatus8 & AR_PreDelimCRCErr) rs->rs_flags |= HAL_RX_DELIM_CRC_PRE; if (ads->ds_rxstatus8 & AR_PostDelimCRCErr) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416desc.h Wed May 8 01:03:41 2013 (r250345) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416desc.h Wed May 8 01:11:25 2013 (r250346) @@ -357,6 +357,7 @@ struct ar5416_desc { #define AR_RxStatusRsvd30 0xfffff800 /* Owl 2.x only */ #define AR_DupFrame 0x00000004 +#define AR_STBCFrame 0x00000008 #define AR_RxAntenna 0xffffff00 #define AR_RxAntenna_S 8 Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Wed May 8 01:03:41 2013 (r250345) +++ head/sys/dev/ath/if_ath_rx.c Wed May 8 01:11:25 2013 (r250346) @@ -545,6 +545,8 @@ ath_rx_pkt(struct ath_softc *sc, struct sc->sc_stats.ast_rx_decrypt_busy_err++; if (rs->rs_flags & HAL_RX_HI_RX_CHAIN) sc->sc_stats.ast_rx_hi_rx_chain++; + if (rs->rs_flags & HAL_RX_STBC) + sc->sc_stats.ast_rx_stbc++; #endif /* AH_SUPPORT_AR5416 */ if (rs->rs_status != 0) { Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Wed May 8 01:03:41 2013 (r250345) +++ head/sys/dev/ath/if_ath_sysctl.c Wed May 8 01:11:25 2013 (r250346) @@ -1076,6 +1076,9 @@ ath_sysctl_stats_attach(struct ath_softc &sc->sc_stats.ast_rx_keymiss, 0, ""); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_swfiltered", CTLFLAG_RD, &sc->sc_stats.ast_tx_swfiltered, 0, ""); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_stbc", + CTLFLAG_RD, &sc->sc_stats.ast_rx_stbc, 0, + "Number of STBC frames received"); /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Wed May 8 01:03:41 2013 (r250345) +++ head/sys/dev/ath/if_athioctl.h Wed May 8 01:11:25 2013 (r250346) @@ -163,9 +163,9 @@ struct ath_stats { u_int32_t ast_tx_mcastq_overflow; /* multicast queue overflow */ u_int32_t ast_rx_keymiss; u_int32_t ast_tx_swfiltered; + u_int32_t ast_rx_stbc; /* RX STBC frame */ u_int32_t ast_tx_nodeq_overflow; /* node sw queue overflow */ - - u_int32_t ast_pad[14]; + u_int32_t ast_pad[13]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq)