Lines Matching refs:rate

15 #include "rate.h"
57 /* MCS rate information for an MCS group */
203 * To enable sufficiently targeted rate sampling, MCS rates are divided into
327 * Look up an MCS group index based on mac80211 rate information
330 minstrel_ht_get_group_idx(struct ieee80211_tx_rate *rate)
332 return GROUP_IDX((rate->idx / 8) + 1,
333 !!(rate->flags & IEEE80211_TX_RC_SHORT_GI),
334 !!(rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH));
341 minstrel_ht_ri_get_group_idx(struct rate_info *rate)
343 return GROUP_IDX((rate->mcs / 8) + 1,
344 !!(rate->flags & RATE_INFO_FLAGS_SHORT_GI),
345 !!(rate->bw & RATE_INFO_BW_40));
349 minstrel_vht_get_group_idx(struct ieee80211_tx_rate *rate)
351 return VHT_GROUP_IDX(ieee80211_rate_get_vht_nss(rate),
352 !!(rate->flags & IEEE80211_TX_RC_SHORT_GI),
353 !!(rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH) +
354 2*!!(rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH));
361 minstrel_vht_ri_get_group_idx(struct rate_info *rate)
363 return VHT_GROUP_IDX(rate->nss,
364 !!(rate->flags & RATE_INFO_FLAGS_SHORT_GI),
365 !!(rate->bw & RATE_INFO_BW_40) +
366 2*!!(rate->bw & RATE_INFO_BW_80));
371 struct ieee80211_tx_rate *rate)
375 if (rate->flags & IEEE80211_TX_RC_MCS) {
376 group = minstrel_ht_get_group_idx(rate);
377 idx = rate->idx % 8;
381 if (rate->flags & IEEE80211_TX_RC_VHT_MCS) {
382 group = minstrel_vht_get_group_idx(rate);
383 idx = ieee80211_rate_get_vht_mcs(rate);
392 if (rate->idx != mp->cck_rates[idx])
397 (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE))
404 if (rate->idx == mp->ofdm_rates[mi->band][idx])
413 * Get the minstrel rate statistics for specified STA and rate info.
420 struct rate_info *rate = &rate_status->rate_idx;
422 if (rate->flags & RATE_INFO_FLAGS_MCS) {
423 group = minstrel_ht_ri_get_group_idx(rate);
424 idx = rate->mcs % 8;
428 if (rate->flags & RATE_INFO_FLAGS_VHT_MCS) {
429 group = minstrel_vht_ri_get_group_idx(rate);
430 idx = rate->mcs;
436 if (rate->legacy != minstrel_cck_bitrates[ mp->cck_rates[idx] ])
448 if (rate->legacy == minstrel_ofdm_bitrates[ mp->ofdm_rates[mi->band][idx] ])
500 minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate,
516 nsecs += minstrel_mcs_groups[group].duration[rate] <<
521 * account for collision related packet error rate fluctuation
571 * Find and set the topmost probability rate per sta and per group
604 /* skip rates faster than max tp rate with lower prob */
634 * Assign new rate set per sta and use CCK rates only if the fastest
635 * rate (max_tp_rate[0]) is from CCK group. This prohibits such sorted
636 * rate sets where MCS and CCK rates are mixed, because CCK rates can
667 * Try to increase robustness of max_prob rate by decrease number of
763 * Recalculate statistics and counters of a given rate
871 * Flip through groups and pick the first group rate that is faster than the
872 * highest currently selected rate
933 * currently selected rate. Rates between the fastest and the slowest
1050 * Update rate statistics and select new primary rates
1052 * Rules for rate selection:
1055 * - as long as the max prob rate has a probability of more than 75%, pick
1105 /* Find best rate sets within all MCS groups*/
1114 /* (re)Initialize group rate indexes */
1140 /* Find max throughput rate set */
1143 /* Find max throughput rate set within a group */
1152 /* Assign new rate set per sta */
1170 /* Find max probability rate per group and global */
1198 struct ieee80211_tx_rate *rate)
1202 if (rate->idx < 0)
1205 if (!rate->count)
1208 if (rate->flags & IEEE80211_TX_RC_MCS ||
1209 rate->flags & IEEE80211_TX_RC_VHT_MCS)
1213 if (rate->idx == mp->cck_rates[i])
1217 if (rate->idx == mp->ofdm_rates[mi->band][i])
1288 struct minstrel_rate_stats *rate, *rate2;
1329 rate = minstrel_ht_ri_get_stats(mp, mi,
1333 rate->success += info->status.ampdu_ack_len;
1335 rate->attempts += st->rates[i].try_count *
1344 rate = minstrel_ht_get_stats(mp, mi, &ar[i]);
1346 rate->success += info->status.ampdu_ack_len;
1348 rate->attempts += ar[i].count * info->status.ampdu_len;
1357 rate = minstrel_get_ratestats(mi, mi->max_tp_rate[0]);
1358 if (rate->attempts > 30 &&
1359 rate->success < rate->attempts / 4) {
1456 ratetbl->rate[offset].count = 2;
1457 ratetbl->rate[offset].count_rts = 2;
1458 ratetbl->rate[offset].count_cts = 2;
1460 ratetbl->rate[offset].count = mrs->retry_count;
1461 ratetbl->rate[offset].count_cts = mrs->retry_count;
1462 ratetbl->rate[offset].count_rts = mrs->retry_count_rtscts;
1484 ratetbl->rate[offset].count = ratetbl->rate[offset].count_rts;
1488 ratetbl->rate[offset].idx = idx;
1489 ratetbl->rate[offset].flags = flags;
1493 minstrel_ht_get_prob_avg(struct minstrel_ht_sta *mi, int rate)
1495 int group = MI_RATE_GROUP(rate);
1496 rate = MI_RATE_IDX(rate);
1497 return mi->groups[group].rates[rate].prob_avg;
1505 int rate = MI_RATE_IDX(mi->max_prob_rate);
1509 if (mi->groups[group].rates[rate].prob_avg < MINSTREL_FRAC(50, 100))
1512 duration = g->duration[rate];
1515 /* If the rate is slower than single-stream MCS1, make A-MSDU limit small */
1520 * If the rate is slower than single-stream MCS4, limit A-MSDU to usual
1527 * If the rate is slower than single-stream MCS7, or if the max throughput
1528 * rate success probability is less than 75%, limit A-MSDU to twice the usual
1571 rates->rate[i].idx = -1;
1600 struct ieee80211_tx_rate *rate = &info->status.rates[0];
1633 rate->count = 1;
1637 rate->idx = mp->cck_rates[idx];
1640 rate->idx = mp->ofdm_rates[mi->band][idx];
1642 ieee80211_rate_set_vht(rate, MI_RATE_IDX(sample_idx),
1645 rate->idx = sample_idx + (sample_group->streams - 1) * 8;
1648 rate->flags = sample_group->flags;
1787 /* HT rate */
1796 /* VHT rate */
1828 /* create an initial rate table with the lowest supported rates */
1882 struct ieee80211_rate *rate = &sband->bitrates[i];
1888 if (rate->bitrate != bitrates[j])