Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368436
b: refs/heads/master
c: 1e9c27d
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Huehn authored and Johannes Berg committed Mar 6, 2013
1 parent 73def52 commit c816149
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8f15761197c73e1968777e4b4d968ab0fba2cb74
refs/heads/master: 1e9c27df7b4a59f2269b9c88a5cef1e9018e77f6
13 changes: 9 additions & 4 deletions trunk/net/mac80211/rc80211_minstrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,17 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi)
if (!usecs)
usecs = 1000000;

if (mr->attempts) {
if (unlikely(mr->attempts > 0)) {
mr->sample_skipped = 0;
mr->cur_prob = MINSTREL_FRAC(mr->success, mr->attempts);
mr->succ_hist += mr->success;
mr->att_hist += mr->attempts;
mr->probability = minstrel_ewma(mr->probability,
mr->cur_prob,
EWMA_LEVEL);
mr->cur_tp = mr->probability * (1000000 / usecs);
}
} else
mr->sample_skipped++;

mr->last_success = mr->success;
mr->last_attempts = mr->attempts;
Expand Down Expand Up @@ -282,9 +284,12 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
rate_sampling = true;

/* Decide if direct ( 1st mrr stage) or indirect (2nd mrr stage)
* rate sampling method should be used */
* rate sampling method should be used.
* Respect such rates that are not sampled for 20 interations.
*/
if (mrr_capable &&
msr->perfect_tx_time > mi->r[ndx].perfect_tx_time)
msr->perfect_tx_time > mi->r[ndx].perfect_tx_time &&
msr->sample_skipped < 20)
indirect_rate_sampling = true;

if (!indirect_rate_sampling) {
Expand Down
1 change: 1 addition & 0 deletions trunk/net/mac80211/rc80211_minstrel.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct minstrel_rate {
u32 attempts;
u32 last_attempts;
u32 last_success;
u8 sample_skipped;

/* parts per thousand */
u32 cur_prob;
Expand Down

0 comments on commit c816149

Please sign in to comment.