diff options
author | Johannes Berg <johannes.berg@intel.com> | 2015-08-28 04:52:54 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-09-22 09:21:26 -0400 |
commit | 338c17ae311e6b5a439573a4043fd2d9237cd1d5 (patch) | |
tree | 3383987c5faa4975b424e1eb5fa6e1b8e29678c8 /net/mac80211/util.c | |
parent | 8ec6d97871f37e4743678ea4a455bd59580aa0f4 (diff) |
mac80211: use DECLARE_EWMA for ave_beacon_signal
It doesn't seem problematic to change the weight for the average
beacon signal from 3 to 4, so use DECLARE_EWMA. This also makes
the code easier to maintain since bugs like the one fixed in the
previous patch can't happen as easily.
With a fix from Avraham Stern to invert the sign since EMWA uses
unsigned values only.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r-- | net/mac80211/util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index f16705675339..9cabf076d718 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -2543,7 +2543,7 @@ int ieee80211_ave_rssi(struct ieee80211_vif *vif) | |||
2543 | /* non-managed type inferfaces */ | 2543 | /* non-managed type inferfaces */ |
2544 | return 0; | 2544 | return 0; |
2545 | } | 2545 | } |
2546 | return ifmgd->ave_beacon_signal / 16; | 2546 | return -ewma_beacon_signal_read(&ifmgd->ave_beacon_signal); |
2547 | } | 2547 | } |
2548 | EXPORT_SYMBOL_GPL(ieee80211_ave_rssi); | 2548 | EXPORT_SYMBOL_GPL(ieee80211_ave_rssi); |
2549 | 2549 | ||