svn commit: r249992 - in user/adrian/net80211_tx/sys/dev/ath: . ath_hal ath_hal/ar5416
Adrian Chadd
adrian at FreeBSD.org
Sat Apr 27 18:34:53 UTC 2013
Author: adrian
Date: Sat Apr 27 18:34:51 2013
New Revision: 249992
URL: http://svnweb.freebsd.org/changeset/base/249992
Log:
Add in support to log received STBC packets.
Thanks to Oleksij Rempel <linux at rempel-privat.de> for discovering that
the AR9271 actually tags STBC RX frames with a bit in the RX descriptor
status field.
I've verified (for values of "read in some internal documentation") that
starting with the AR9280, all the 11n chips tag these RXed frames.
Modified:
user/adrian/net80211_tx/sys/dev/ath/ath_hal/ah_desc.h
user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c
user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416desc.h
user/adrian/net80211_tx/sys/dev/ath/if_ath_rx.c
user/adrian/net80211_tx/sys/dev/ath/if_ath_sysctl.c
user/adrian/net80211_tx/sys/dev/ath/if_athioctl.h
Modified: user/adrian/net80211_tx/sys/dev/ath/ath_hal/ah_desc.h
==============================================================================
--- user/adrian/net80211_tx/sys/dev/ath/ath_hal/ah_desc.h Sat Apr 27 17:51:09 2013 (r249991)
+++ user/adrian/net80211_tx/sys/dev/ath/ath_hal/ah_desc.h Sat Apr 27 18:34:51 2013 (r249992)
@@ -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: user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c
==============================================================================
--- user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Sat Apr 27 17:51:09 2013 (r249991)
+++ user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Sat Apr 27 18:34:51 2013 (r249992)
@@ -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: user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416desc.h
==============================================================================
--- user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416desc.h Sat Apr 27 17:51:09 2013 (r249991)
+++ user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416desc.h Sat Apr 27 18:34:51 2013 (r249992)
@@ -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: user/adrian/net80211_tx/sys/dev/ath/if_ath_rx.c
==============================================================================
--- user/adrian/net80211_tx/sys/dev/ath/if_ath_rx.c Sat Apr 27 17:51:09 2013 (r249991)
+++ user/adrian/net80211_tx/sys/dev/ath/if_ath_rx.c Sat Apr 27 18:34:51 2013 (r249992)
@@ -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: user/adrian/net80211_tx/sys/dev/ath/if_ath_sysctl.c
==============================================================================
--- user/adrian/net80211_tx/sys/dev/ath/if_ath_sysctl.c Sat Apr 27 17:51:09 2013 (r249991)
+++ user/adrian/net80211_tx/sys/dev/ath/if_ath_sysctl.c Sat Apr 27 18:34:51 2013 (r249992)
@@ -1081,6 +1081,9 @@ ath_sysctl_stats_attach(struct ath_softc
SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_node_psq_overflow",
CTLFLAG_RD, &sc->sc_stats.ast_tx_node_psq_overflow, 0,
"Number of frames dropped because the node was in powersave");
+ 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: user/adrian/net80211_tx/sys/dev/ath/if_athioctl.h
==============================================================================
--- user/adrian/net80211_tx/sys/dev/ath/if_athioctl.h Sat Apr 27 17:51:09 2013 (r249991)
+++ user/adrian/net80211_tx/sys/dev/ath/if_athioctl.h Sat Apr 27 18:34:51 2013 (r249992)
@@ -164,7 +164,8 @@ struct ath_stats {
u_int32_t ast_rx_keymiss;
u_int32_t ast_tx_swfiltered;
u_int32_t ast_tx_node_psq_overflow;
- u_int32_t ast_pad[14];
+ u_int32_t ast_rx_stbc; /* RX STBC frame */
+ u_int32_t ast_pad[13];
};
#define SIOCGATHSTATS _IOWR('i', 137, struct ifreq)
More information about the svn-src-user
mailing list