Lines Matching refs:rix

293 dot11rate(const HAL_RATE_TABLE *rt, int rix)  in dot11rate()  argument
295 if (rix < 0) in dot11rate()
297 return rt->info[rix].phy == IEEE80211_T_HT ? in dot11rate()
298 rt->info[rix].dot11Rate : (rt->info[rix].dot11Rate & IEEE80211_RATE_VAL) / 2; in dot11rate()
302 dot11rate_label(const HAL_RATE_TABLE *rt, int rix) in dot11rate_label() argument
304 if (rix < 0) in dot11rate_label()
306 return rt->info[rix].phy == IEEE80211_T_HT ? "MCS" : "Mb "; in dot11rate_label()
320 int rix, tt, pct; in pick_best_rate() local
325 for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { in pick_best_rate()
331 (rt->info[rix].phy != IEEE80211_T_HT)) { in pick_best_rate()
335 tt = sn->stats[size_bin][rix].average_tx_time; in pick_best_rate()
338 !sn->stats[size_bin][rix].packets_acked)) in pick_best_rate()
342 if (sn->stats[size_bin][rix].total_packets > 0) { in pick_best_rate()
343 pct = sn->stats[size_bin][rix].ewma_pct; in pick_best_rate()
349 if (sn->stats[size_bin][rix].successive_failures > 3) in pick_best_rate()
374 rt->info[rix].dot11Rate, in pick_best_rate()
375 sn->stats[size_bin][rix].total_packets, in pick_best_rate()
389 best_rate_rix = rix; in pick_best_rate()
402 best_rate_rix = rix; in pick_best_rate()
420 int current_rix, rix; in pick_sample_rate() local
433 rix = sn->last_sample_rix[size_bin]+1; /* next sample rate */ in pick_sample_rate()
436 if ((mask & ((uint64_t) 1<<rix)) == 0) { /* not a supported rate */ in pick_sample_rate()
438 if (++rix >= rt->rateCount) in pick_sample_rate()
439 rix = 0; in pick_sample_rate()
461 (rt->info[rix].phy != IEEE80211_T_HT)) { in pick_sample_rate()
462 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
468 if (sn->stats[size_bin][rix].perfect_tx_time > current_tt) { in pick_sample_rate()
469 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
474 if (sn->stats[size_bin][rix].successive_failures > ssc->max_successive_failures && in pick_sample_rate()
475 ticks - sn->stats[size_bin][rix].last_tx < ssc->stale_failure_timeout) { in pick_sample_rate()
476 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
495 rix_mcs = MCS(rix) & 0x7; in pick_sample_rate()
499 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
506 if (DOT11RATE(rix) > 2*11 && rix > current_rix + 2) { in pick_sample_rate()
507 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
512 sn->last_sample_rix[size_bin] = rix; in pick_sample_rate()
513 return rix; in pick_sample_rate()
577 int rix = -1; in ath_rate_pick_seed_rate_legacy() local
583 for (rix = rt->rateCount-1; rix > 0; rix--) { in ath_rate_pick_seed_rate_legacy()
584 if ((sn->ratemask & ((uint64_t) 1<<rix)) == 0) in ath_rate_pick_seed_rate_legacy()
588 if (rt->info[rix].phy == IEEE80211_T_HT) in ath_rate_pick_seed_rate_legacy()
595 if (DOT11RATE(rix) <= 72 && in ath_rate_pick_seed_rate_legacy()
596 sn->stats[size_bin][rix].successive_failures == 0) { in ath_rate_pick_seed_rate_legacy()
600 return rix; in ath_rate_pick_seed_rate_legacy()
618 int rix = -1, ht_rix = -1; in ath_rate_pick_seed_rate_ht() local
624 for (rix = rt->rateCount-1; rix > 0; rix--) { in ath_rate_pick_seed_rate_ht()
626 if ((sn->ratemask & ((uint64_t) 1<<rix)) == 0) in ath_rate_pick_seed_rate_ht()
630 if (rt->info[rix].phy == IEEE80211_T_HT) in ath_rate_pick_seed_rate_ht()
631 ht_rix = rix; in ath_rate_pick_seed_rate_ht()
634 if (rt->info[rix].phy != IEEE80211_T_HT) in ath_rate_pick_seed_rate_ht()
642 if (((MCS(rix)& 0x7f) <= 4) && in ath_rate_pick_seed_rate_ht()
643 sn->stats[size_bin][rix].successive_failures == 0) { in ath_rate_pick_seed_rate_ht()
652 return MAX(rix, ht_rix); in ath_rate_pick_seed_rate_ht()
672 int rix, mrr, best_rix, change_rates; in ath_rate_findrate() local
690 rix = 0; in ath_rate_findrate()
696 rix = sn->static_rix; in ath_rate_findrate()
750 rix = pick_sample_rate(ssc, an, rt, size_bin); in ath_rate_findrate()
757 dot11rate(rt, rix), in ath_rate_findrate()
758 dot11rate_label(rt, rix), in ath_rate_findrate()
761 if (rix != sn->current_rix[size_bin]) { in ath_rate_findrate()
762 sn->current_sample_rix[size_bin] = rix; in ath_rate_findrate()
861 rix = sn->current_rix[size_bin]; in ath_rate_findrate()
864 *try0 = mrr ? sn->sched[rix].t0 : ATH_TXMAXTRY; in ath_rate_findrate()
873 if (rix < 0 || rix >= rt->rateCount) { in ath_rate_findrate()
876 rix, in ath_rate_findrate()
878 rix = 0; /* XXX just default for now */ in ath_rate_findrate()
880 KASSERT(rix >= 0 && rix < rt->rateCount, ("rix is %d", rix)); in ath_rate_findrate()
882 *rix0 = rix; in ath_rate_findrate()
883 *txrate = rt->info[rix].rateCode in ath_rate_findrate()
884 | (shortPreamble ? rt->info[rix].shortPreamble : 0); in ath_rate_findrate()
908 rc[0].rix = sched->r0; in ath_rate_getxtxrates()
909 rc[1].rix = sched->r1; in ath_rate_getxtxrates()
910 rc[2].rix = sched->r2; in ath_rate_getxtxrates()
911 rc[3].rix = sched->r3; in ath_rate_getxtxrates()
926 struct ath_desc *ds, int shortPreamble, u_int8_t rix) in ath_rate_setupxtxdesc() argument
929 const struct txschedule *sched = &sn->sched[rix]; in ath_rate_setupxtxdesc()
1205 dot11rate(rt, rc[0].rix), in ath_rate_tx_complete()
1206 dot11rate_label(rt, rc[0].rix), rc[0].tries, in ath_rate_tx_complete()
1207 dot11rate(rt, rc[1].rix), in ath_rate_tx_complete()
1208 dot11rate_label(rt, rc[1].rix), rc[1].tries, in ath_rate_tx_complete()
1209 dot11rate(rt, rc[2].rix), in ath_rate_tx_complete()
1210 dot11rate_label(rt, rc[2].rix), rc[2].tries, in ath_rate_tx_complete()
1211 dot11rate(rt, rc[3].rix), in ath_rate_tx_complete()
1212 dot11rate_label(rt, rc[3].rix), rc[3].tries, in ath_rate_tx_complete()
1216 if (rc[i].tries && !IS_RATE_DEFINED(sn, rc[i].rix)) in ath_rate_tx_complete()
1228 rc[0].rix, rc[0].tries, in ath_rate_tx_complete()
1237 rc[1].rix, rc[1].tries, in ath_rate_tx_complete()
1246 rc[2].rix, rc[2].tries, in ath_rate_tx_complete()
1255 rc[3].rix, rc[3].tries, in ath_rate_tx_complete()
1302 int x, y, rix; in ath_rate_ctl_reset() local
1327 rix = sc->sc_rixmap[MCS(x)]; in ath_rate_ctl_reset()
1328 if (rix == 0xff) in ath_rate_ctl_reset()
1331 if (!rt->info[rix].valid) in ath_rate_ctl_reset()
1333 KASSERT(rix < SAMPLE_MAXRATES, in ath_rate_ctl_reset()
1334 ("mcs %u has rix %d", MCS(x), rix)); in ath_rate_ctl_reset()
1335 sn->ratemask |= (uint64_t) 1<<rix; in ath_rate_ctl_reset()
1341 rix = sc->sc_rixmap[RATE(x)]; in ath_rate_ctl_reset()
1342 if (rix == 0xff) in ath_rate_ctl_reset()
1345 if (!rt->info[rix].valid) in ath_rate_ctl_reset()
1347 KASSERT(rix < SAMPLE_MAXRATES, in ath_rate_ctl_reset()
1348 ("rate %u has rix %d", RATE(x), rix)); in ath_rate_ctl_reset()
1349 sn->ratemask |= (uint64_t) 1<<rix; in ath_rate_ctl_reset()
1357 for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { in ath_rate_ctl_reset()
1360 printf(" %d %s/%d", dot11rate(rt, rix), dot11rate_label(rt, rix), in ath_rate_ctl_reset()
1361 calc_usecs_unicast_packet(sc, 1600, rix, 0,0, in ath_rate_ctl_reset()
1381 for (rix = 0, mask = sn->ratemask; mask != 0; rix++, mask >>= 1) { in ath_rate_ctl_reset()
1384 sn->stats[y][rix].successive_failures = 0; in ath_rate_ctl_reset()
1385 sn->stats[y][rix].tries = 0; in ath_rate_ctl_reset()
1386 sn->stats[y][rix].total_packets = 0; in ath_rate_ctl_reset()
1387 sn->stats[y][rix].packets_acked = 0; in ath_rate_ctl_reset()
1388 sn->stats[y][rix].last_tx = 0; in ath_rate_ctl_reset()
1389 sn->stats[y][rix].ewma_pct = 0; in ath_rate_ctl_reset()
1391 sn->stats[y][rix].perfect_tx_time = in ath_rate_ctl_reset()
1392 calc_usecs_unicast_packet(sc, size, rix, 0, 0, in ath_rate_ctl_reset()
1394 sn->stats[y][rix].average_tx_time = in ath_rate_ctl_reset()
1395 sn->stats[y][rix].perfect_tx_time; in ath_rate_ctl_reset()
1522 int rix, y; in sample_stats() local
1546 for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { in sample_stats()
1550 if (sn->stats[y][rix].total_packets == 0) in sample_stats()
1553 dot11rate(rt, rix), dot11rate_label(rt, rix), in sample_stats()
1555 (uintmax_t) sn->stats[y][rix].total_packets, in sample_stats()
1556 (uintmax_t) sn->stats[y][rix].packets_acked, in sample_stats()
1557 (int) ((sn->stats[y][rix].packets_acked * 100ULL) / in sample_stats()
1558 sn->stats[y][rix].total_packets), in sample_stats()
1559 sn->stats[y][rix].ewma_pct / 10, in sample_stats()
1560 sn->stats[y][rix].ewma_pct % 10, in sample_stats()
1561 (uintmax_t) sn->stats[y][rix].tries, in sample_stats()
1562 sn->stats[y][rix].successive_failures, in sample_stats()
1563 sn->stats[y][rix].average_tx_time, in sample_stats()
1564 ticks - sn->stats[y][rix].last_tx); in sample_stats()