diff --git a/sys/dev/ath/ath_rate/sample/sample.c b/sys/dev/ath/ath_rate/sample/sample.c index 985551b316cf..9bc7fda3fe5e 100644 --- a/sys/dev/ath/ath_rate/sample/sample.c +++ b/sys/dev/ath/ath_rate/sample/sample.c @@ -164,7 +164,7 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TABLE *rt, { struct sample_node *sn = ATH_NODE_SAMPLE(an); int best_rate_rix, best_rate_tt, best_rate_pct; - uint32_t mask; + uint64_t mask; int rix, tt, pct; best_rate_rix = 0; @@ -251,7 +251,7 @@ pick_sample_rate(struct sample_softc *ssc , struct ath_node *an, struct sample_node *sn = ATH_NODE_SAMPLE(an); int current_rix, rix; unsigned current_tt; - uint32_t mask; + uint64_t mask; current_rix = sn->current_rix[size_bin]; if (current_rix < 0) { @@ -263,9 +263,9 @@ pick_sample_rate(struct sample_softc *ssc , struct ath_node *an, current_tt = sn->stats[size_bin][current_rix].average_tx_time; rix = sn->last_sample_rix[size_bin]+1; /* next sample rate */ - mask = sn->ratemask &~ (1<ratemask &~ ((uint64_t) 1<= rt->rateCount) rix = 0; @@ -275,20 +275,20 @@ pick_sample_rate(struct sample_softc *ssc , struct ath_node *an, /* if the node is HT and the rate isn't HT, don't bother sample */ if ((an->an_node.ni_flags & IEEE80211_NODE_HT) && (rt->info[rix].phy != IEEE80211_T_HT)) { - mask &= ~(1<stats[size_bin][rix].perfect_tx_time > current_tt) { - mask &= ~(1<stats[size_bin][rix].successive_failures > ssc->max_successive_failures && ticks - sn->stats[size_bin][rix].last_tx < ssc->stale_failure_timeout) { - mask &= ~(1<stats[size_bin][rix].average_tx_time * 10 > sn->stats[size_bin][current_rix].average_tx_time * 9) && (ticks - sn->stats[size_bin][rix].last_tx < ssc->stale_failure_timeout)) { - mask &= ~(1< 11M for non-HT rates */ if (! (an->an_node.ni_flags & IEEE80211_NODE_HT)) { if (DOT11RATE(rix) > 2*11 && rix > current_rix + 2) { - mask &= ~(1<rateCount-1; rix > 0; rix--) { - if ((sn->ratemask & (1<ratemask & ((uint64_t) 1<rateCount-1; rix > 0; rix--) { /* Skip rates we can't use */ - if ((sn->ratemask & (1<ratemask & ((uint64_t) 1<sched[rix0]; - KASSERT(rix0 == sched->r0, ("rix0 (%x) != sched->r0 (%x)!\n", rix0, sched->r0)); + KASSERT(rix0 == sched->r0, ("rix0 (%x) != sched->r0 (%x)!\n", + rix0, sched->r0)); rc[0].flags = rc[1].flags = rc[2].flags = rc[3].flags = 0; @@ -919,6 +920,8 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, if (!mrr || ts->ts_finaltsi == 0) { if (!IS_RATE_DEFINED(sn, final_rix)) { + device_printf(sc->sc_dev, "%s: ts_rate=%d ts_finaltsi=%d\n", + __func__, ts->ts_rate, ts->ts_finaltsi); badrate(ifp, 0, ts->ts_rate, long_tries, status); return; } @@ -1087,6 +1090,7 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni) KASSERT(sc->sc_curmode < IEEE80211_MODE_MAX+2, ("curmode %u", sc->sc_curmode)); + sn->sched = mrr_schedules[sc->sc_curmode]; KASSERT(sn->sched != NULL, ("no mrr schedule for mode %u", sc->sc_curmode)); @@ -1113,7 +1117,7 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni) continue; KASSERT(rix < SAMPLE_MAXRATES, ("mcs %u has rix %d", MCS(x), rix)); - sn->ratemask |= 1<ratemask |= (uint64_t) 1<ratemask |= 1<ratemask |= (uint64_t) 1<ni_vap, IEEE80211_MSG_RATECTL)) { - uint32_t mask; + uint64_t mask; ieee80211_note(ni->ni_vap, "[%6D] %s: size 1600 rate/tt", ni->ni_macaddr, ":", __func__); @@ -1147,7 +1151,7 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni) #endif for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { int size = bin_to_size(y); - uint32_t mask; + uint64_t mask; sn->packets_sent[y] = 0; sn->current_sample_rix[y] = -1; @@ -1289,10 +1293,10 @@ sample_stats(void *arg, struct ieee80211_node *ni) struct ath_softc *sc = arg; const HAL_RATE_TABLE *rt = sc->sc_currates; struct sample_node *sn = ATH_NODE_SAMPLE(ATH_NODE(ni)); - uint32_t mask; + uint64_t mask; int rix, y; - printf("\n[%s] refcnt %d static_rix (%d %s) ratemask 0x%x\n", + printf("\n[%s] refcnt %d static_rix (%d %s) ratemask 0x%qx\n", ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni), dot11rate(rt, sn->static_rix), dot11rate_label(rt, sn->static_rix), diff --git a/sys/dev/ath/ath_rate/sample/sample.h b/sys/dev/ath/ath_rate/sample/sample.h index b9e723083640..7438a3df0f42 100644 --- a/sys/dev/ath/ath_rate/sample/sample.h +++ b/sys/dev/ath/ath_rate/sample/sample.h @@ -91,7 +91,7 @@ bin_to_size(int index) struct sample_node { int static_rix; /* rate index of fixed tx rate */ #define SAMPLE_MAXRATES 64 /* NB: corresponds to hal info[32] */ - uint32_t ratemask; /* bit mask of valid rate indices */ + uint64_t ratemask; /* bit mask of valid rate indices */ const struct txschedule *sched; /* tx schedule table */ const HAL_RATE_TABLE *currates;