Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368411
b: refs/heads/master
c: a299c6d
h: refs/heads/master
i:
  368409: a5c4340
  368407: f5f5cc5
v: v3
  • Loading branch information
Felix Fietkau authored and Johannes Berg committed Mar 6, 2013
1 parent a64892b commit 834ff16
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 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: ed97a13c540eb8fdbb6250eaa6471a4263204af8
refs/heads/master: a299c6d591f8f6abfe42e77d70ed688067748135
27 changes: 19 additions & 8 deletions trunk/net/mac80211/rc80211_minstrel_ht.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
struct minstrel_rate_stats *mr;
int cur_prob, cur_prob_tp, cur_tp, cur_tp2;
int group, i, index;
int prob_max_streams = 1;

if (mi->ampdu_packets > 0) {
mi->avg_ampdu_len = minstrel_ewma(mi->avg_ampdu_len,
Expand Down Expand Up @@ -323,20 +324,13 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
if (!mg->supported)
continue;

mr = minstrel_get_ratestats(mi, mg->max_prob_rate);
if (cur_prob_tp < mr->cur_tp &&
minstrel_mcs_groups[group].streams == 1) {
mi->max_prob_rate = mg->max_prob_rate;
cur_prob = mr->cur_prob;
cur_prob_tp = mr->cur_tp;
}

mr = minstrel_get_ratestats(mi, mg->max_tp_rate);
if (cur_tp < mr->cur_tp) {
mi->max_tp_rate2 = mi->max_tp_rate;
cur_tp2 = cur_tp;
mi->max_tp_rate = mg->max_tp_rate;
cur_tp = mr->cur_tp;
prob_max_streams = minstrel_mcs_groups[group].streams - 1;
}

mr = minstrel_get_ratestats(mi, mg->max_tp_rate2);
Expand All @@ -346,6 +340,23 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
}
}

if (prob_max_streams < 1)
prob_max_streams = 1;

for (group = 0; group < ARRAY_SIZE(minstrel_mcs_groups); group++) {
mg = &mi->groups[group];
if (!mg->supported)
continue;
mr = minstrel_get_ratestats(mi, mg->max_prob_rate);
if (cur_prob_tp < mr->cur_tp &&
minstrel_mcs_groups[group].streams <= prob_max_streams) {
mi->max_prob_rate = mg->max_prob_rate;
cur_prob = mr->cur_prob;
cur_prob_tp = mr->cur_tp;
}
}


mi->stats_update = jiffies;
}

Expand Down

0 comments on commit 834ff16

Please sign in to comment.