diff options
author | Ben Greear <greearb@candelatech.com> | 2013-03-25 14:19:34 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-04-08 03:16:54 -0400 |
commit | 78e443e4c66b6e9391252f0080a06831259ada3a (patch) | |
tree | 9d1a4b74e16b2905a3a97acd29d0d34eae42e919 /net | |
parent | c6036cfe90c689b8d3407efce2b24c1b100464a2 (diff) |
mac80211: add beacon stats to debugfs
Beacon-timeout and number of beacon loss events.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 11 | ||||
-rw-r--r-- | net/mac80211/debugfs_sta.c | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index ddb426867904..14abcf44f974 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -124,6 +124,15 @@ static ssize_t ieee80211_if_fmt_##name( \ | |||
124 | return scnprintf(buf, buflen, "%d\n", sdata->field / 16); \ | 124 | return scnprintf(buf, buflen, "%d\n", sdata->field / 16); \ |
125 | } | 125 | } |
126 | 126 | ||
127 | #define IEEE80211_IF_FMT_JIFFIES_TO_MS(name, field) \ | ||
128 | static ssize_t ieee80211_if_fmt_##name( \ | ||
129 | const struct ieee80211_sub_if_data *sdata, \ | ||
130 | char *buf, int buflen) \ | ||
131 | { \ | ||
132 | return scnprintf(buf, buflen, "%d\n", \ | ||
133 | jiffies_to_msecs(sdata->field)); \ | ||
134 | } | ||
135 | |||
127 | #define __IEEE80211_IF_FILE(name, _write) \ | 136 | #define __IEEE80211_IF_FILE(name, _write) \ |
128 | static ssize_t ieee80211_if_read_##name(struct file *file, \ | 137 | static ssize_t ieee80211_if_read_##name(struct file *file, \ |
129 | char __user *userbuf, \ | 138 | char __user *userbuf, \ |
@@ -197,6 +206,7 @@ IEEE80211_IF_FILE(bssid, u.mgd.bssid, MAC); | |||
197 | IEEE80211_IF_FILE(aid, u.mgd.aid, DEC); | 206 | IEEE80211_IF_FILE(aid, u.mgd.aid, DEC); |
198 | IEEE80211_IF_FILE(last_beacon, u.mgd.last_beacon_signal, DEC); | 207 | IEEE80211_IF_FILE(last_beacon, u.mgd.last_beacon_signal, DEC); |
199 | IEEE80211_IF_FILE(ave_beacon, u.mgd.ave_beacon_signal, DEC_DIV_16); | 208 | IEEE80211_IF_FILE(ave_beacon, u.mgd.ave_beacon_signal, DEC_DIV_16); |
209 | IEEE80211_IF_FILE(beacon_timeout, u.mgd.beacon_timeout, JIFFIES_TO_MS); | ||
200 | 210 | ||
201 | static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata, | 211 | static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata, |
202 | enum ieee80211_smps_mode smps_mode) | 212 | enum ieee80211_smps_mode smps_mode) |
@@ -542,6 +552,7 @@ static void add_sta_files(struct ieee80211_sub_if_data *sdata) | |||
542 | DEBUGFS_ADD(aid); | 552 | DEBUGFS_ADD(aid); |
543 | DEBUGFS_ADD(last_beacon); | 553 | DEBUGFS_ADD(last_beacon); |
544 | DEBUGFS_ADD(ave_beacon); | 554 | DEBUGFS_ADD(ave_beacon); |
555 | DEBUGFS_ADD(beacon_timeout); | ||
545 | DEBUGFS_ADD_MODE(smps, 0600); | 556 | DEBUGFS_ADD_MODE(smps, 0600); |
546 | DEBUGFS_ADD_MODE(tkip_mic_test, 0200); | 557 | DEBUGFS_ADD_MODE(tkip_mic_test, 0200); |
547 | DEBUGFS_ADD_MODE(uapsd_queues, 0600); | 558 | DEBUGFS_ADD_MODE(uapsd_queues, 0600); |
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 4f841fe559df..44e201d60a13 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c | |||
@@ -54,6 +54,7 @@ STA_FILE(aid, sta.aid, D); | |||
54 | STA_FILE(dev, sdata->name, S); | 54 | STA_FILE(dev, sdata->name, S); |
55 | STA_FILE(last_signal, last_signal, D); | 55 | STA_FILE(last_signal, last_signal, D); |
56 | STA_FILE(last_ack_signal, last_ack_signal, D); | 56 | STA_FILE(last_ack_signal, last_ack_signal, D); |
57 | STA_FILE(beacon_loss_count, beacon_loss_count, D); | ||
57 | 58 | ||
58 | static ssize_t sta_flags_read(struct file *file, char __user *userbuf, | 59 | static ssize_t sta_flags_read(struct file *file, char __user *userbuf, |
59 | size_t count, loff_t *ppos) | 60 | size_t count, loff_t *ppos) |
@@ -434,6 +435,7 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta) | |||
434 | DEBUGFS_ADD(agg_status); | 435 | DEBUGFS_ADD(agg_status); |
435 | DEBUGFS_ADD(dev); | 436 | DEBUGFS_ADD(dev); |
436 | DEBUGFS_ADD(last_signal); | 437 | DEBUGFS_ADD(last_signal); |
438 | DEBUGFS_ADD(beacon_loss_count); | ||
437 | DEBUGFS_ADD(ht_capa); | 439 | DEBUGFS_ADD(ht_capa); |
438 | DEBUGFS_ADD(vht_capa); | 440 | DEBUGFS_ADD(vht_capa); |
439 | DEBUGFS_ADD(last_ack_signal); | 441 | DEBUGFS_ADD(last_ack_signal); |