summaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-11-16 10:58:48 +0900
committerJohn W. Linville <linville@tuxdriver.com>2010-11-18 14:22:20 -0500
commit86107fd170bc379869250eb7e1bd393a3a70e8ae (patch)
tree579ee24be87e94246450420f4de57d8eda942848 /net/mac80211/rx.c
parenteef39befaae2a1559efe197d795c376a317af2af (diff)
downloadtalos-op-linux-86107fd170bc379869250eb7e1bd393a3a70e8ae.tar.gz
talos-op-linux-86107fd170bc379869250eb7e1bd393a3a70e8ae.zip
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/rx.c')
-rw-r--r--net/mac80211/rx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index d2fcd22ab06d..9dd60a74181f 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1156,6 +1156,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
sta->rx_fragments++;
sta->rx_bytes += rx->skb->len;
sta->last_signal = status->signal;
+ ewma_add(&sta->avg_signal, -status->signal);
/*
* Change STA power saving mode only at the end of a frame
OpenPOWER on IntegriCloud