The attached trivial patch attempts to correct a problem whereby minstrel
authornbd <nbd@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Sat, 22 Dec 2007 16:14:21 +0000 (16:14 +0000)
committernbd <nbd@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Sat, 22 Dec 2007 16:14:21 +0000 (16:14 +0000)
does not increment rs_rateattempts for successfully sent packets, and
therefore the rate adaptation does not take place.

Signed-off-by: Brian Candler <B.Candler@pobox.com>
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3070 0192ed92-7a03-0410-a25b-9323aeb14dbd

ath_rate/minstrel/minstrel.c

index f52e1dfd3e796a7e4f2956d67261dc9e60669ce2..3cb508e02dd38e7d52007fe6a05821f7d4c4aa22 100644 (file)
@@ -446,7 +446,6 @@ ath_rate_tx_complete(struct ath_softc *sc,
                const struct ath_desc *ds = &bf->bf_desc[0];
                int final_rate = 0;
                int tries = 0;
-               int ndx = -1;
                int mrr;
                int final_ndx;
                int rate0, tries0, ndx0;
@@ -485,8 +484,8 @@ ath_rate_tx_complete(struct ath_softc *sc,
                mrr = sc->sc_mrretry && !(ic->ic_flags & IEEE80211_F_USEPROT) && ENABLE_MRR;
 
                if (!mrr) {
-                       if ((0 <= ndx) && (ndx < sn->num_rates)) {
-                               sn->rs_rateattempts[ndx]++; /* only one rate was used */
+                       if ((0 <= final_ndx) && (final_ndx < sn->num_rates)) {
+                               sn->rs_rateattempts[final_ndx] += tries; /* only one rate was used */
                        }
                        return;
                }