average: change to declare precision, not factor

Declaring the factor is counter-intuitive, and people are prone
to using small(-ish) values even when that makes no sense.

Change the DECLARE_EWMA() macro to take the fractional precision,
in bits, rather than a factor, and update all users.

While at it, add some more documentation.

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg
2017-02-15 09:49:26 +01:00
rodzic 48cac18ecf
commit eb1e011a14
7 zmienionych plików z 47 dodań i 26 usunięć

Wyświetl plik

@@ -428,7 +428,7 @@ struct ieee80211_sta_tx_tspec {
bool downgraded;
};
DECLARE_EWMA(beacon_signal, 16, 4)
DECLARE_EWMA(beacon_signal, 4, 4)
struct ieee80211_if_managed {
struct timer_list timer;

Wyświetl plik

@@ -372,7 +372,7 @@ struct mesh_sta {
unsigned int fail_avg;
};
DECLARE_EWMA(signal, 1024, 8)
DECLARE_EWMA(signal, 10, 8)
struct ieee80211_sta_rx_stats {
unsigned long packets;