diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-12-10 17:37:25 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-21 18:56:14 -0500 |
commit | 696bdee3ba216186e21997d20a839b76158346e6 (patch) | |
tree | 2bcf07a3bdf1c3f3adc3e36a9a71bec4191e02b2 /drivers/net/wireless/iwlwifi/iwl-debugfs.c | |
parent | 3a41bbd515d449604f3488c5f8dd62802f09d19b (diff) |
iwlwifi: dump "Control and Status Register" when detect uCode HW/SW error
When uCode HW/SW error detected, dumping important CSR (Control and Status
Registers) values.
Also add "csr" debugfs file to dump the current values of CSR defined in
CSR table to syslog.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@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 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 21e0f6699daf..2be3549be01d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -1845,6 +1845,28 @@ static ssize_t iwl_dbgfs_clear_ucode_statistics_write(struct file *file, | |||
1845 | return count; | 1845 | return count; |
1846 | } | 1846 | } |
1847 | 1847 | ||
1848 | static ssize_t iwl_dbgfs_csr_write(struct file *file, | ||
1849 | const char __user *user_buf, | ||
1850 | size_t count, loff_t *ppos) | ||
1851 | { | ||
1852 | struct iwl_priv *priv = file->private_data; | ||
1853 | char buf[8]; | ||
1854 | int buf_size; | ||
1855 | int csr; | ||
1856 | |||
1857 | memset(buf, 0, sizeof(buf)); | ||
1858 | buf_size = min(count, sizeof(buf) - 1); | ||
1859 | if (copy_from_user(buf, user_buf, buf_size)) | ||
1860 | return -EFAULT; | ||
1861 | if (sscanf(buf, "%d", &csr) != 1) | ||
1862 | return -EFAULT; | ||
1863 | |||
1864 | if (priv->cfg->ops->lib->dump_csr) | ||
1865 | priv->cfg->ops->lib->dump_csr(priv); | ||
1866 | |||
1867 | return count; | ||
1868 | } | ||
1869 | |||
1848 | DEBUGFS_READ_FILE_OPS(rx_statistics); | 1870 | DEBUGFS_READ_FILE_OPS(rx_statistics); |
1849 | DEBUGFS_READ_FILE_OPS(tx_statistics); | 1871 | DEBUGFS_READ_FILE_OPS(tx_statistics); |
1850 | DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); | 1872 | DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); |
@@ -1859,6 +1881,7 @@ DEBUGFS_READ_FILE_OPS(tx_power); | |||
1859 | DEBUGFS_READ_FILE_OPS(power_save_status); | 1881 | DEBUGFS_READ_FILE_OPS(power_save_status); |
1860 | DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics); | 1882 | DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics); |
1861 | DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics); | 1883 | DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics); |
1884 | DEBUGFS_WRITE_FILE_OPS(csr); | ||
1862 | 1885 | ||
1863 | /* | 1886 | /* |
1864 | * Create the debugfs files and directories | 1887 | * Create the debugfs files and directories |
@@ -1909,6 +1932,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
1909 | DEBUGFS_ADD_FILE(power_save_status, debug, S_IRUSR); | 1932 | DEBUGFS_ADD_FILE(power_save_status, debug, S_IRUSR); |
1910 | DEBUGFS_ADD_FILE(clear_ucode_statistics, debug, S_IWUSR); | 1933 | DEBUGFS_ADD_FILE(clear_ucode_statistics, debug, S_IWUSR); |
1911 | DEBUGFS_ADD_FILE(clear_traffic_statistics, debug, S_IWUSR); | 1934 | DEBUGFS_ADD_FILE(clear_traffic_statistics, debug, S_IWUSR); |
1935 | DEBUGFS_ADD_FILE(csr, debug, S_IWUSR); | ||
1912 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { | 1936 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { |
1913 | DEBUGFS_ADD_FILE(ucode_rx_stats, debug, S_IRUSR); | 1937 | DEBUGFS_ADD_FILE(ucode_rx_stats, debug, S_IRUSR); |
1914 | DEBUGFS_ADD_FILE(ucode_tx_stats, debug, S_IRUSR); | 1938 | DEBUGFS_ADD_FILE(ucode_tx_stats, debug, S_IRUSR); |
@@ -1966,6 +1990,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv) | |||
1966 | file_clear_ucode_statistics); | 1990 | file_clear_ucode_statistics); |
1967 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. | 1991 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. |
1968 | file_clear_traffic_statistics); | 1992 | file_clear_traffic_statistics); |
1993 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_csr); | ||
1969 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { | 1994 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { |
1970 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. | 1995 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. |
1971 | file_ucode_rx_stats); | 1996 | file_ucode_rx_stats); |