aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rc80211_minstrel.c
diff options
context:
space:
mode:
authorThomas Huehn <thomas@net.t-labs.tu-berlin.de>2015-03-24 16:09:39 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-04-01 14:44:31 -0400
commit9134073bc693633b5e1f1a7252c93b3fb262aae4 (patch)
treebc3d44c87bbcf5006f45f0afbd45da209a2101ee /net/mac80211/rc80211_minstrel.c
parentf62838bcc5f58f580961aaf8c9fe59036b7be825 (diff)
mac80211: improve Minstrel variable & function naming
This patch ensures a consistent usage of variable names for type "minstrel_rate_stats" to be used as "mrs" and from type minstrel_rate as "mr" across both Minstrel & Minstrel-HT. In addition some variable and function names got changed to more meaningful ones. Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rc80211_minstrel.c')
-rw-r--r--net/mac80211/rc80211_minstrel.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index 5528037021ad..c86e42b67908 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -137,9 +137,9 @@ minstrel_calc_rate_stats(struct minstrel_rate_stats *mrs)
137 mrs->sample_skipped = 0; 137 mrs->sample_skipped = 0;
138 mrs->cur_prob = MINSTREL_FRAC(mrs->success, mrs->attempts); 138 mrs->cur_prob = MINSTREL_FRAC(mrs->success, mrs->attempts);
139 if (unlikely(!mrs->att_hist)) 139 if (unlikely(!mrs->att_hist))
140 mrs->probability = mrs->cur_prob; 140 mrs->prob_ewma = mrs->cur_prob;
141 else 141 else
142 mrs->probability = minstrel_ewma(mrs->probability, 142 mrs->prob_ewma = minstrel_ewma(mrs->prob_ewma,
143 mrs->cur_prob, EWMA_LEVEL); 143 mrs->cur_prob, EWMA_LEVEL);
144 mrs->att_hist += mrs->attempts; 144 mrs->att_hist += mrs->attempts;
145 mrs->succ_hist += mrs->success; 145 mrs->succ_hist += mrs->success;
@@ -176,15 +176,15 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi)
176 minstrel_calc_rate_stats(mrs); 176 minstrel_calc_rate_stats(mrs);
177 177
178 /* Update throughput per rate, reset thr. below 10% success */ 178 /* Update throughput per rate, reset thr. below 10% success */
179 if (mrs->probability < MINSTREL_FRAC(10, 100)) 179 if (mrs->prob_ewma < MINSTREL_FRAC(10, 100))
180 mrs->cur_tp = 0; 180 mrs->cur_tp = 0;
181 else 181 else
182 mrs->cur_tp = mrs->probability * (1000000 / usecs); 182 mrs->cur_tp = mrs->prob_ewma * (1000000 / usecs);
183 183
184 /* Sample less often below the 10% chance of success. 184 /* Sample less often below the 10% chance of success.
185 * Sample less often above the 95% chance of success. */ 185 * Sample less often above the 95% chance of success. */
186 if (mrs->probability > MINSTREL_FRAC(95, 100) || 186 if (mrs->prob_ewma > MINSTREL_FRAC(95, 100) ||
187 mrs->probability < MINSTREL_FRAC(10, 100)) { 187 mrs->prob_ewma < MINSTREL_FRAC(10, 100)) {
188 mr->adjusted_retry_count = mrs->retry_count >> 1; 188 mr->adjusted_retry_count = mrs->retry_count >> 1;
189 if (mr->adjusted_retry_count > 2) 189 if (mr->adjusted_retry_count > 2)
190 mr->adjusted_retry_count = 2; 190 mr->adjusted_retry_count = 2;
@@ -204,11 +204,11 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi)
204 * choose the maximum throughput rate as max_prob_rate 204 * choose the maximum throughput rate as max_prob_rate
205 * (2) if all success probabilities < 95%, the rate with 205 * (2) if all success probabilities < 95%, the rate with
206 * highest success probability is chosen as max_prob_rate */ 206 * highest success probability is chosen as max_prob_rate */
207 if (mrs->probability >= MINSTREL_FRAC(95, 100)) { 207 if (mrs->prob_ewma >= MINSTREL_FRAC(95, 100)) {
208 if (mrs->cur_tp >= mi->r[tmp_prob_rate].stats.cur_tp) 208 if (mrs->cur_tp >= mi->r[tmp_prob_rate].stats.cur_tp)
209 tmp_prob_rate = i; 209 tmp_prob_rate = i;
210 } else { 210 } else {
211 if (mrs->probability >= mi->r[tmp_prob_rate].stats.probability) 211 if (mrs->prob_ewma >= mi->r[tmp_prob_rate].stats.prob_ewma)
212 tmp_prob_rate = i; 212 tmp_prob_rate = i;
213 } 213 }
214 } 214 }
@@ -227,7 +227,7 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi)
227#endif 227#endif
228 228
229 /* Reset update timer */ 229 /* Reset update timer */
230 mi->stats_update = jiffies; 230 mi->last_stats_update = jiffies;
231 231
232 minstrel_update_rates(mp, mi); 232 minstrel_update_rates(mp, mi);
233} 233}
@@ -265,7 +265,7 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband,
265 if (mi->sample_deferred > 0) 265 if (mi->sample_deferred > 0)
266 mi->sample_deferred--; 266 mi->sample_deferred--;
267 267
268 if (time_after(jiffies, mi->stats_update + 268 if (time_after(jiffies, mi->last_stats_update +
269 (mp->update_interval * HZ) / 1000)) 269 (mp->update_interval * HZ) / 1000))
270 minstrel_update_stats(mp, mi); 270 minstrel_update_stats(mp, mi);
271} 271}
@@ -397,7 +397,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
397 * has a probability of >95%, we shouldn't be attempting 397 * has a probability of >95%, we shouldn't be attempting
398 * to use it, as this only wastes precious airtime */ 398 * to use it, as this only wastes precious airtime */
399 if (!mrr_capable && 399 if (!mrr_capable &&
400 (mi->r[ndx].stats.probability > MINSTREL_FRAC(95, 100))) 400 (mi->r[ndx].stats.prob_ewma > MINSTREL_FRAC(95, 100)))
401 return; 401 return;
402 402
403 mi->prev_sample = true; 403 mi->prev_sample = true;
@@ -531,7 +531,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
531 } 531 }
532 532
533 mi->n_rates = n; 533 mi->n_rates = n;
534 mi->stats_update = jiffies; 534 mi->last_stats_update = jiffies;
535 535
536 init_sample_table(mi); 536 init_sample_table(mi);
537 minstrel_update_rates(mp, mi); 537 minstrel_update_rates(mp, mi);
@@ -565,7 +565,7 @@ minstrel_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
565 if (!mi->sample_table) 565 if (!mi->sample_table)
566 goto error1; 566 goto error1;
567 567
568 mi->stats_update = jiffies; 568 mi->last_stats_update = jiffies;
569 return mi; 569 return mi;
570 570
571error1: 571error1: