From c7f5bb7a4f6798cac045541bee18bda0263286a8 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sun, 15 Jul 2012 20:51:41 +0000 Subject: [PATCH] Handle RX Keymiss events. The AR9003 series NICs implement a separate RX error to signal that a Keycache miss occured. The earlier NICs would not set the key index valid bit. I'll dig into the difference between "no key index bit set" and "keycache miss". --- sys/dev/ath/if_ath_rx.c | 8 ++++++++ sys/dev/ath/if_ath_sysctl.c | 2 ++ sys/dev/ath/if_athioctl.h | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/dev/ath/if_ath_rx.c b/sys/dev/ath/if_ath_rx.c index eba6ba53960..9e90977b905 100644 --- a/sys/dev/ath/if_ath_rx.c +++ b/sys/dev/ath/if_ath_rx.c @@ -534,6 +534,14 @@ ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status *rs, HAL_STATUS status, goto rx_accept; sc->sc_stats.ast_rx_badcrypt++; } + /* + * Similar as above - if the failure was a keymiss + * just punt it up to the upper layers for now. + */ + if (rs->rs_status & HAL_RXERR_KEYMISS) { + sc->sc_stats.ast_rx_keymiss++; + goto rx_accept; + } if (rs->rs_status & HAL_RXERR_MIC) { sc->sc_stats.ast_rx_badmic++; /* diff --git a/sys/dev/ath/if_ath_sysctl.c b/sys/dev/ath/if_ath_sysctl.c index ff75888e047..e1e9426c8fa 100644 --- a/sys/dev/ath/if_ath_sysctl.c +++ b/sys/dev/ath/if_ath_sysctl.c @@ -934,6 +934,8 @@ ath_sysctl_stats_attach(struct ath_softc *sc) SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_mcastq_overflow", CTLFLAG_RD, &sc->sc_stats.ast_tx_mcastq_overflow, 0, "Number of multicast frames exceeding maximum mcast queue depth"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_keymiss", CTLFLAG_RD, + &sc->sc_stats.ast_rx_keymiss, 0, ""); /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); diff --git a/sys/dev/ath/if_athioctl.h b/sys/dev/ath/if_athioctl.h index 71813ae1835..f40e1be10ac 100644 --- a/sys/dev/ath/if_athioctl.h +++ b/sys/dev/ath/if_athioctl.h @@ -161,7 +161,9 @@ struct ath_stats { u_int32_t ast_tx_aggr_ok; /* aggregate TX ok */ u_int32_t ast_tx_aggr_fail; /* aggregate TX failed */ u_int32_t ast_tx_mcastq_overflow; /* multicast queue overflow */ - u_int32_t ast_pad[1]; + u_int32_t ast_rx_keymiss; + + u_int32_t ast_pad[16]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq)