aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c73
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debug.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c25
7 files changed, 105 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 8414178bcff4..9d4fdd7a1134 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -105,6 +105,7 @@ static struct iwl_lib_ops iwl1000_lib = {
105 .load_ucode = iwl5000_load_ucode, 105 .load_ucode = iwl5000_load_ucode,
106 .dump_nic_event_log = iwl_dump_nic_event_log, 106 .dump_nic_event_log = iwl_dump_nic_event_log,
107 .dump_nic_error_log = iwl_dump_nic_error_log, 107 .dump_nic_error_log = iwl_dump_nic_error_log,
108 .dump_csr = iwl_dump_csr,
108 .init_alive_start = iwl5000_init_alive_start, 109 .init_alive_start = iwl5000_init_alive_start,
109 .alive_notify = iwl5000_alive_notify, 110 .alive_notify = iwl5000_alive_notify,
110 .send_tx_power = iwl5000_send_tx_power, 111 .send_tx_power = iwl5000_send_tx_power,
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index e2f8615c8c9b..5a277cdffd07 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -1465,6 +1465,7 @@ struct iwl_lib_ops iwl5000_lib = {
1465 .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr, 1465 .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr,
1466 .dump_nic_event_log = iwl_dump_nic_event_log, 1466 .dump_nic_event_log = iwl_dump_nic_event_log,
1467 .dump_nic_error_log = iwl_dump_nic_error_log, 1467 .dump_nic_error_log = iwl_dump_nic_error_log,
1468 .dump_csr = iwl_dump_csr,
1468 .load_ucode = iwl5000_load_ucode, 1469 .load_ucode = iwl5000_load_ucode,
1469 .init_alive_start = iwl5000_init_alive_start, 1470 .init_alive_start = iwl5000_init_alive_start,
1470 .alive_notify = iwl5000_alive_notify, 1471 .alive_notify = iwl5000_alive_notify,
@@ -1517,6 +1518,7 @@ static struct iwl_lib_ops iwl5150_lib = {
1517 .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr, 1518 .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr,
1518 .dump_nic_event_log = iwl_dump_nic_event_log, 1519 .dump_nic_event_log = iwl_dump_nic_event_log,
1519 .dump_nic_error_log = iwl_dump_nic_error_log, 1520 .dump_nic_error_log = iwl_dump_nic_error_log,
1521 .dump_csr = iwl_dump_csr,
1520 .load_ucode = iwl5000_load_ucode, 1522 .load_ucode = iwl5000_load_ucode,
1521 .init_alive_start = iwl5000_init_alive_start, 1523 .init_alive_start = iwl5000_init_alive_start,
1522 .alive_notify = iwl5000_alive_notify, 1524 .alive_notify = iwl5000_alive_notify,
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 74e571049273..fec43771c49e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -215,6 +215,7 @@ static struct iwl_lib_ops iwl6000_lib = {
215 .load_ucode = iwl5000_load_ucode, 215 .load_ucode = iwl5000_load_ucode,
216 .dump_nic_event_log = iwl_dump_nic_event_log, 216 .dump_nic_event_log = iwl_dump_nic_event_log,
217 .dump_nic_error_log = iwl_dump_nic_error_log, 217 .dump_nic_error_log = iwl_dump_nic_error_log,
218 .dump_csr = iwl_dump_csr,
218 .init_alive_start = iwl5000_init_alive_start, 219 .init_alive_start = iwl5000_init_alive_start,
219 .alive_notify = iwl5000_alive_notify, 220 .alive_notify = iwl5000_alive_notify,
220 .send_tx_power = iwl5000_send_tx_power, 221 .send_tx_power = iwl5000_send_tx_power,
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 574d36658702..47ece91e4505 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1363,6 +1363,8 @@ void iwl_irq_handle_error(struct iwl_priv *priv)
1363 clear_bit(STATUS_HCMD_ACTIVE, &priv->status); 1363 clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
1364 1364
1365 priv->cfg->ops->lib->dump_nic_error_log(priv); 1365 priv->cfg->ops->lib->dump_nic_error_log(priv);
1366 if (priv->cfg->ops->lib->dump_csr)
1367 priv->cfg->ops->lib->dump_csr(priv);
1366 priv->cfg->ops->lib->dump_nic_event_log(priv, false); 1368 priv->cfg->ops->lib->dump_nic_event_log(priv, false);
1367#ifdef CONFIG_IWLWIFI_DEBUG 1369#ifdef CONFIG_IWLWIFI_DEBUG
1368 if (iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) 1370 if (iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS)
@@ -3191,6 +3193,77 @@ void iwl_update_stats(struct iwl_priv *priv, bool is_tx, __le16 fc, u16 len)
3191EXPORT_SYMBOL(iwl_update_stats); 3193EXPORT_SYMBOL(iwl_update_stats);
3192#endif 3194#endif
3193 3195
3196const static char *get_csr_string(int cmd)
3197{
3198 switch (cmd) {
3199 IWL_CMD(CSR_HW_IF_CONFIG_REG);
3200 IWL_CMD(CSR_INT_COALESCING);
3201 IWL_CMD(CSR_INT);
3202 IWL_CMD(CSR_INT_MASK);
3203 IWL_CMD(CSR_FH_INT_STATUS);
3204 IWL_CMD(CSR_GPIO_IN);
3205 IWL_CMD(CSR_RESET);
3206 IWL_CMD(CSR_GP_CNTRL);
3207 IWL_CMD(CSR_HW_REV);
3208 IWL_CMD(CSR_EEPROM_REG);
3209 IWL_CMD(CSR_EEPROM_GP);
3210 IWL_CMD(CSR_OTP_GP_REG);
3211 IWL_CMD(CSR_GIO_REG);
3212 IWL_CMD(CSR_GP_UCODE_REG);
3213 IWL_CMD(CSR_GP_DRIVER_REG);
3214 IWL_CMD(CSR_UCODE_DRV_GP1);
3215 IWL_CMD(CSR_UCODE_DRV_GP2);
3216 IWL_CMD(CSR_LED_REG);
3217 IWL_CMD(CSR_DRAM_INT_TBL_REG);
3218 IWL_CMD(CSR_GIO_CHICKEN_BITS);
3219 IWL_CMD(CSR_ANA_PLL_CFG);
3220 IWL_CMD(CSR_HW_REV_WA_REG);
3221 IWL_CMD(CSR_DBG_HPET_MEM_REG);
3222 default:
3223 return "UNKNOWN";
3224
3225 }
3226}
3227
3228void iwl_dump_csr(struct iwl_priv *priv)
3229{
3230 int i;
3231 u32 csr_tbl[] = {
3232 CSR_HW_IF_CONFIG_REG,
3233 CSR_INT_COALESCING,
3234 CSR_INT,
3235 CSR_INT_MASK,
3236 CSR_FH_INT_STATUS,
3237 CSR_GPIO_IN,
3238 CSR_RESET,
3239 CSR_GP_CNTRL,
3240 CSR_HW_REV,
3241 CSR_EEPROM_REG,
3242 CSR_EEPROM_GP,
3243 CSR_OTP_GP_REG,
3244 CSR_GIO_REG,
3245 CSR_GP_UCODE_REG,
3246 CSR_GP_DRIVER_REG,
3247 CSR_UCODE_DRV_GP1,
3248 CSR_UCODE_DRV_GP2,
3249 CSR_LED_REG,
3250 CSR_DRAM_INT_TBL_REG,
3251 CSR_GIO_CHICKEN_BITS,
3252 CSR_ANA_PLL_CFG,
3253 CSR_HW_REV_WA_REG,
3254 CSR_DBG_HPET_MEM_REG
3255 };
3256 IWL_ERR(priv, "CSR values:\n");
3257 IWL_ERR(priv, "(2nd byte of CSR_INT_COALESCING is "
3258 "CSR_INT_PERIODIC_REG)\n");
3259 for (i = 0; i < ARRAY_SIZE(csr_tbl); i++) {
3260 IWL_ERR(priv, " %25s: 0X%08x\n",
3261 get_csr_string(csr_tbl[i]),
3262 iwl_read32(priv, csr_tbl[i]));
3263 }
3264}
3265EXPORT_SYMBOL(iwl_dump_csr);
3266
3194#ifdef CONFIG_PM 3267#ifdef CONFIG_PM
3195 3268
3196int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) 3269int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 675b7df632fc..f5e79cf0a318 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -171,6 +171,7 @@ struct iwl_lib_ops {
171 int (*load_ucode)(struct iwl_priv *priv); 171 int (*load_ucode)(struct iwl_priv *priv);
172 void (*dump_nic_event_log)(struct iwl_priv *priv, bool full_log); 172 void (*dump_nic_event_log)(struct iwl_priv *priv, bool full_log);
173 void (*dump_nic_error_log)(struct iwl_priv *priv); 173 void (*dump_nic_error_log)(struct iwl_priv *priv);
174 void (*dump_csr)(struct iwl_priv *priv);
174 int (*set_channel_switch)(struct iwl_priv *priv, u16 channel); 175 int (*set_channel_switch)(struct iwl_priv *priv, u16 channel);
175 /* power management */ 176 /* power management */
176 struct iwl_apm_ops apm_ops; 177 struct iwl_apm_ops apm_ops;
@@ -582,6 +583,7 @@ int iwl_pci_resume(struct pci_dev *pdev);
582******************************************************/ 583******************************************************/
583void iwl_dump_nic_error_log(struct iwl_priv *priv); 584void iwl_dump_nic_error_log(struct iwl_priv *priv);
584void iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log); 585void iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log);
586void iwl_dump_csr(struct iwl_priv *priv);
585#ifdef CONFIG_IWLWIFI_DEBUG 587#ifdef CONFIG_IWLWIFI_DEBUG
586void iwl_print_rx_config_cmd(struct iwl_priv *priv); 588void iwl_print_rx_config_cmd(struct iwl_priv *priv);
587#else 589#else
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index d61293ab67c9..86a67672598d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -109,6 +109,7 @@ struct iwl_debugfs {
109 struct dentry *file_power_save_status; 109 struct dentry *file_power_save_status;
110 struct dentry *file_clear_ucode_statistics; 110 struct dentry *file_clear_ucode_statistics;
111 struct dentry *file_clear_traffic_statistics; 111 struct dentry *file_clear_traffic_statistics;
112 struct dentry *file_csr;
112 } dbgfs_debug_files; 113 } dbgfs_debug_files;
113 u32 sram_offset; 114 u32 sram_offset;
114 u32 sram_len; 115 u32 sram_len;
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
1848static 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
1848DEBUGFS_READ_FILE_OPS(rx_statistics); 1870DEBUGFS_READ_FILE_OPS(rx_statistics);
1849DEBUGFS_READ_FILE_OPS(tx_statistics); 1871DEBUGFS_READ_FILE_OPS(tx_statistics);
1850DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); 1872DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
@@ -1859,6 +1881,7 @@ DEBUGFS_READ_FILE_OPS(tx_power);
1859DEBUGFS_READ_FILE_OPS(power_save_status); 1881DEBUGFS_READ_FILE_OPS(power_save_status);
1860DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics); 1882DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics);
1861DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics); 1883DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics);
1884DEBUGFS_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);