Lines Matching refs:rix
145 dot11rate(const HAL_RATE_TABLE *rt, int rix) in dot11rate() argument
147 if (rix < 0) in dot11rate()
149 return rt->info[rix].phy == IEEE80211_T_HT ? in dot11rate()
150 rt->info[rix].dot11Rate : (rt->info[rix].dot11Rate & IEEE80211_RATE_VAL) / 2; in dot11rate()
154 dot11rate_label(const HAL_RATE_TABLE *rt, int rix) in dot11rate_label() argument
156 if (rix < 0) in dot11rate_label()
158 return rt->info[rix].phy == IEEE80211_T_HT ? "MCS" : "Mb "; in dot11rate_label()
172 int rix, tt, pct; in pick_best_rate() local
177 for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { in pick_best_rate()
183 (rt->info[rix].phy != IEEE80211_T_HT)) { in pick_best_rate()
187 tt = sn->stats[size_bin][rix].average_tx_time; in pick_best_rate()
190 !sn->stats[size_bin][rix].packets_acked)) in pick_best_rate()
194 if (sn->stats[size_bin][rix].total_packets > 0) { in pick_best_rate()
195 pct = sn->stats[size_bin][rix].ewma_pct; in pick_best_rate()
202 if (sn->stats[size_bin][rix].successive_failures > 3) in pick_best_rate()
225 best_rate_rix = rix; in pick_best_rate()
238 best_rate_rix = rix; in pick_best_rate()
256 int current_rix, rix; in pick_sample_rate() local
269 rix = sn->last_sample_rix[size_bin]+1; /* next sample rate */ in pick_sample_rate()
272 if ((mask & ((uint64_t) 1<<rix)) == 0) { /* not a supported rate */ in pick_sample_rate()
274 if (++rix >= rt->rateCount) in pick_sample_rate()
275 rix = 0; in pick_sample_rate()
297 (rt->info[rix].phy != IEEE80211_T_HT)) { in pick_sample_rate()
298 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
304 if (sn->stats[size_bin][rix].perfect_tx_time > current_tt) { in pick_sample_rate()
305 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
310 if (sn->stats[size_bin][rix].successive_failures > ssc->max_successive_failures && in pick_sample_rate()
311 ticks - sn->stats[size_bin][rix].last_tx < ssc->stale_failure_timeout) { in pick_sample_rate()
312 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
321 if (rix < (current_rix - 3) || in pick_sample_rate()
322 rix > (current_rix + 3)) { in pick_sample_rate()
323 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
330 if (DOT11RATE(rix) > 2*11 && rix > current_rix + 2) { in pick_sample_rate()
331 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
336 sn->last_sample_rix[size_bin] = rix; in pick_sample_rate()
337 return rix; in pick_sample_rate()
401 int rix = -1; in ath_rate_pick_seed_rate_legacy() local
407 for (rix = rt->rateCount-1; rix > 0; rix--) { in ath_rate_pick_seed_rate_legacy()
408 if ((sn->ratemask & ((uint64_t) 1<<rix)) == 0) in ath_rate_pick_seed_rate_legacy()
412 if (rt->info[rix].phy == IEEE80211_T_HT) in ath_rate_pick_seed_rate_legacy()
419 if (DOT11RATE(rix) <= 72 && in ath_rate_pick_seed_rate_legacy()
420 sn->stats[size_bin][rix].successive_failures == 0) { in ath_rate_pick_seed_rate_legacy()
424 return rix; in ath_rate_pick_seed_rate_legacy()
442 int rix = -1, ht_rix = -1; in ath_rate_pick_seed_rate_ht() local
448 for (rix = rt->rateCount-1; rix > 0; rix--) { in ath_rate_pick_seed_rate_ht()
450 if ((sn->ratemask & ((uint64_t) 1<<rix)) == 0) in ath_rate_pick_seed_rate_ht()
454 if (rt->info[rix].phy == IEEE80211_T_HT) in ath_rate_pick_seed_rate_ht()
455 ht_rix = rix; in ath_rate_pick_seed_rate_ht()
458 if (rt->info[rix].phy != IEEE80211_T_HT) in ath_rate_pick_seed_rate_ht()
466 if (((MCS(rix) & 0x7) <= 4) && in ath_rate_pick_seed_rate_ht()
467 sn->stats[size_bin][rix].successive_failures == 0) { in ath_rate_pick_seed_rate_ht()
476 return MAX(rix, ht_rix); in ath_rate_pick_seed_rate_ht()
496 int rix, mrr, best_rix, change_rates; in ath_rate_findrate() local
504 rix = 0; in ath_rate_findrate()
510 rix = sn->static_rix; in ath_rate_findrate()
531 rix = pick_sample_rate(ssc, an, rt, size_bin); in ath_rate_findrate()
537 dot11rate(rt, rix), in ath_rate_findrate()
538 dot11rate_label(rt, rix), in ath_rate_findrate()
541 if (rix != sn->current_rix[size_bin]) { in ath_rate_findrate()
542 sn->current_sample_rix[size_bin] = rix; in ath_rate_findrate()
632 rix = sn->current_rix[size_bin]; in ath_rate_findrate()
635 *try0 = mrr ? sn->sched[rix].t0 : ATH_TXMAXTRY; in ath_rate_findrate()
644 if (rix < 0 || rix >= rt->rateCount) { in ath_rate_findrate()
647 rix, in ath_rate_findrate()
649 rix = 0; /* XXX just default for now */ in ath_rate_findrate()
651 KASSERT(rix >= 0 && rix < rt->rateCount, ("rix is %d", rix)); in ath_rate_findrate()
653 *rix0 = rix; in ath_rate_findrate()
654 *txrate = rt->info[rix].rateCode in ath_rate_findrate()
655 | (shortPreamble ? rt->info[rix].shortPreamble : 0); in ath_rate_findrate()
678 rc[0].rix = sched->r0; in ath_rate_getxtxrates()
679 rc[1].rix = sched->r1; in ath_rate_getxtxrates()
680 rc[2].rix = sched->r2; in ath_rate_getxtxrates()
681 rc[3].rix = sched->r3; in ath_rate_getxtxrates()
691 struct ath_desc *ds, int shortPreamble, u_int8_t rix) in ath_rate_setupxtxdesc() argument
694 const struct txschedule *sched = &sn->sched[rix]; in ath_rate_setupxtxdesc()
943 dot11rate(rt, rc[0].rix), in ath_rate_tx_complete()
944 dot11rate_label(rt, rc[0].rix), rc[0].tries, in ath_rate_tx_complete()
945 dot11rate(rt, rc[1].rix), in ath_rate_tx_complete()
946 dot11rate_label(rt, rc[1].rix), rc[1].tries, in ath_rate_tx_complete()
947 dot11rate(rt, rc[2].rix), in ath_rate_tx_complete()
948 dot11rate_label(rt, rc[2].rix), rc[2].tries, in ath_rate_tx_complete()
949 dot11rate(rt, rc[3].rix), in ath_rate_tx_complete()
950 dot11rate_label(rt, rc[3].rix), rc[3].tries, in ath_rate_tx_complete()
954 if (rc[i].tries && !IS_RATE_DEFINED(sn, rc[i].rix)) in ath_rate_tx_complete()
968 rc[0].rix, rc[0].tries, in ath_rate_tx_complete()
969 rc[1].rix, rc[1].tries, in ath_rate_tx_complete()
970 rc[2].rix, rc[2].tries, in ath_rate_tx_complete()
971 rc[3].rix, rc[3].tries, in ath_rate_tx_complete()
980 rc[1].rix, rc[1].tries, in ath_rate_tx_complete()
981 rc[2].rix, rc[2].tries, in ath_rate_tx_complete()
982 rc[3].rix, rc[3].tries, in ath_rate_tx_complete()
992 rc[2].rix, rc[2].tries, in ath_rate_tx_complete()
993 rc[3].rix, rc[3].tries, in ath_rate_tx_complete()
1004 rc[3].rix, rc[3].tries, in ath_rate_tx_complete()
1049 int x, y, rix; in ath_rate_ctl_reset() local
1074 rix = sc->sc_rixmap[MCS(x)]; in ath_rate_ctl_reset()
1075 if (rix == 0xff) in ath_rate_ctl_reset()
1078 if (!rt->info[rix].valid) in ath_rate_ctl_reset()
1080 KASSERT(rix < SAMPLE_MAXRATES, in ath_rate_ctl_reset()
1081 ("mcs %u has rix %d", MCS(x), rix)); in ath_rate_ctl_reset()
1082 sn->ratemask |= (uint64_t) 1<<rix; in ath_rate_ctl_reset()
1088 rix = sc->sc_rixmap[RATE(x)]; in ath_rate_ctl_reset()
1089 if (rix == 0xff) in ath_rate_ctl_reset()
1092 if (!rt->info[rix].valid) in ath_rate_ctl_reset()
1094 KASSERT(rix < SAMPLE_MAXRATES, in ath_rate_ctl_reset()
1095 ("rate %u has rix %d", RATE(x), rix)); in ath_rate_ctl_reset()
1096 sn->ratemask |= (uint64_t) 1<<rix; in ath_rate_ctl_reset()
1104 for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { in ath_rate_ctl_reset()
1107 printf(" %d %s/%d", dot11rate(rt, rix), dot11rate_label(rt, rix), in ath_rate_ctl_reset()
1108 calc_usecs_unicast_packet(sc, 1600, rix, 0,0, in ath_rate_ctl_reset()
1128 for (rix = 0, mask = sn->ratemask; mask != 0; rix++, mask >>= 1) { in ath_rate_ctl_reset()
1131 sn->stats[y][rix].successive_failures = 0; in ath_rate_ctl_reset()
1132 sn->stats[y][rix].tries = 0; in ath_rate_ctl_reset()
1133 sn->stats[y][rix].total_packets = 0; in ath_rate_ctl_reset()
1134 sn->stats[y][rix].packets_acked = 0; in ath_rate_ctl_reset()
1135 sn->stats[y][rix].last_tx = 0; in ath_rate_ctl_reset()
1136 sn->stats[y][rix].ewma_pct = 0; in ath_rate_ctl_reset()
1138 sn->stats[y][rix].perfect_tx_time = in ath_rate_ctl_reset()
1139 calc_usecs_unicast_packet(sc, size, rix, 0, 0, in ath_rate_ctl_reset()
1141 sn->stats[y][rix].average_tx_time = in ath_rate_ctl_reset()
1142 sn->stats[y][rix].perfect_tx_time; in ath_rate_ctl_reset()
1259 int rix, y; in sample_stats() local
1283 for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { in sample_stats()
1287 if (sn->stats[y][rix].total_packets == 0) in sample_stats()
1290 dot11rate(rt, rix), dot11rate_label(rt, rix), in sample_stats()
1292 (uintmax_t) sn->stats[y][rix].total_packets, in sample_stats()
1293 (uintmax_t) sn->stats[y][rix].packets_acked, in sample_stats()
1294 (int) ((sn->stats[y][rix].packets_acked * 100ULL) / in sample_stats()
1295 sn->stats[y][rix].total_packets), in sample_stats()
1296 sn->stats[y][rix].ewma_pct / 10, in sample_stats()
1297 sn->stats[y][rix].ewma_pct % 10, in sample_stats()
1298 (uintmax_t) sn->stats[y][rix].tries, in sample_stats()
1299 sn->stats[y][rix].successive_failures, in sample_stats()
1300 sn->stats[y][rix].average_tx_time, in sample_stats()
1301 ticks - sn->stats[y][rix].last_tx); in sample_stats()