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()
403 best_rate_rix = rix; in pick_best_rate()
421 int current_rix, rix; in pick_sample_rate() local
434 rix = sn->last_sample_rix[size_bin]+1; /* next sample rate */ in pick_sample_rate()
437 if ((mask & ((uint64_t) 1<<rix)) == 0) { /* not a supported rate */ in pick_sample_rate()
439 if (++rix >= rt->rateCount) in pick_sample_rate()
440 rix = 0; in pick_sample_rate()
462 (rt->info[rix].phy != IEEE80211_T_HT)) { in pick_sample_rate()
463 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
469 if (sn->stats[size_bin][rix].perfect_tx_time > current_tt) { in pick_sample_rate()
470 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
475 if (sn->stats[size_bin][rix].successive_failures > ssc->max_successive_failures && in pick_sample_rate()
476 ticks - sn->stats[size_bin][rix].last_tx < ssc->stale_failure_timeout) { in pick_sample_rate()
477 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
496 rix_mcs = MCS(rix) & 0x7; in pick_sample_rate()
500 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
507 if (DOT11RATE(rix) > 2*11 && rix > current_rix + 2) { in pick_sample_rate()
508 mask &= ~((uint64_t) 1<<rix); in pick_sample_rate()
513 sn->last_sample_rix[size_bin] = rix; in pick_sample_rate()
514 return rix; in pick_sample_rate()
578 int rix = -1; in ath_rate_pick_seed_rate_legacy() local
584 for (rix = rt->rateCount-1; rix > 0; rix--) { in ath_rate_pick_seed_rate_legacy()
585 if ((sn->ratemask & ((uint64_t) 1<<rix)) == 0) in ath_rate_pick_seed_rate_legacy()
589 if (rt->info[rix].phy == IEEE80211_T_HT) in ath_rate_pick_seed_rate_legacy()
596 if (DOT11RATE(rix) <= 72 && in ath_rate_pick_seed_rate_legacy()
597 sn->stats[size_bin][rix].successive_failures == 0) { in ath_rate_pick_seed_rate_legacy()
601 return rix; in ath_rate_pick_seed_rate_legacy()
619 int rix = -1, ht_rix = -1; in ath_rate_pick_seed_rate_ht() local
625 for (rix = rt->rateCount-1; rix > 0; rix--) { in ath_rate_pick_seed_rate_ht()
627 if ((sn->ratemask & ((uint64_t) 1<<rix)) == 0) in ath_rate_pick_seed_rate_ht()
631 if (rt->info[rix].phy == IEEE80211_T_HT) in ath_rate_pick_seed_rate_ht()
632 ht_rix = rix; in ath_rate_pick_seed_rate_ht()
635 if (rt->info[rix].phy != IEEE80211_T_HT) in ath_rate_pick_seed_rate_ht()
643 if (((MCS(rix)& 0x7f) <= 4) && in ath_rate_pick_seed_rate_ht()
644 sn->stats[size_bin][rix].successive_failures == 0) { in ath_rate_pick_seed_rate_ht()
653 return MAX(rix, ht_rix); in ath_rate_pick_seed_rate_ht()
673 int rix, mrr, best_rix, change_rates; in ath_rate_findrate() local
691 rix = 0; in ath_rate_findrate()
697 rix = sn->static_rix; in ath_rate_findrate()
751 rix = pick_sample_rate(ssc, an, rt, size_bin); in ath_rate_findrate()
758 dot11rate(rt, rix), in ath_rate_findrate()
759 dot11rate_label(rt, rix), in ath_rate_findrate()
762 if (rix != sn->current_rix[size_bin]) { in ath_rate_findrate()
763 sn->current_sample_rix[size_bin] = rix; in ath_rate_findrate()
867 rix = sn->current_rix[size_bin]; in ath_rate_findrate()
870 *try0 = mrr ? sn->sched[rix].t0 : ATH_TXMAXTRY; in ath_rate_findrate()
879 if (rix < 0 || rix >= rt->rateCount) { in ath_rate_findrate()
882 rix, in ath_rate_findrate()
884 rix = 0; /* XXX just default for now */ in ath_rate_findrate()
886 KASSERT(rix >= 0 && rix < rt->rateCount, ("rix is %d", rix)); in ath_rate_findrate()
888 *rix0 = rix; in ath_rate_findrate()
889 *txrate = rt->info[rix].rateCode in ath_rate_findrate()
890 | (shortPreamble ? rt->info[rix].shortPreamble : 0); in ath_rate_findrate()
914 rc[0].rix = sched->r0; in ath_rate_getxtxrates()
915 rc[1].rix = sched->r1; in ath_rate_getxtxrates()
916 rc[2].rix = sched->r2; in ath_rate_getxtxrates()
917 rc[3].rix = sched->r3; in ath_rate_getxtxrates()
932 struct ath_desc *ds, int shortPreamble, u_int8_t rix) in ath_rate_setupxtxdesc() argument
935 const struct txschedule *sched = &sn->sched[rix]; in ath_rate_setupxtxdesc()
1211 dot11rate(rt, rc[0].rix), in ath_rate_tx_complete()
1212 dot11rate_label(rt, rc[0].rix), rc[0].tries, in ath_rate_tx_complete()
1213 dot11rate(rt, rc[1].rix), in ath_rate_tx_complete()
1214 dot11rate_label(rt, rc[1].rix), rc[1].tries, in ath_rate_tx_complete()
1215 dot11rate(rt, rc[2].rix), in ath_rate_tx_complete()
1216 dot11rate_label(rt, rc[2].rix), rc[2].tries, in ath_rate_tx_complete()
1217 dot11rate(rt, rc[3].rix), in ath_rate_tx_complete()
1218 dot11rate_label(rt, rc[3].rix), rc[3].tries, in ath_rate_tx_complete()
1222 if (rc[i].tries && !IS_RATE_DEFINED(sn, rc[i].rix)) in ath_rate_tx_complete()
1234 rc[0].rix, rc[0].tries, in ath_rate_tx_complete()
1243 rc[1].rix, rc[1].tries, in ath_rate_tx_complete()
1252 rc[2].rix, rc[2].tries, in ath_rate_tx_complete()
1261 rc[3].rix, rc[3].tries, in ath_rate_tx_complete()
1308 int x, y, rix; in ath_rate_ctl_reset() local
1333 rix = sc->sc_rixmap[MCS(x)]; in ath_rate_ctl_reset()
1334 if (rix == 0xff) in ath_rate_ctl_reset()
1337 if (!rt->info[rix].valid) in ath_rate_ctl_reset()
1339 KASSERT(rix < SAMPLE_MAXRATES, in ath_rate_ctl_reset()
1340 ("mcs %u has rix %d", MCS(x), rix)); in ath_rate_ctl_reset()
1341 sn->ratemask |= (uint64_t) 1<<rix; in ath_rate_ctl_reset()
1347 rix = sc->sc_rixmap[RATE(x)]; in ath_rate_ctl_reset()
1348 if (rix == 0xff) in ath_rate_ctl_reset()
1351 if (!rt->info[rix].valid) in ath_rate_ctl_reset()
1353 KASSERT(rix < SAMPLE_MAXRATES, in ath_rate_ctl_reset()
1354 ("rate %u has rix %d", RATE(x), rix)); in ath_rate_ctl_reset()
1355 sn->ratemask |= (uint64_t) 1<<rix; in ath_rate_ctl_reset()
1363 for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { in ath_rate_ctl_reset()
1366 printf(" %d %s/%d", dot11rate(rt, rix), dot11rate_label(rt, rix), in ath_rate_ctl_reset()
1367 calc_usecs_unicast_packet(sc, 1600, rix, 0,0, in ath_rate_ctl_reset()
1387 for (rix = 0, mask = sn->ratemask; mask != 0; rix++, mask >>= 1) { in ath_rate_ctl_reset()
1390 sn->stats[y][rix].successive_failures = 0; in ath_rate_ctl_reset()
1391 sn->stats[y][rix].tries = 0; in ath_rate_ctl_reset()
1392 sn->stats[y][rix].total_packets = 0; in ath_rate_ctl_reset()
1393 sn->stats[y][rix].packets_acked = 0; in ath_rate_ctl_reset()
1394 sn->stats[y][rix].last_tx = 0; in ath_rate_ctl_reset()
1395 sn->stats[y][rix].ewma_pct = 0; in ath_rate_ctl_reset()
1397 sn->stats[y][rix].perfect_tx_time = in ath_rate_ctl_reset()
1398 calc_usecs_unicast_packet(sc, size, rix, 0, 0, in ath_rate_ctl_reset()
1400 sn->stats[y][rix].average_tx_time = in ath_rate_ctl_reset()
1401 sn->stats[y][rix].perfect_tx_time; in ath_rate_ctl_reset()
1529 int rix, y; in sample_stats() local
1553 for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { in sample_stats()
1557 if (sn->stats[y][rix].total_packets == 0) in sample_stats()
1560 dot11rate(rt, rix), dot11rate_label(rt, rix), in sample_stats()
1562 (uintmax_t) sn->stats[y][rix].total_packets, in sample_stats()
1563 (uintmax_t) sn->stats[y][rix].packets_acked, in sample_stats()
1564 (int) ((sn->stats[y][rix].packets_acked * 100ULL) / in sample_stats()
1565 sn->stats[y][rix].total_packets), in sample_stats()
1566 sn->stats[y][rix].ewma_pct / 10, in sample_stats()
1567 sn->stats[y][rix].ewma_pct % 10, in sample_stats()
1568 (uintmax_t) sn->stats[y][rix].tries, in sample_stats()
1569 sn->stats[y][rix].successive_failures, in sample_stats()
1570 sn->stats[y][rix].average_tx_time, in sample_stats()
1571 ticks - sn->stats[y][rix].last_tx); in sample_stats()