diff options
-rw-r--r-- | net/mac80211/rc80211_minstrel.c | 13 | ||||
-rw-r--r-- | net/mac80211/rc80211_minstrel.h | 1 |
2 files changed, 10 insertions, 4 deletions
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index 152bb0e37865..aa59f2962c38 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c | |||
@@ -85,7 +85,8 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi) | |||
85 | if (!usecs) | 85 | if (!usecs) |
86 | usecs = 1000000; | 86 | usecs = 1000000; |
87 | 87 | ||
88 | if (mr->attempts) { | 88 | if (unlikely(mr->attempts > 0)) { |
89 | mr->sample_skipped = 0; | ||
89 | mr->cur_prob = MINSTREL_FRAC(mr->success, mr->attempts); | 90 | mr->cur_prob = MINSTREL_FRAC(mr->success, mr->attempts); |
90 | mr->succ_hist += mr->success; | 91 | mr->succ_hist += mr->success; |
91 | mr->att_hist += mr->attempts; | 92 | mr->att_hist += mr->attempts; |
@@ -93,7 +94,8 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi) | |||
93 | mr->cur_prob, | 94 | mr->cur_prob, |
94 | EWMA_LEVEL); | 95 | EWMA_LEVEL); |
95 | mr->cur_tp = mr->probability * (1000000 / usecs); | 96 | mr->cur_tp = mr->probability * (1000000 / usecs); |
96 | } | 97 | } else |
98 | mr->sample_skipped++; | ||
97 | 99 | ||
98 | mr->last_success = mr->success; | 100 | mr->last_success = mr->success; |
99 | mr->last_attempts = mr->attempts; | 101 | mr->last_attempts = mr->attempts; |
@@ -282,9 +284,12 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta, | |||
282 | rate_sampling = true; | 284 | rate_sampling = true; |
283 | 285 | ||
284 | /* Decide if direct ( 1st mrr stage) or indirect (2nd mrr stage) | 286 | /* Decide if direct ( 1st mrr stage) or indirect (2nd mrr stage) |
285 | * rate sampling method should be used */ | 287 | * rate sampling method should be used. |
288 | * Respect such rates that are not sampled for 20 interations. | ||
289 | */ | ||
286 | if (mrr_capable && | 290 | if (mrr_capable && |
287 | msr->perfect_tx_time > mi->r[ndx].perfect_tx_time) | 291 | msr->perfect_tx_time > mi->r[ndx].perfect_tx_time && |
292 | msr->sample_skipped < 20) | ||
288 | indirect_rate_sampling = true; | 293 | indirect_rate_sampling = true; |
289 | 294 | ||
290 | if (!indirect_rate_sampling) { | 295 | if (!indirect_rate_sampling) { |
diff --git a/net/mac80211/rc80211_minstrel.h b/net/mac80211/rc80211_minstrel.h index 5fb5cb81d0da..200b7e3632da 100644 --- a/net/mac80211/rc80211_minstrel.h +++ b/net/mac80211/rc80211_minstrel.h | |||
@@ -43,6 +43,7 @@ struct minstrel_rate { | |||
43 | u32 attempts; | 43 | u32 attempts; |
44 | u32 last_attempts; | 44 | u32 last_attempts; |
45 | u32 last_success; | 45 | u32 last_success; |
46 | u8 sample_skipped; | ||
46 | 47 | ||
47 | /* parts per thousand */ | 48 | /* parts per thousand */ |
48 | u32 cur_prob; | 49 | u32 cur_prob; |