339-mac80211-minstrel-reduce-MINSTREL_SCALE.patch 735 B

12345678910111213141516171819202122
  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
  4. The loss of a bit of extra precision does not hurt the calculation, 12
  5. bits is still enough to calculate probabilities well. Reducing the scale
  6. makes it easier to avoid overflows
  7. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  8. ---
  9. --- a/net/mac80211/rc80211_minstrel.h
  10. +++ b/net/mac80211/rc80211_minstrel.h
  11. @@ -14,7 +14,7 @@
  12. #define SAMPLE_COLUMNS 10 /* number of columns in sample table */
  13. /* scaled fraction values */
  14. -#define MINSTREL_SCALE 16
  15. +#define MINSTREL_SCALE 12
  16. #define MINSTREL_FRAC(val, div) (((val) << MINSTREL_SCALE) / div)
  17. #define MINSTREL_TRUNC(val) ((val) >> MINSTREL_SCALE)