aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
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/wireless
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/wireless')
-rw-r--r--net/wireless/nl80211.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 56508d40c740..2cf03331d4a2 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1896,6 +1896,9 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
1896 if (sinfo->filled & STATION_INFO_SIGNAL) 1896 if (sinfo->filled & STATION_INFO_SIGNAL)
1897 NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL, 1897 NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL,
1898 sinfo->signal); 1898 sinfo->signal);
1899 if (sinfo->filled & STATION_INFO_SIGNAL_AVG)
1900 NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL_AVG,
1901 sinfo->signal_avg);
1899 if (sinfo->filled & STATION_INFO_TX_BITRATE) { 1902 if (sinfo->filled & STATION_INFO_TX_BITRATE) {
1900 txrate = nla_nest_start(msg, NL80211_STA_INFO_TX_BITRATE); 1903 txrate = nla_nest_start(msg, NL80211_STA_INFO_TX_BITRATE);
1901 if (!txrate) 1904 if (!txrate)