summaryrefslogtreecommitdiff
path: root/sys/dev/ic/acx.c
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2006-08-21 09:39:38 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2006-08-21 09:39:38 +0000
commit894c3b6b2e1c7043f92e847b2e28ea9b2d8c99be (patch)
treec7f507a18c0b370b05873497364a8cea746b45e4 /sys/dev/ic/acx.c
parentd2bc11fa4e1465a4d6300fac5279c53ef27ae8d3 (diff)
Add missing amrr statistic updates. Makes rate control work proper.
Pointed out by damien@. ok damien@
Diffstat (limited to 'sys/dev/ic/acx.c')
-rw-r--r--sys/dev/ic/acx.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/dev/ic/acx.c b/sys/dev/ic/acx.c
index 71eba6bb7ad..de95a8ec027 100644
--- a/sys/dev/ic/acx.c
+++ b/sys/dev/ic/acx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acx.c,v 1.48 2006/08/20 00:33:59 mglocker Exp $ */
+/* $OpenBSD: acx.c,v 1.49 2006/08/21 09:39:37 mglocker Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -899,6 +899,7 @@ acx_start(struct ifnet *ifp)
* bit-rate.
*/
rate = ni->ni_rates.rs_rates[0];
+ rate &= IEEE80211_RATE_VAL;
} else if (!IFQ_IS_EMPTY(&ifp->if_snd)) {
struct ether_header *eh;
@@ -1123,12 +1124,25 @@ acx_txeof(struct acx_softc *sc)
} else
ifp->if_opackets++;
+ /* Update rate control statistics for the node */
if (buf->tb_node != NULL) {
struct ieee80211com *ic;
struct ieee80211_node *ni;
+ struct acx_node *wn;
+ int ntries;
ic = &sc->sc_ic;
ni = (struct ieee80211_node *)buf->tb_node;
+ wn = (struct acx_node *)ni;
+ ntries = FW_TXDESC_GETFIELD_1(sc, buf, f_tx_rts_fail) +
+ FW_TXDESC_GETFIELD_1(sc, buf, f_tx_ack_fail);
+
+ wn->amn.amn_txcnt++;
+ if (ntries > 0) {
+ DPRINTF(("%s: tx intr ntries %d\n",
+ sc->sc_dev.dv_xname, ntries));
+ wn->amn.amn_retrycnt++;
+ }
ieee80211_release_node(ic, ni);
buf->tb_node = NULL;