From a512d4b543ea20ec84f712f90a5229ab88a9709c Mon Sep 17 00:00:00 2001 From: Thomas Huehn Date: Mon, 4 Mar 2013 23:30:01 +0100 Subject: 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 Signed-off-by: Thomas Huehn Signed-off-by: Johannes Berg --- net/mac80211/rc80211_minstrel_ht.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'net/mac80211/rc80211_minstrel_ht.c') 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 @@ #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) @@ -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 */ -- cgit v1.2.3