diff options
author | Daniel Halperin <dhalperi@cs.washington.edu> | 2011-03-09 06:10:18 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-03-09 16:10:58 -0500 |
commit | 8d5eab5aa676378b4c9daa62d10d08a0bca04677 (patch) | |
tree | 6d149cbd7c714486cc87616357349cc332fec712 /net/mac80211 | |
parent | 23ffaa89df16e55578318cfd852f23dcb37bf37b (diff) |
mac80211: update minstrel_ht sample rate when probe is set
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>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/rc80211_minstrel_ht.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 775cf155e94b..bce14fbfc3b6 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
@@ -415,10 +415,8 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband, | |||
415 | mi->sample_count--; | 415 | mi->sample_count--; |
416 | } | 416 | } |
417 | 417 | ||
418 | if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) { | 418 | if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) |
419 | mi->sample_packets += info->status.ampdu_len; | 419 | mi->sample_packets += info->status.ampdu_len; |
420 | minstrel_next_sample_idx(mi); | ||
421 | } | ||
422 | 420 | ||
423 | for (i = 0; !last; i++) { | 421 | for (i = 0; !last; i++) { |
424 | last = (i == IEEE80211_TX_MAX_RATES - 1) || | 422 | last = (i == IEEE80211_TX_MAX_RATES - 1) || |
@@ -551,13 +549,14 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) | |||
551 | sample_idx = sample_table[mg->column][mg->index]; | 549 | sample_idx = sample_table[mg->column][mg->index]; |
552 | mr = &mg->rates[sample_idx]; | 550 | mr = &mg->rates[sample_idx]; |
553 | sample_idx += mi->sample_group * MCS_GROUP_RATES; | 551 | sample_idx += mi->sample_group * MCS_GROUP_RATES; |
552 | minstrel_next_sample_idx(mi); | ||
554 | 553 | ||
555 | /* | 554 | /* |
556 | * When not using MRR, do not sample if the probability is already | 555 | * When not using MRR, do not sample if the probability is already |
557 | * higher than 95% to avoid wasting airtime | 556 | * higher than 95% to avoid wasting airtime |
558 | */ | 557 | */ |
559 | if (!mp->has_mrr && (mr->probability > MINSTREL_FRAC(95, 100))) | 558 | if (!mp->has_mrr && (mr->probability > MINSTREL_FRAC(95, 100))) |
560 | goto next; | 559 | return -1; |
561 | 560 | ||
562 | /* | 561 | /* |
563 | * Make sure that lower rates get sampled only occasionally, | 562 | * Make sure that lower rates get sampled only occasionally, |
@@ -566,17 +565,13 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) | |||
566 | if (minstrel_get_duration(sample_idx) > | 565 | if (minstrel_get_duration(sample_idx) > |
567 | minstrel_get_duration(mi->max_tp_rate)) { | 566 | minstrel_get_duration(mi->max_tp_rate)) { |
568 | if (mr->sample_skipped < 20) | 567 | if (mr->sample_skipped < 20) |
569 | goto next; | 568 | return -1; |
570 | 569 | ||
571 | if (mi->sample_slow++ > 2) | 570 | if (mi->sample_slow++ > 2) |
572 | goto next; | 571 | return -1; |
573 | } | 572 | } |
574 | 573 | ||
575 | return sample_idx; | 574 | return sample_idx; |
576 | |||
577 | next: | ||
578 | minstrel_next_sample_idx(mi); | ||
579 | return -1; | ||
580 | } | 575 | } |
581 | 576 | ||
582 | static void | 577 | static void |