1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 14 Dec 2016 20:15:33 +0100
3 Subject: [PATCH] mac80211: minstrel: reduce MINSTREL_SCALE
5 The loss of a bit of extra precision does not hurt the calculation, 12
6 bits is still enough to calculate probabilities well. Reducing the scale
7 makes it easier to avoid overflows
9 Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 --- a/net/mac80211/rc80211_minstrel.h
13 +++ b/net/mac80211/rc80211_minstrel.h
15 #define SAMPLE_COLUMNS 10 /* number of columns in sample table */
17 /* scaled fraction values */
18 -#define MINSTREL_SCALE 16
19 +#define MINSTREL_SCALE 12
20 #define MINSTREL_FRAC(val, div) (((val) << MINSTREL_SCALE) / div)
21 #define MINSTREL_TRUNC(val) ((val) >> MINSTREL_SCALE)