diff options
Diffstat (limited to 'net/mac80211/debugfs.c')
-rw-r--r-- | net/mac80211/debugfs.c | 74 |
1 files changed, 47 insertions, 27 deletions
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index 210b9b6fecd2..11c72311f35b 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/debugfs.h> | 10 | #include <linux/debugfs.h> |
11 | #include <linux/rtnetlink.h> | 11 | #include <linux/rtnetlink.h> |
12 | #include "ieee80211_i.h" | 12 | #include "ieee80211_i.h" |
13 | #include "driver-ops.h" | ||
13 | #include "rate.h" | 14 | #include "rate.h" |
14 | #include "debugfs.h" | 15 | #include "debugfs.h" |
15 | 16 | ||
@@ -51,14 +52,6 @@ static const struct file_operations name## _ops = { \ | |||
51 | 52 | ||
52 | DEBUGFS_READONLY_FILE(frequency, 20, "%d", | 53 | DEBUGFS_READONLY_FILE(frequency, 20, "%d", |
53 | local->hw.conf.channel->center_freq); | 54 | local->hw.conf.channel->center_freq); |
54 | DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d", | ||
55 | local->rts_threshold); | ||
56 | DEBUGFS_READONLY_FILE(fragmentation_threshold, 20, "%d", | ||
57 | local->fragmentation_threshold); | ||
58 | DEBUGFS_READONLY_FILE(short_retry_limit, 20, "%d", | ||
59 | local->hw.conf.short_frame_max_tx_count); | ||
60 | DEBUGFS_READONLY_FILE(long_retry_limit, 20, "%d", | ||
61 | local->hw.conf.long_frame_max_tx_count); | ||
62 | DEBUGFS_READONLY_FILE(total_ps_buffered, 20, "%d", | 55 | DEBUGFS_READONLY_FILE(total_ps_buffered, 20, "%d", |
63 | local->total_ps_buffered); | 56 | local->total_ps_buffered); |
64 | DEBUGFS_READONLY_FILE(wep_iv, 20, "%#08x", | 57 | DEBUGFS_READONLY_FILE(wep_iv, 20, "%#08x", |
@@ -70,11 +63,10 @@ static ssize_t tsf_read(struct file *file, char __user *user_buf, | |||
70 | size_t count, loff_t *ppos) | 63 | size_t count, loff_t *ppos) |
71 | { | 64 | { |
72 | struct ieee80211_local *local = file->private_data; | 65 | struct ieee80211_local *local = file->private_data; |
73 | u64 tsf = 0; | 66 | u64 tsf; |
74 | char buf[100]; | 67 | char buf[100]; |
75 | 68 | ||
76 | if (local->ops->get_tsf) | 69 | tsf = drv_get_tsf(local); |
77 | tsf = local->ops->get_tsf(local_to_hw(local)); | ||
78 | 70 | ||
79 | snprintf(buf, sizeof(buf), "0x%016llx\n", (unsigned long long) tsf); | 71 | snprintf(buf, sizeof(buf), "0x%016llx\n", (unsigned long long) tsf); |
80 | 72 | ||
@@ -97,13 +89,13 @@ static ssize_t tsf_write(struct file *file, | |||
97 | 89 | ||
98 | if (strncmp(buf, "reset", 5) == 0) { | 90 | if (strncmp(buf, "reset", 5) == 0) { |
99 | if (local->ops->reset_tsf) { | 91 | if (local->ops->reset_tsf) { |
100 | local->ops->reset_tsf(local_to_hw(local)); | 92 | drv_reset_tsf(local); |
101 | printk(KERN_INFO "%s: debugfs reset TSF\n", wiphy_name(local->hw.wiphy)); | 93 | printk(KERN_INFO "%s: debugfs reset TSF\n", wiphy_name(local->hw.wiphy)); |
102 | } | 94 | } |
103 | } else { | 95 | } else { |
104 | tsf = simple_strtoul(buf, NULL, 0); | 96 | tsf = simple_strtoul(buf, NULL, 0); |
105 | if (local->ops->set_tsf) { | 97 | if (local->ops->set_tsf) { |
106 | local->ops->set_tsf(local_to_hw(local), tsf); | 98 | drv_set_tsf(local, tsf); |
107 | printk(KERN_INFO "%s: debugfs set TSF to %#018llx\n", wiphy_name(local->hw.wiphy), tsf); | 99 | printk(KERN_INFO "%s: debugfs set TSF to %#018llx\n", wiphy_name(local->hw.wiphy), tsf); |
108 | } | 100 | } |
109 | } | 101 | } |
@@ -135,6 +127,42 @@ static const struct file_operations reset_ops = { | |||
135 | .open = mac80211_open_file_generic, | 127 | .open = mac80211_open_file_generic, |
136 | }; | 128 | }; |
137 | 129 | ||
130 | static ssize_t noack_read(struct file *file, char __user *user_buf, | ||
131 | size_t count, loff_t *ppos) | ||
132 | { | ||
133 | struct ieee80211_local *local = file->private_data; | ||
134 | int res; | ||
135 | char buf[10]; | ||
136 | |||
137 | res = scnprintf(buf, sizeof(buf), "%d\n", local->wifi_wme_noack_test); | ||
138 | |||
139 | return simple_read_from_buffer(user_buf, count, ppos, buf, res); | ||
140 | } | ||
141 | |||
142 | static ssize_t noack_write(struct file *file, | ||
143 | const char __user *user_buf, | ||
144 | size_t count, loff_t *ppos) | ||
145 | { | ||
146 | struct ieee80211_local *local = file->private_data; | ||
147 | char buf[10]; | ||
148 | size_t len; | ||
149 | |||
150 | len = min(count, sizeof(buf) - 1); | ||
151 | if (copy_from_user(buf, user_buf, len)) | ||
152 | return -EFAULT; | ||
153 | buf[len] = '\0'; | ||
154 | |||
155 | local->wifi_wme_noack_test = !!simple_strtoul(buf, NULL, 0); | ||
156 | |||
157 | return count; | ||
158 | } | ||
159 | |||
160 | static const struct file_operations noack_ops = { | ||
161 | .read = noack_read, | ||
162 | .write = noack_write, | ||
163 | .open = mac80211_open_file_generic | ||
164 | }; | ||
165 | |||
138 | /* statistics stuff */ | 166 | /* statistics stuff */ |
139 | 167 | ||
140 | #define DEBUGFS_STATS_FILE(name, buflen, fmt, value...) \ | 168 | #define DEBUGFS_STATS_FILE(name, buflen, fmt, value...) \ |
@@ -150,14 +178,12 @@ static ssize_t format_devstat_counter(struct ieee80211_local *local, | |||
150 | char buf[20]; | 178 | char buf[20]; |
151 | int res; | 179 | int res; |
152 | 180 | ||
153 | if (!local->ops->get_stats) | ||
154 | return -EOPNOTSUPP; | ||
155 | |||
156 | rtnl_lock(); | 181 | rtnl_lock(); |
157 | res = local->ops->get_stats(local_to_hw(local), &stats); | 182 | res = drv_get_stats(local, &stats); |
158 | rtnl_unlock(); | 183 | rtnl_unlock(); |
159 | if (!res) | 184 | if (res) |
160 | res = printvalue(&stats, buf, sizeof(buf)); | 185 | return res; |
186 | res = printvalue(&stats, buf, sizeof(buf)); | ||
161 | return simple_read_from_buffer(userbuf, count, ppos, buf, res); | 187 | return simple_read_from_buffer(userbuf, count, ppos, buf, res); |
162 | } | 188 | } |
163 | 189 | ||
@@ -269,14 +295,11 @@ void debugfs_hw_add(struct ieee80211_local *local) | |||
269 | local->debugfs.keys = debugfs_create_dir("keys", phyd); | 295 | local->debugfs.keys = debugfs_create_dir("keys", phyd); |
270 | 296 | ||
271 | DEBUGFS_ADD(frequency); | 297 | DEBUGFS_ADD(frequency); |
272 | DEBUGFS_ADD(rts_threshold); | ||
273 | DEBUGFS_ADD(fragmentation_threshold); | ||
274 | DEBUGFS_ADD(short_retry_limit); | ||
275 | DEBUGFS_ADD(long_retry_limit); | ||
276 | DEBUGFS_ADD(total_ps_buffered); | 298 | DEBUGFS_ADD(total_ps_buffered); |
277 | DEBUGFS_ADD(wep_iv); | 299 | DEBUGFS_ADD(wep_iv); |
278 | DEBUGFS_ADD(tsf); | 300 | DEBUGFS_ADD(tsf); |
279 | DEBUGFS_ADD_MODE(reset, 0200); | 301 | DEBUGFS_ADD_MODE(reset, 0200); |
302 | DEBUGFS_ADD(noack); | ||
280 | 303 | ||
281 | statsd = debugfs_create_dir("statistics", phyd); | 304 | statsd = debugfs_create_dir("statistics", phyd); |
282 | local->debugfs.statistics = statsd; | 305 | local->debugfs.statistics = statsd; |
@@ -324,14 +347,11 @@ void debugfs_hw_add(struct ieee80211_local *local) | |||
324 | void debugfs_hw_del(struct ieee80211_local *local) | 347 | void debugfs_hw_del(struct ieee80211_local *local) |
325 | { | 348 | { |
326 | DEBUGFS_DEL(frequency); | 349 | DEBUGFS_DEL(frequency); |
327 | DEBUGFS_DEL(rts_threshold); | ||
328 | DEBUGFS_DEL(fragmentation_threshold); | ||
329 | DEBUGFS_DEL(short_retry_limit); | ||
330 | DEBUGFS_DEL(long_retry_limit); | ||
331 | DEBUGFS_DEL(total_ps_buffered); | 350 | DEBUGFS_DEL(total_ps_buffered); |
332 | DEBUGFS_DEL(wep_iv); | 351 | DEBUGFS_DEL(wep_iv); |
333 | DEBUGFS_DEL(tsf); | 352 | DEBUGFS_DEL(tsf); |
334 | DEBUGFS_DEL(reset); | 353 | DEBUGFS_DEL(reset); |
354 | DEBUGFS_DEL(noack); | ||
335 | 355 | ||
336 | DEBUGFS_STATS_DEL(transmitted_fragment_count); | 356 | DEBUGFS_STATS_DEL(transmitted_fragment_count); |
337 | DEBUGFS_STATS_DEL(multicast_transmitted_frame_count); | 357 | DEBUGFS_STATS_DEL(multicast_transmitted_frame_count); |