diff options
author | Thomas Huehn <thomas@net.t-labs.tu-berlin.de> | 2013-03-04 17:30:01 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-03-06 10:36:06 -0500 |
commit | a512d4b543ea20ec84f712f90a5229ab88a9709c (patch) | |
tree | d3c3f6354f371fff701a4b365964b155873ee544 /net/mac80211/rc80211_minstrel_ht.c | |
parent | 52c00a37a323ded691b23538ef1181155f51aef3 (diff) |
mac80211: merge EWMA calculation of minstrel_ht and minstrel
Both rate control algorithms (minstrel and minstrel_ht) calculate
averages based on EWMA. Shift function minstrel_ewma() into
rc80211_minstrel.h and make use of it in both minstrel version.
Also shift the default EWMA level (75%) definition to the header file
and clean up variable usage.
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rc80211_minstrel_ht.c')
-rw-r--r-- | net/mac80211/rc80211_minstrel_ht.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index aa59539e5b27..3009e457e758 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
@@ -18,7 +18,6 @@ | |||
18 | 18 | ||
19 | #define AVG_PKT_SIZE 1200 | 19 | #define AVG_PKT_SIZE 1200 |
20 | #define SAMPLE_COLUMNS 10 | 20 | #define SAMPLE_COLUMNS 10 |
21 | #define EWMA_LEVEL 75 | ||
22 | 21 | ||
23 | /* Number of bits for an average sized packet */ | 22 | /* Number of bits for an average sized packet */ |
24 | #define MCS_NBITS (AVG_PKT_SIZE << 3) | 23 | #define MCS_NBITS (AVG_PKT_SIZE << 3) |
@@ -129,15 +128,6 @@ const struct mcs_group minstrel_mcs_groups[] = { | |||
129 | static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES]; | 128 | static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES]; |
130 | 129 | ||
131 | /* | 130 | /* |
132 | * Perform EWMA (Exponentially Weighted Moving Average) calculation | ||
133 | */ | ||
134 | static int | ||
135 | minstrel_ewma(int old, int new, int weight) | ||
136 | { | ||
137 | return (new * (100 - weight) + old * weight) / 100; | ||
138 | } | ||
139 | |||
140 | /* | ||
141 | * Look up an MCS group index based on mac80211 rate information | 131 | * Look up an MCS group index based on mac80211 rate information |
142 | */ | 132 | */ |
143 | static int | 133 | static int |