aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-12-02 05:12:43 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-07 16:09:12 -0500
commit541a45a142df281c974d74eac2066138fc107b23 (patch)
treeb96f4808c3f17f2f560db9569ca2b08dba9eab67 /net/mac80211/cfg.c
parent22de94de7de78b8de2fb1f2df5aa85b5556cfcfd (diff)
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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 68329d713c0..af962040632 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)
342 342
343 if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) || 343 if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) ||
344 (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) { 344 (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) {
345 sinfo->filled |= STATION_INFO_SIGNAL; 345 sinfo->filled |= STATION_INFO_SIGNAL | STATION_INFO_SIGNAL_AVG;
346 sinfo->signal = (s8)sta->last_signal; 346 sinfo->signal = (s8)sta->last_signal;
347 sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal);
347 } 348 }
348 349
349 sinfo->txrate.flags = 0; 350 sinfo->txrate.flags = 0;