Lines Matching refs:rix
295 dot11rate(const HAL_RATE_TABLE *rt, int rix) in dot11rate() argument
297 if (rix < 0) in dot11rate()
299 return rt->info[rix].phy == IEEE80211_T_HT ? in dot11rate()
300 rt->info[rix].dot11Rate : (rt->info[rix].dot11Rate & IEEE80211_RATE_VAL) / 2; in dot11rate()
304 dot11rate_label(const HAL_RATE_TABLE *rt, int rix) in dot11rate_label() argument
306 if (rix < 0) in dot11rate_label()
308 return rt->info[rix].phy == IEEE80211_T_HT ? "MCS" : "Mb "; in dot11rate_label()
322 int rix, tt, pct; in pick_best_rate() local
327 for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { in pick_best_rate()
333 (rt->info[rix].phy != IEEE80211_T_HT)) { in pick_best_rate()
337 tt = sn->stats[size_bin][rix].average_tx_time; in pick_best_rate()
340 !sn->stats[size_bin][rix].packets_acked)) in pick_best_rate()
344 if (sn->stats[size_bin][rix].total_packets > 0) { in pick_best_rate()
345 pct = sn->stats[size_bin][rix].ewma_pct; in pick_best_rate()
351 if (sn->stats[size_bin][rix].successive_failures > 3) in pick_best_rate()
376 rt->info[rix].dot11Rate, in pick_best_rate()
377 sn->stats[size_bin][rix].total_packets, in pick_best_rate()
391 best_rate_rix = rix; in pick_best_rate()
404 best_rate_rix = rix; in pick_best_rate()
422 int current_rix, rix; in pick_sample_rate() local
435 rix = sn->last_sample_rix[size_bin]+1; /* next sample rate */ in pick_sample_rate()
438 if ((mask & ((uint64_t) 1<<rix)) == 0) { /* not a supported rate */ in pick_sample_rate()
440 if (++rix >= rt->rateCount) in pick_sample_rate()
441 rix = 0; in pick_sample_rate()
463 (rt->info[rix].phy != IEEE80211_T_HT)) { in pick_sample_rate()
464 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
470 if (sn->stats[size_bin][rix].perfect_tx_time > current_tt) { in pick_sample_rate()
471 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
476 if (sn->stats[size_bin][rix].successive_failures > ssc->max_successive_failures && in pick_sample_rate()
477 ticks - sn->stats[size_bin][rix].last_tx < ssc->stale_failure_timeout) { in pick_sample_rate()
478 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
497 rix_mcs = MCS(rix) & 0x7; in pick_sample_rate()
501 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
508 if (DOT11RATE(rix) > 2*11 && rix > current_rix + 2) { in pick_sample_rate()
509 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
514 sn->last_sample_rix[size_bin] = rix; in pick_sample_rate()
515 return rix; in pick_sample_rate()
579 int rix = -1; in ath_rate_pick_seed_rate_legacy() local
585 for (rix = rt->rateCount-1; rix > 0; rix--) { in ath_rate_pick_seed_rate_legacy()
586 if ((sn->ratemask & ((uint64_t) 1<<rix)) == 0) in ath_rate_pick_seed_rate_legacy()
590 if (rt->info[rix].phy == IEEE80211_T_HT) in ath_rate_pick_seed_rate_legacy()
597 if (DOT11RATE(rix) <= 72 && in ath_rate_pick_seed_rate_legacy()
598 sn->stats[size_bin][rix].successive_failures == 0) { in ath_rate_pick_seed_rate_legacy()
602 return rix; in ath_rate_pick_seed_rate_legacy()
620 int rix = -1, ht_rix = -1; in ath_rate_pick_seed_rate_ht() local
626 for (rix = rt->rateCount-1; rix > 0; rix--) { in ath_rate_pick_seed_rate_ht()
628 if ((sn->ratemask & ((uint64_t) 1<<rix)) == 0) in ath_rate_pick_seed_rate_ht()
632 if (rt->info[rix].phy == IEEE80211_T_HT) in ath_rate_pick_seed_rate_ht()
633 ht_rix = rix; in ath_rate_pick_seed_rate_ht()
636 if (rt->info[rix].phy != IEEE80211_T_HT) in ath_rate_pick_seed_rate_ht()
644 if (((MCS(rix)& 0x7f) <= 4) && in ath_rate_pick_seed_rate_ht()
645 sn->stats[size_bin][rix].successive_failures == 0) { in ath_rate_pick_seed_rate_ht()
654 return MAX(rix, ht_rix); in ath_rate_pick_seed_rate_ht()
674 int rix, mrr, best_rix, change_rates; in ath_rate_findrate() local
692 rix = 0; in ath_rate_findrate()
698 rix = sn->static_rix; in ath_rate_findrate()
752 rix = pick_sample_rate(ssc, an, rt, size_bin); in ath_rate_findrate()
759 dot11rate(rt, rix), in ath_rate_findrate()
760 dot11rate_label(rt, rix), in ath_rate_findrate()
763 if (rix != sn->current_rix[size_bin]) { in ath_rate_findrate()
764 sn->current_sample_rix[size_bin] = rix; in ath_rate_findrate()
863 rix = sn->current_rix[size_bin]; in ath_rate_findrate()
866 *try0 = mrr ? sn->sched[rix].t0 : ATH_TXMAXTRY; in ath_rate_findrate()
875 if (rix < 0 || rix >= rt->rateCount) { in ath_rate_findrate()
878 rix, in ath_rate_findrate()
880 rix = 0; /* XXX just default for now */ in ath_rate_findrate()
882 KASSERT(rix >= 0 && rix < rt->rateCount, ("rix is %d", rix)); in ath_rate_findrate()
884 *rix0 = rix; in ath_rate_findrate()
885 *txrate = rt->info[rix].rateCode in ath_rate_findrate()
886 | (shortPreamble ? rt->info[rix].shortPreamble : 0); in ath_rate_findrate()
910 rc[0].rix = sched->r0; in ath_rate_getxtxrates()
911 rc[1].rix = sched->r1; in ath_rate_getxtxrates()
912 rc[2].rix = sched->r2; in ath_rate_getxtxrates()
913 rc[3].rix = sched->r3; in ath_rate_getxtxrates()
928 struct ath_desc *ds, int shortPreamble, u_int8_t rix) in ath_rate_setupxtxdesc() argument
931 const struct txschedule *sched = &sn->sched[rix]; in ath_rate_setupxtxdesc()
1207 dot11rate(rt, rc[0].rix), in ath_rate_tx_complete()
1208 dot11rate_label(rt, rc[0].rix), rc[0].tries, in ath_rate_tx_complete()
1209 dot11rate(rt, rc[1].rix), in ath_rate_tx_complete()
1210 dot11rate_label(rt, rc[1].rix), rc[1].tries, in ath_rate_tx_complete()
1211 dot11rate(rt, rc[2].rix), in ath_rate_tx_complete()
1212 dot11rate_label(rt, rc[2].rix), rc[2].tries, in ath_rate_tx_complete()
1213 dot11rate(rt, rc[3].rix), in ath_rate_tx_complete()
1214 dot11rate_label(rt, rc[3].rix), rc[3].tries, in ath_rate_tx_complete()
1218 if (rc[i].tries && !IS_RATE_DEFINED(sn, rc[i].rix)) in ath_rate_tx_complete()
1230 rc[0].rix, rc[0].tries, in ath_rate_tx_complete()
1239 rc[1].rix, rc[1].tries, in ath_rate_tx_complete()
1248 rc[2].rix, rc[2].tries, in ath_rate_tx_complete()
1257 rc[3].rix, rc[3].tries, in ath_rate_tx_complete()
1304 int x, y, rix; in ath_rate_ctl_reset() local
1329 rix = sc->sc_rixmap[MCS(x)]; in ath_rate_ctl_reset()
1330 if (rix == 0xff) in ath_rate_ctl_reset()
1333 if (!rt->info[rix].valid) in ath_rate_ctl_reset()
1335 KASSERT(rix < SAMPLE_MAXRATES, in ath_rate_ctl_reset()
1336 ("mcs %u has rix %d", MCS(x), rix)); in ath_rate_ctl_reset()
1337 sn->ratemask |= (uint64_t) 1<<rix; in ath_rate_ctl_reset()
1343 rix = sc->sc_rixmap[RATE(x)]; in ath_rate_ctl_reset()
1344 if (rix == 0xff) in ath_rate_ctl_reset()
1347 if (!rt->info[rix].valid) in ath_rate_ctl_reset()
1349 KASSERT(rix < SAMPLE_MAXRATES, in ath_rate_ctl_reset()
1350 ("rate %u has rix %d", RATE(x), rix)); in ath_rate_ctl_reset()
1351 sn->ratemask |= (uint64_t) 1<<rix; in ath_rate_ctl_reset()
1359 for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { in ath_rate_ctl_reset()
1362 printf(" %d %s/%d", dot11rate(rt, rix), dot11rate_label(rt, rix), in ath_rate_ctl_reset()
1363 calc_usecs_unicast_packet(sc, 1600, rix, 0,0, in ath_rate_ctl_reset()
1383 for (rix = 0, mask = sn->ratemask; mask != 0; rix++, mask >>= 1) { in ath_rate_ctl_reset()
1386 sn->stats[y][rix].successive_failures = 0; in ath_rate_ctl_reset()
1387 sn->stats[y][rix].tries = 0; in ath_rate_ctl_reset()
1388 sn->stats[y][rix].total_packets = 0; in ath_rate_ctl_reset()
1389 sn->stats[y][rix].packets_acked = 0; in ath_rate_ctl_reset()
1390 sn->stats[y][rix].last_tx = 0; in ath_rate_ctl_reset()
1391 sn->stats[y][rix].ewma_pct = 0; in ath_rate_ctl_reset()
1393 sn->stats[y][rix].perfect_tx_time = in ath_rate_ctl_reset()
1394 calc_usecs_unicast_packet(sc, size, rix, 0, 0, in ath_rate_ctl_reset()
1396 sn->stats[y][rix].average_tx_time = in ath_rate_ctl_reset()
1397 sn->stats[y][rix].perfect_tx_time; in ath_rate_ctl_reset()
1514 int rix, y; in sample_stats() local
1538 for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { in sample_stats()
1542 if (sn->stats[y][rix].total_packets == 0) in sample_stats()
1545 dot11rate(rt, rix), dot11rate_label(rt, rix), in sample_stats()
1547 (uintmax_t) sn->stats[y][rix].total_packets, in sample_stats()
1548 (uintmax_t) sn->stats[y][rix].packets_acked, in sample_stats()
1549 (int) ((sn->stats[y][rix].packets_acked * 100ULL) / in sample_stats()
1550 sn->stats[y][rix].total_packets), in sample_stats()
1551 sn->stats[y][rix].ewma_pct / 10, in sample_stats()
1552 sn->stats[y][rix].ewma_pct % 10, in sample_stats()
1553 (uintmax_t) sn->stats[y][rix].tries, in sample_stats()
1554 sn->stats[y][rix].successive_failures, in sample_stats()
1555 sn->stats[y][rix].average_tx_time, in sample_stats()
1556 ticks - sn->stats[y][rix].last_tx); in sample_stats()