aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.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/rx.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/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 6289525c0998..2fe8f5f86499 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1163,6 +1163,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
1163 sta->rx_fragments++; 1163 sta->rx_fragments++;
1164 sta->rx_bytes += rx->skb->len; 1164 sta->rx_bytes += rx->skb->len;
1165 sta->last_signal = status->signal; 1165 sta->last_signal = status->signal;
1166 ewma_add(&sta->avg_signal, -status->signal);
1166 1167
1167 /* 1168 /*
1168 * Change STA power saving mode only at the end of a frame 1169 * Change STA power saving mode only at the end of a frame