diff options
author | Bruno Randolf <br1@einfach.org> | 2010-11-16 04:58:48 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-18 22:22:20 +0300 |
commit | 86107fd170bc379869250eb7e1bd393a3a70e8ae (patch) | |
tree | 579ee24be87e94246450420f4de57d8eda942848 /net/mac80211/cfg.c | |
parent | eef39befaae2a1559efe197d795c376a317af2af (diff) | |
download | linux-86107fd170bc379869250eb7e1bd393a3a70e8ae.tar.xz |
nl80211/mac80211: Report signal average
Extend nl80211 to report an exponential weighted moving average (EWMA) of the
signal value. Since the signal value usually fluctuates between different
packets, an average can be more useful than the value of the last packet.
This uses the recently added generic EWMA library function.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 0c544074479e..92c9cf6a7d1c 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -343,8 +343,9 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) || (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) { - sinfo->filled |= STATION_INFO_SIGNAL; + sinfo->filled |= STATION_INFO_SIGNAL | STATION_INFO_SIGNAL_AVG; sinfo->signal = (s8)sta->last_signal; + sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal); } sinfo->txrate.flags = 0; |