aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.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/sta_info.c
parenteef39befaae2a1559efe197d795c376a317af2af (diff)
downloadkernel_samsung_smdk4412-86107fd170bc379869250eb7e1bd393a3a70e8ae.zip
kernel_samsung_smdk4412-86107fd170bc379869250eb7e1bd393a3a70e8ae.tar.gz
kernel_samsung_smdk4412-86107fd170bc379869250eb7e1bd393a3a70e8ae.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. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index eff5857..f43fca8 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -244,6 +244,8 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
sta->local = local;
sta->sdata = sdata;
+ ewma_init(&sta->avg_signal, 1000, 8);
+
if (sta_prepare_rate_control(local, sta, gfp)) {
kfree(sta);
return NULL;