summaryrefslogtreecommitdiff
path: root/package/kernel/mac80211/patches/339-mac80211-minstrel-reduce-MINSTREL_SCALE.patch
blob: 0416cf5900af61dc4c7bbc9af9a6de83700ab3c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 14 Dec 2016 20:15:33 +0100
Subject: [PATCH] mac80211: minstrel: reduce MINSTREL_SCALE

The loss of a bit of extra precision does not hurt the calculation, 12
bits is still enough to calculate probabilities well. Reducing the scale
makes it easier to avoid overflows

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---

--- a/net/mac80211/rc80211_minstrel.h
+++ b/net/mac80211/rc80211_minstrel.h
@@ -14,7 +14,7 @@
 #define SAMPLE_COLUMNS	10	/* number of columns in sample table */
 
 /* scaled fraction values */
-#define MINSTREL_SCALE  16
+#define MINSTREL_SCALE  12
 #define MINSTREL_FRAC(val, div) (((val) << MINSTREL_SCALE) / div)
 #define MINSTREL_TRUNC(val) ((val) >> MINSTREL_SCALE)