diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2011-08-26 02:10:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-29 15:25:34 -0400 |
commit | 1f7b6172db86e9ab2b4cd794441bb2c40ab287fc (patch) | |
tree | 3e44d755f23dddfd49abe1106f70e661dd87c474 /drivers/net/wireless/iwlwifi/iwl-debugfs.c | |
parent | e4ef84d94b0dbb75b4da6628611341af5812360f (diff) |
iwlagn: move isr_statistics to transport layer
It is accessed by the transport layer only, hence the move.
The debugfs handlers that accessed it moved to the transport layer too.
The rx_handlers part of it stayed in the upper layer and a special debugfs
has been added for it
Also add missing includes to iwl-commands.h.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 54 |
1 files changed, 10 insertions, 44 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index fa070de2840c..787dae5fec99 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -556,11 +556,12 @@ static ssize_t iwl_dbgfs_status_read(struct file *file, | |||
556 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 556 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
557 | } | 557 | } |
558 | 558 | ||
559 | static ssize_t iwl_dbgfs_interrupt_read(struct file *file, | 559 | static ssize_t iwl_dbgfs_rx_handlers_read(struct file *file, |
560 | char __user *user_buf, | 560 | char __user *user_buf, |
561 | size_t count, loff_t *ppos) { | 561 | size_t count, loff_t *ppos) { |
562 | 562 | ||
563 | struct iwl_priv *priv = file->private_data; | 563 | struct iwl_priv *priv = file->private_data; |
564 | |||
564 | int pos = 0; | 565 | int pos = 0; |
565 | int cnt = 0; | 566 | int cnt = 0; |
566 | char *buf; | 567 | char *buf; |
@@ -573,61 +574,25 @@ static ssize_t iwl_dbgfs_interrupt_read(struct file *file, | |||
573 | return -ENOMEM; | 574 | return -ENOMEM; |
574 | } | 575 | } |
575 | 576 | ||
576 | pos += scnprintf(buf + pos, bufsz - pos, | ||
577 | "Interrupt Statistics Report:\n"); | ||
578 | |||
579 | pos += scnprintf(buf + pos, bufsz - pos, "HW Error:\t\t\t %u\n", | ||
580 | priv->isr_stats.hw); | ||
581 | pos += scnprintf(buf + pos, bufsz - pos, "SW Error:\t\t\t %u\n", | ||
582 | priv->isr_stats.sw); | ||
583 | if (priv->isr_stats.sw || priv->isr_stats.hw) { | ||
584 | pos += scnprintf(buf + pos, bufsz - pos, | ||
585 | "\tLast Restarting Code: 0x%X\n", | ||
586 | priv->isr_stats.err_code); | ||
587 | } | ||
588 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
589 | pos += scnprintf(buf + pos, bufsz - pos, "Frame transmitted:\t\t %u\n", | ||
590 | priv->isr_stats.sch); | ||
591 | pos += scnprintf(buf + pos, bufsz - pos, "Alive interrupt:\t\t %u\n", | ||
592 | priv->isr_stats.alive); | ||
593 | #endif | ||
594 | pos += scnprintf(buf + pos, bufsz - pos, | ||
595 | "HW RF KILL switch toggled:\t %u\n", | ||
596 | priv->isr_stats.rfkill); | ||
597 | |||
598 | pos += scnprintf(buf + pos, bufsz - pos, "CT KILL:\t\t\t %u\n", | ||
599 | priv->isr_stats.ctkill); | ||
600 | |||
601 | pos += scnprintf(buf + pos, bufsz - pos, "Wakeup Interrupt:\t\t %u\n", | ||
602 | priv->isr_stats.wakeup); | ||
603 | |||
604 | pos += scnprintf(buf + pos, bufsz - pos, | ||
605 | "Rx command responses:\t\t %u\n", | ||
606 | priv->isr_stats.rx); | ||
607 | for (cnt = 0; cnt < REPLY_MAX; cnt++) { | 577 | for (cnt = 0; cnt < REPLY_MAX; cnt++) { |
608 | if (priv->isr_stats.rx_handlers[cnt] > 0) | 578 | if (priv->rx_handlers_stats[cnt] > 0) |
609 | pos += scnprintf(buf + pos, bufsz - pos, | 579 | pos += scnprintf(buf + pos, bufsz - pos, |
610 | "\tRx handler[%36s]:\t\t %u\n", | 580 | "\tRx handler[%36s]:\t\t %u\n", |
611 | get_cmd_string(cnt), | 581 | get_cmd_string(cnt), |
612 | priv->isr_stats.rx_handlers[cnt]); | 582 | priv->rx_handlers_stats[cnt]); |
613 | } | 583 | } |
614 | 584 | ||
615 | pos += scnprintf(buf + pos, bufsz - pos, "Tx/FH interrupt:\t\t %u\n", | ||
616 | priv->isr_stats.tx); | ||
617 | |||
618 | pos += scnprintf(buf + pos, bufsz - pos, "Unexpected INTA:\t\t %u\n", | ||
619 | priv->isr_stats.unhandled); | ||
620 | |||
621 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 585 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
622 | kfree(buf); | 586 | kfree(buf); |
623 | return ret; | 587 | return ret; |
624 | } | 588 | } |
625 | 589 | ||
626 | static ssize_t iwl_dbgfs_interrupt_write(struct file *file, | 590 | static ssize_t iwl_dbgfs_rx_handlers_write(struct file *file, |
627 | const char __user *user_buf, | 591 | const char __user *user_buf, |
628 | size_t count, loff_t *ppos) | 592 | size_t count, loff_t *ppos) |
629 | { | 593 | { |
630 | struct iwl_priv *priv = file->private_data; | 594 | struct iwl_priv *priv = file->private_data; |
595 | |||
631 | char buf[8]; | 596 | char buf[8]; |
632 | int buf_size; | 597 | int buf_size; |
633 | u32 reset_flag; | 598 | u32 reset_flag; |
@@ -639,7 +604,8 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file, | |||
639 | if (sscanf(buf, "%x", &reset_flag) != 1) | 604 | if (sscanf(buf, "%x", &reset_flag) != 1) |
640 | return -EFAULT; | 605 | return -EFAULT; |
641 | if (reset_flag == 0) | 606 | if (reset_flag == 0) |
642 | iwl_clear_isr_stats(priv); | 607 | memset(&priv->rx_handlers_stats[0], 0, |
608 | sizeof(priv->rx_handlers_stats)); | ||
643 | 609 | ||
644 | return count; | 610 | return count; |
645 | } | 611 | } |
@@ -834,7 +800,7 @@ DEBUGFS_READ_FILE_OPS(nvm); | |||
834 | DEBUGFS_READ_FILE_OPS(stations); | 800 | DEBUGFS_READ_FILE_OPS(stations); |
835 | DEBUGFS_READ_FILE_OPS(channels); | 801 | DEBUGFS_READ_FILE_OPS(channels); |
836 | DEBUGFS_READ_FILE_OPS(status); | 802 | DEBUGFS_READ_FILE_OPS(status); |
837 | DEBUGFS_READ_WRITE_FILE_OPS(interrupt); | 803 | DEBUGFS_READ_WRITE_FILE_OPS(rx_handlers); |
838 | DEBUGFS_READ_FILE_OPS(qos); | 804 | DEBUGFS_READ_FILE_OPS(qos); |
839 | DEBUGFS_READ_FILE_OPS(thermal_throttling); | 805 | DEBUGFS_READ_FILE_OPS(thermal_throttling); |
840 | DEBUGFS_READ_WRITE_FILE_OPS(disable_ht40); | 806 | DEBUGFS_READ_WRITE_FILE_OPS(disable_ht40); |
@@ -2471,7 +2437,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
2471 | DEBUGFS_ADD_FILE(stations, dir_data, S_IRUSR); | 2437 | DEBUGFS_ADD_FILE(stations, dir_data, S_IRUSR); |
2472 | DEBUGFS_ADD_FILE(channels, dir_data, S_IRUSR); | 2438 | DEBUGFS_ADD_FILE(channels, dir_data, S_IRUSR); |
2473 | DEBUGFS_ADD_FILE(status, dir_data, S_IRUSR); | 2439 | DEBUGFS_ADD_FILE(status, dir_data, S_IRUSR); |
2474 | DEBUGFS_ADD_FILE(interrupt, dir_data, S_IWUSR | S_IRUSR); | 2440 | DEBUGFS_ADD_FILE(rx_handlers, dir_data, S_IWUSR | S_IRUSR); |
2475 | DEBUGFS_ADD_FILE(qos, dir_data, S_IRUSR); | 2441 | DEBUGFS_ADD_FILE(qos, dir_data, S_IRUSR); |
2476 | DEBUGFS_ADD_FILE(sleep_level_override, dir_data, S_IWUSR | S_IRUSR); | 2442 | DEBUGFS_ADD_FILE(sleep_level_override, dir_data, S_IWUSR | S_IRUSR); |
2477 | DEBUGFS_ADD_FILE(current_sleep_command, dir_data, S_IRUSR); | 2443 | DEBUGFS_ADD_FILE(current_sleep_command, dir_data, S_IRUSR); |