diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1251_debugfs.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_debugfs.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_debugfs.c b/drivers/net/wireless/wl12xx/wl1251_debugfs.c index a00723059f83..5e4465ac08fa 100644 --- a/drivers/net/wireless/wl12xx/wl1251_debugfs.c +++ b/drivers/net/wireless/wl12xx/wl1251_debugfs.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "wl1251_debugfs.h" | 24 | #include "wl1251_debugfs.h" |
25 | 25 | ||
26 | #include <linux/skbuff.h> | 26 | #include <linux/skbuff.h> |
27 | #include <linux/slab.h> | ||
27 | 28 | ||
28 | #include "wl1251.h" | 29 | #include "wl1251.h" |
29 | #include "wl1251_acx.h" | 30 | #include "wl1251_acx.h" |
@@ -237,6 +238,27 @@ static const struct file_operations tx_queue_len_ops = { | |||
237 | .open = wl1251_open_file_generic, | 238 | .open = wl1251_open_file_generic, |
238 | }; | 239 | }; |
239 | 240 | ||
241 | static ssize_t tx_queue_status_read(struct file *file, char __user *userbuf, | ||
242 | size_t count, loff_t *ppos) | ||
243 | { | ||
244 | struct wl1251 *wl = file->private_data; | ||
245 | char buf[3], status; | ||
246 | int len; | ||
247 | |||
248 | if (wl->tx_queue_stopped) | ||
249 | status = 's'; | ||
250 | else | ||
251 | status = 'r'; | ||
252 | |||
253 | len = scnprintf(buf, sizeof(buf), "%c\n", status); | ||
254 | return simple_read_from_buffer(userbuf, count, ppos, buf, len); | ||
255 | } | ||
256 | |||
257 | static const struct file_operations tx_queue_status_ops = { | ||
258 | .read = tx_queue_status_read, | ||
259 | .open = wl1251_open_file_generic, | ||
260 | }; | ||
261 | |||
240 | static void wl1251_debugfs_delete_files(struct wl1251 *wl) | 262 | static void wl1251_debugfs_delete_files(struct wl1251 *wl) |
241 | { | 263 | { |
242 | DEBUGFS_FWSTATS_DEL(tx, internal_desc_overflow); | 264 | DEBUGFS_FWSTATS_DEL(tx, internal_desc_overflow); |
@@ -331,6 +353,7 @@ static void wl1251_debugfs_delete_files(struct wl1251 *wl) | |||
331 | DEBUGFS_FWSTATS_DEL(rxpipe, tx_xfr_host_int_trig_rx_data); | 353 | DEBUGFS_FWSTATS_DEL(rxpipe, tx_xfr_host_int_trig_rx_data); |
332 | 354 | ||
333 | DEBUGFS_DEL(tx_queue_len); | 355 | DEBUGFS_DEL(tx_queue_len); |
356 | DEBUGFS_DEL(tx_queue_status); | ||
334 | DEBUGFS_DEL(retry_count); | 357 | DEBUGFS_DEL(retry_count); |
335 | DEBUGFS_DEL(excessive_retries); | 358 | DEBUGFS_DEL(excessive_retries); |
336 | } | 359 | } |
@@ -431,6 +454,7 @@ static int wl1251_debugfs_add_files(struct wl1251 *wl) | |||
431 | DEBUGFS_FWSTATS_ADD(rxpipe, tx_xfr_host_int_trig_rx_data); | 454 | DEBUGFS_FWSTATS_ADD(rxpipe, tx_xfr_host_int_trig_rx_data); |
432 | 455 | ||
433 | DEBUGFS_ADD(tx_queue_len, wl->debugfs.rootdir); | 456 | DEBUGFS_ADD(tx_queue_len, wl->debugfs.rootdir); |
457 | DEBUGFS_ADD(tx_queue_status, wl->debugfs.rootdir); | ||
434 | DEBUGFS_ADD(retry_count, wl->debugfs.rootdir); | 458 | DEBUGFS_ADD(retry_count, wl->debugfs.rootdir); |
435 | DEBUGFS_ADD(excessive_retries, wl->debugfs.rootdir); | 459 | DEBUGFS_ADD(excessive_retries, wl->debugfs.rootdir); |
436 | 460 | ||
@@ -443,7 +467,8 @@ out: | |||
443 | 467 | ||
444 | void wl1251_debugfs_reset(struct wl1251 *wl) | 468 | void wl1251_debugfs_reset(struct wl1251 *wl) |
445 | { | 469 | { |
446 | memset(wl->stats.fw_stats, 0, sizeof(*wl->stats.fw_stats)); | 470 | if (wl->stats.fw_stats != NULL) |
471 | memset(wl->stats.fw_stats, 0, sizeof(*wl->stats.fw_stats)); | ||
447 | wl->stats.retry_count = 0; | 472 | wl->stats.retry_count = 0; |
448 | wl->stats.excessive_retries = 0; | 473 | wl->stats.excessive_retries = 0; |
449 | } | 474 | } |