diff options
Diffstat (limited to 'net/mac80211/debugfs.c')
-rw-r--r-- | net/mac80211/debugfs.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index e37f557de3f3..210b9b6fecd2 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c | |||
@@ -40,6 +40,10 @@ static const struct file_operations name## _ops = { \ | |||
40 | local->debugfs.name = debugfs_create_file(#name, 0400, phyd, \ | 40 | local->debugfs.name = debugfs_create_file(#name, 0400, phyd, \ |
41 | local, &name## _ops); | 41 | local, &name## _ops); |
42 | 42 | ||
43 | #define DEBUGFS_ADD_MODE(name, mode) \ | ||
44 | local->debugfs.name = debugfs_create_file(#name, mode, phyd, \ | ||
45 | local, &name## _ops); | ||
46 | |||
43 | #define DEBUGFS_DEL(name) \ | 47 | #define DEBUGFS_DEL(name) \ |
44 | debugfs_remove(local->debugfs.name); \ | 48 | debugfs_remove(local->debugfs.name); \ |
45 | local->debugfs.name = NULL; | 49 | local->debugfs.name = NULL; |
@@ -113,6 +117,24 @@ static const struct file_operations tsf_ops = { | |||
113 | .open = mac80211_open_file_generic | 117 | .open = mac80211_open_file_generic |
114 | }; | 118 | }; |
115 | 119 | ||
120 | static ssize_t reset_write(struct file *file, const char __user *user_buf, | ||
121 | size_t count, loff_t *ppos) | ||
122 | { | ||
123 | struct ieee80211_local *local = file->private_data; | ||
124 | |||
125 | rtnl_lock(); | ||
126 | __ieee80211_suspend(&local->hw); | ||
127 | __ieee80211_resume(&local->hw); | ||
128 | rtnl_unlock(); | ||
129 | |||
130 | return count; | ||
131 | } | ||
132 | |||
133 | static const struct file_operations reset_ops = { | ||
134 | .write = reset_write, | ||
135 | .open = mac80211_open_file_generic, | ||
136 | }; | ||
137 | |||
116 | /* statistics stuff */ | 138 | /* statistics stuff */ |
117 | 139 | ||
118 | #define DEBUGFS_STATS_FILE(name, buflen, fmt, value...) \ | 140 | #define DEBUGFS_STATS_FILE(name, buflen, fmt, value...) \ |
@@ -254,6 +276,7 @@ void debugfs_hw_add(struct ieee80211_local *local) | |||
254 | DEBUGFS_ADD(total_ps_buffered); | 276 | DEBUGFS_ADD(total_ps_buffered); |
255 | DEBUGFS_ADD(wep_iv); | 277 | DEBUGFS_ADD(wep_iv); |
256 | DEBUGFS_ADD(tsf); | 278 | DEBUGFS_ADD(tsf); |
279 | DEBUGFS_ADD_MODE(reset, 0200); | ||
257 | 280 | ||
258 | statsd = debugfs_create_dir("statistics", phyd); | 281 | statsd = debugfs_create_dir("statistics", phyd); |
259 | local->debugfs.statistics = statsd; | 282 | local->debugfs.statistics = statsd; |
@@ -308,6 +331,7 @@ void debugfs_hw_del(struct ieee80211_local *local) | |||
308 | DEBUGFS_DEL(total_ps_buffered); | 331 | DEBUGFS_DEL(total_ps_buffered); |
309 | DEBUGFS_DEL(wep_iv); | 332 | DEBUGFS_DEL(wep_iv); |
310 | DEBUGFS_DEL(tsf); | 333 | DEBUGFS_DEL(tsf); |
334 | DEBUGFS_DEL(reset); | ||
311 | 335 | ||
312 | DEBUGFS_STATS_DEL(transmitted_fragment_count); | 336 | DEBUGFS_STATS_DEL(transmitted_fragment_count); |
313 | DEBUGFS_STATS_DEL(multicast_transmitted_frame_count); | 337 | DEBUGFS_STATS_DEL(multicast_transmitted_frame_count); |