summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-01-07 23:30:26 +0000
committersam <sam@FreeBSD.org>2009-01-07 23:30:26 +0000
commitcad660ade235e8e8c3c90d908248eb4de659c728 (patch)
tree3b8001f5dff20cb888e22fafbfc755ed4c3ab259
parent8c0b1641b61d59288ded5ee99fcc8ff038d9e59c (diff)
downloadFreeBSD-src-cad660ade235e8e8c3c90d908248eb4de659c728.zip
FreeBSD-src-cad660ade235e8e8c3c90d908248eb4de659c728.tar.gz
correct fixed rate handling; the rixmap was changed a while back
to be indexed by the ieee rate code
-rw-r--r--sys/dev/ath/ath_rate/sample/sample.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/sys/dev/ath/ath_rate/sample/sample.c b/sys/dev/ath/ath_rate/sample/sample.c
index 4bfd027..b51b45f 100644
--- a/sys/dev/ath/ath_rate/sample/sample.c
+++ b/sys/dev/ath/ath_rate/sample/sample.c
@@ -754,23 +754,18 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni)
sn->static_rix = -1;
if (tp != NULL && tp->ucastrate != IEEE80211_FIXED_RATE_NONE) {
/*
- * A fixed rate is to be used; ic_fixed_rate is the
- * IEEE code for this rate (sans basic bit). Convert this
- * to the index into the negotiated rate set for
- * the node.
+ * A fixed rate is to be used; ucastrate is the IEEE code
+ * for this rate (sans basic bit). Check this against the
+ * negotiated rate set for the node. Note the fixed rate
+ * may not be available for various reasons so we only
+ * setup the static rate index if the lookup is successful.
+ * XXX handle MCS
*/
- /* NB: the rate set is assumed sorted */
- srate = ni->ni_rates.rs_nrates - 1;
- for (; srate >= 0 && RATE(srate) != tp->ucastrate; srate--)
- ;
- /*
- * The fixed rate may not be available due to races
- * and mode settings. Also orphaned nodes created in
- * adhoc mode may not have any rate set so this lookup
- * can fail.
- */
- if (srate >= 0)
- sn->static_rix = sc->sc_rixmap[srate];
+ for (srate = ni->ni_rates.rs_nrates - 1; srate >= 0; srate--)
+ if (RATE(srate) == tp->ucastrate) {
+ sn->static_rix = sc->sc_rixmap[tp->ucastrate];
+ break;
+ }
}
/*
OpenPOWER on IntegriCloud