Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368433
b: refs/heads/master
c: a512d4b
h: refs/heads/master
i:
  368431: dc9e513
v: v3
  • Loading branch information
Thomas Huehn authored and Johannes Berg committed Mar 6, 2013
1 parent 78c1348 commit 56f1088
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 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: 52c00a37a323ded691b23538ef1181155f51aef3
refs/heads/master: a512d4b543ea20ec84f712f90a5229ab88a9709c
15 changes: 5 additions & 10 deletions trunk/net/mac80211/rc80211_minstrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi)
u32 max_tp = 0, index_max_tp = 0, index_max_tp2 = 0;
u32 max_prob = 0, index_max_prob = 0;
u32 usecs;
u32 p;
int i;

mi->stats_update = jiffies;
Expand All @@ -90,14 +89,13 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi)
/* To avoid rounding issues, probabilities scale from 0 (0%)
* to 18000 (100%) */
if (mr->attempts) {
p = (mr->success * 18000) / mr->attempts;
mr->cur_prob = (mr->success * 18000) / mr->attempts;
mr->succ_hist += mr->success;
mr->att_hist += mr->attempts;
mr->cur_prob = p;
p = ((p * (100 - mp->ewma_level)) + (mr->probability *
mp->ewma_level)) / 100;
mr->probability = p;
mr->cur_tp = p * (1000000 / usecs);
mr->probability = minstrel_ewma(mr->probability,
mr->cur_prob,
EWMA_LEVEL);
mr->cur_tp = mr->probability * (1000000 / usecs);
}

mr->last_success = mr->success;
Expand Down Expand Up @@ -542,9 +540,6 @@ minstrel_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
mp->lookaround_rate = 5;
mp->lookaround_rate_mrr = 10;

/* moving average weight for EWMA */
mp->ewma_level = 75;

/* maximum time that the hw is allowed to stay in one MRR segment */
mp->segment_size = 6000;

Expand Down
13 changes: 12 additions & 1 deletion trunk/net/mac80211/rc80211_minstrel.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
#ifndef __RC_MINSTREL_H
#define __RC_MINSTREL_H

#define EWMA_LEVEL 75 /* ewma weighting factor [%] */

/*
* Perform EWMA (Exponentially Weighted Moving Average) calculation
*/
static inline int
minstrel_ewma(int old, int new, int weight)
{
return (new * (100 - weight) + old * weight) / 100;
}


struct minstrel_rate {
int bitrate;
int rix;
Expand Down Expand Up @@ -73,7 +85,6 @@ struct minstrel_priv {
unsigned int cw_min;
unsigned int cw_max;
unsigned int max_retry;
unsigned int ewma_level;
unsigned int segment_size;
unsigned int update_interval;
unsigned int lookaround_rate;
Expand Down
10 changes: 0 additions & 10 deletions trunk/net/mac80211/rc80211_minstrel_ht.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#define AVG_PKT_SIZE 1200
#define SAMPLE_COLUMNS 10
#define EWMA_LEVEL 75

/* Number of bits for an average sized packet */
#define MCS_NBITS (AVG_PKT_SIZE << 3)
Expand Down Expand Up @@ -128,15 +127,6 @@ const struct mcs_group minstrel_mcs_groups[] = {

static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES];

/*
* Perform EWMA (Exponentially Weighted Moving Average) calculation
*/
static int
minstrel_ewma(int old, int new, int weight)
{
return (new * (100 - weight) + old * weight) / 100;
}

/*
* Look up an MCS group index based on mac80211 rate information
*/
Expand Down

0 comments on commit 56f1088

Please sign in to comment.