diff options
author | Bruno Randolf <br1@einfach.org> | 2010-12-02 19:12:43 +0900 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-07 16:09:12 -0500 |
commit | 541a45a142df281c974d74eac2066138fc107b23 (patch) | |
tree | b96f4808c3f17f2f560db9569ca2b08dba9eab67 /net/mac80211/cfg.c | |
parent | 22de94de7de78b8de2fb1f2df5aa85b5556cfcfd (diff) | |
download | linux-541a45a142df281c974d74eac2066138fc107b23.tar.bz2 |
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.
--
v2: fix ABI breakage and change factor to be a power of 2.
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 68329d713c02..af9620406321 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -342,8 +342,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; |