aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-debugfs.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-12-14 17:12:20 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-21 18:56:18 -0500
commitb03d7d0fd3d23b7cf130fa702f4ae3b1bc827d4b (patch)
treef841ac15c38fe72b53bd80339962d7677d5b3566 /drivers/net/wireless/iwlwifi/iwl-debugfs.c
parenta9e1cb6a78ea8a74c49bf76726a2942f636a833b (diff)
iwlwifi: on-screen event log dump
This feature enables the on-screen uCode event log dump. The original method will append the event log to syslog; with this capability, we also enable the user to write script to capture the events which provide additional flexibility to help uCode debugging Method 1) change to debugfs directory (sys/kernel/debug/phyX/iwlagn/data) 2) #cat log_event 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.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 822de46e4f34..ee5aed12a4b1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -420,6 +420,23 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
420 return ret; 420 return ret;
421} 421}
422 422
423static ssize_t iwl_dbgfs_log_event_read(struct file *file,
424 char __user *user_buf,
425 size_t count, loff_t *ppos)
426{
427 struct iwl_priv *priv = file->private_data;
428 char *buf;
429 int pos = 0;
430 ssize_t ret = -ENOMEM;
431
432 pos = priv->cfg->ops->lib->dump_nic_event_log(priv, true, &buf, true);
433 if (pos && buf) {
434 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
435 kfree(buf);
436 }
437 return ret;
438}
439
423static ssize_t iwl_dbgfs_log_event_write(struct file *file, 440static ssize_t iwl_dbgfs_log_event_write(struct file *file,
424 const char __user *user_buf, 441 const char __user *user_buf,
425 size_t count, loff_t *ppos) 442 size_t count, loff_t *ppos)
@@ -436,7 +453,8 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
436 if (sscanf(buf, "%d", &event_log_flag) != 1) 453 if (sscanf(buf, "%d", &event_log_flag) != 1)
437 return -EFAULT; 454 return -EFAULT;
438 if (event_log_flag == 1) 455 if (event_log_flag == 1)
439 priv->cfg->ops->lib->dump_nic_event_log(priv, true); 456 priv->cfg->ops->lib->dump_nic_event_log(priv, true,
457 NULL, false);
440 458
441 return count; 459 return count;
442} 460}
@@ -859,7 +877,7 @@ static ssize_t iwl_dbgfs_current_sleep_command_read(struct file *file,
859} 877}
860 878
861DEBUGFS_READ_WRITE_FILE_OPS(sram); 879DEBUGFS_READ_WRITE_FILE_OPS(sram);
862DEBUGFS_WRITE_FILE_OPS(log_event); 880DEBUGFS_READ_WRITE_FILE_OPS(log_event);
863DEBUGFS_READ_FILE_OPS(nvm); 881DEBUGFS_READ_FILE_OPS(nvm);
864DEBUGFS_READ_FILE_OPS(stations); 882DEBUGFS_READ_FILE_OPS(stations);
865DEBUGFS_READ_FILE_OPS(channels); 883DEBUGFS_READ_FILE_OPS(channels);
@@ -1965,7 +1983,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
1965 DEBUGFS_ADD_DIR(debug, dbgfs->dir_drv); 1983 DEBUGFS_ADD_DIR(debug, dbgfs->dir_drv);
1966 DEBUGFS_ADD_FILE(nvm, data, S_IRUSR); 1984 DEBUGFS_ADD_FILE(nvm, data, S_IRUSR);
1967 DEBUGFS_ADD_FILE(sram, data, S_IWUSR | S_IRUSR); 1985 DEBUGFS_ADD_FILE(sram, data, S_IWUSR | S_IRUSR);
1968 DEBUGFS_ADD_FILE(log_event, data, S_IWUSR); 1986 DEBUGFS_ADD_FILE(log_event, data, S_IWUSR | S_IRUSR);
1969 DEBUGFS_ADD_FILE(stations, data, S_IRUSR); 1987 DEBUGFS_ADD_FILE(stations, data, S_IRUSR);
1970 DEBUGFS_ADD_FILE(channels, data, S_IRUSR); 1988 DEBUGFS_ADD_FILE(channels, data, S_IRUSR);
1971 DEBUGFS_ADD_FILE(status, data, S_IRUSR); 1989 DEBUGFS_ADD_FILE(status, data, S_IRUSR);