aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/debugfs_netdev.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-03-30 02:28:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-31 14:46:42 -0400
commit17e4ec147f4939ca8c81b41b4261ec7974531381 (patch)
tree8066952a1dbef6656ac1f6d6a869326576b5006e /net/mac80211/debugfs_netdev.c
parent32fbccafed7e935432b601f0453c2b702a385a25 (diff)
mac80211: Track Beacon signal strength and implement cqm events
Calculate a running average of the signal strength reported for Beacon frames and indicate cqm events if the average value moves below or above the configured threshold value (and filter out repetitive events with by using the configured hysteresis). Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/debugfs_netdev.c')
-rw-r--r--net/mac80211/debugfs_netdev.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index 9affe2cd185f..ee61a9f6fabc 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -95,6 +95,14 @@ static ssize_t ieee80211_if_fmt_##name( \
95 return scnprintf(buf, buflen, "%pM\n", sdata->field); \ 95 return scnprintf(buf, buflen, "%pM\n", sdata->field); \
96} 96}
97 97
98#define IEEE80211_IF_FMT_DEC_DIV_16(name, field) \
99static ssize_t ieee80211_if_fmt_##name( \
100 const struct ieee80211_sub_if_data *sdata, \
101 char *buf, int buflen) \
102{ \
103 return scnprintf(buf, buflen, "%d\n", sdata->field / 16); \
104}
105
98#define __IEEE80211_IF_FILE(name, _write) \ 106#define __IEEE80211_IF_FILE(name, _write) \
99static ssize_t ieee80211_if_read_##name(struct file *file, \ 107static ssize_t ieee80211_if_read_##name(struct file *file, \
100 char __user *userbuf, \ 108 char __user *userbuf, \
@@ -135,6 +143,8 @@ IEEE80211_IF_FILE(rc_rateidx_mask_5ghz, rc_rateidx_mask[IEEE80211_BAND_5GHZ],
135/* STA attributes */ 143/* STA attributes */
136IEEE80211_IF_FILE(bssid, u.mgd.bssid, MAC); 144IEEE80211_IF_FILE(bssid, u.mgd.bssid, MAC);
137IEEE80211_IF_FILE(aid, u.mgd.aid, DEC); 145IEEE80211_IF_FILE(aid, u.mgd.aid, DEC);
146IEEE80211_IF_FILE(last_beacon, u.mgd.last_beacon_signal, DEC);
147IEEE80211_IF_FILE(ave_beacon, u.mgd.ave_beacon_signal, DEC_DIV_16);
138 148
139static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata, 149static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata,
140 enum ieee80211_smps_mode smps_mode) 150 enum ieee80211_smps_mode smps_mode)
@@ -271,6 +281,8 @@ static void add_sta_files(struct ieee80211_sub_if_data *sdata)
271 281
272 DEBUGFS_ADD(bssid); 282 DEBUGFS_ADD(bssid);
273 DEBUGFS_ADD(aid); 283 DEBUGFS_ADD(aid);
284 DEBUGFS_ADD(last_beacon);
285 DEBUGFS_ADD(ave_beacon);
274 DEBUGFS_ADD_MODE(smps, 0600); 286 DEBUGFS_ADD_MODE(smps, 0600);
275} 287}
276 288