Skip to content

Commit

Permalink
mac80211: update minstrel_ht sample rate when probe is set
Browse files Browse the repository at this point in the history
Waiting until the status is received can cause the same rate to be
probed multiple times consecutively.

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Daniel Halperin authored and John W. Linville committed Mar 9, 2011
1 parent 23ffaa8 commit 8d5eab5
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions net/mac80211/rc80211_minstrel_ht.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,8 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
mi->sample_count--;
}

if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) {
if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
mi->sample_packets += info->status.ampdu_len;
minstrel_next_sample_idx(mi);
}

for (i = 0; !last; i++) {
last = (i == IEEE80211_TX_MAX_RATES - 1) ||
Expand Down Expand Up @@ -551,13 +549,14 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
sample_idx = sample_table[mg->column][mg->index];
mr = &mg->rates[sample_idx];
sample_idx += mi->sample_group * MCS_GROUP_RATES;
minstrel_next_sample_idx(mi);

/*
* When not using MRR, do not sample if the probability is already
* higher than 95% to avoid wasting airtime
*/
if (!mp->has_mrr && (mr->probability > MINSTREL_FRAC(95, 100)))
goto next;
return -1;

/*
* Make sure that lower rates get sampled only occasionally,
Expand All @@ -566,17 +565,13 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
if (minstrel_get_duration(sample_idx) >
minstrel_get_duration(mi->max_tp_rate)) {
if (mr->sample_skipped < 20)
goto next;
return -1;

if (mi->sample_slow++ > 2)
goto next;
return -1;
}

return sample_idx;

next:
minstrel_next_sample_idx(mi);
return -1;
}

static void
Expand Down

0 comments on commit 8d5eab5

Please sign in to comment.