From c8ca8c2f933a516b5f4586d7dc6055b72107f246 Mon Sep 17 00:00:00 2001 From: Thomas Huehn Date: Mon, 4 Mar 2013 23:30:02 +0100 Subject: mac80211: merge value scaling macros of minstrel_ht and minstrel Both minstrel versions use individual ways to scale up integer values to perform calculations. Merge minstrel_ht's scaling macros into minstrels header file and use them in both minstrel versions. Acked-by: Felix Fietkau Signed-off-by: Thomas Huehn Signed-off-by: Johannes Berg --- net/mac80211/rc80211_minstrel.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'net/mac80211/rc80211_minstrel.h') diff --git a/net/mac80211/rc80211_minstrel.h b/net/mac80211/rc80211_minstrel.h index 98db93f96add..fda4a6154c87 100644 --- a/net/mac80211/rc80211_minstrel.h +++ b/net/mac80211/rc80211_minstrel.h @@ -11,6 +11,11 @@ #define EWMA_LEVEL 75 /* ewma weighting factor [%] */ +/* scaled fraction values */ +#define MINSTREL_SCALE 16 +#define MINSTREL_FRAC(val, div) (((val) << MINSTREL_SCALE) / div) +#define MINSTREL_TRUNC(val) ((val) >> MINSTREL_SCALE) + /* * Perform EWMA (Exponentially Weighted Moving Average) calculation */ -- cgit v1.2.3