diff options
author | Ester Kummer <ester.kummer@intel.com> | 2008-05-15 01:54:18 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-21 21:48:07 -0400 |
commit | 189a2b5942d62bd18e1e01772c4c784253f5dd16 (patch) | |
tree | d5f85b77bccc796651d73243db76aa717d1f309c /drivers/net/wireless/iwlwifi/iwl-debugfs.c | |
parent | 6ba879562289bcad537a2374754ef750307c7d32 (diff) |
iwlwifi: trigger event log from debugfs
This patch adds a trigger for event log printing to debugfs.
It removes the triger from sysfs.
Signed-off-by: Ester Kummer <ester.kummer@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@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 | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index f7ec2009cdf9..c64e602bc9b6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -92,6 +92,14 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \ | |||
92 | .open = iwl_dbgfs_open_file_generic, \ | 92 | .open = iwl_dbgfs_open_file_generic, \ |
93 | }; | 93 | }; |
94 | 94 | ||
95 | #define DEBUGFS_WRITE_FILE_OPS(name) \ | ||
96 | DEBUGFS_WRITE_FUNC(name); \ | ||
97 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ | ||
98 | .write = iwl_dbgfs_##name##_write, \ | ||
99 | .open = iwl_dbgfs_open_file_generic, \ | ||
100 | }; | ||
101 | |||
102 | |||
95 | #define DEBUGFS_READ_WRITE_FILE_OPS(name) \ | 103 | #define DEBUGFS_READ_WRITE_FILE_OPS(name) \ |
96 | DEBUGFS_READ_FUNC(name); \ | 104 | DEBUGFS_READ_FUNC(name); \ |
97 | DEBUGFS_WRITE_FUNC(name); \ | 105 | DEBUGFS_WRITE_FUNC(name); \ |
@@ -324,7 +332,29 @@ static ssize_t iwl_dbgfs_eeprom_read(struct file *file, | |||
324 | return ret; | 332 | return ret; |
325 | } | 333 | } |
326 | 334 | ||
335 | static ssize_t iwl_dbgfs_log_event_write(struct file *file, | ||
336 | const char __user *user_buf, | ||
337 | size_t count, loff_t *ppos) | ||
338 | { | ||
339 | struct iwl_priv *priv = file->private_data; | ||
340 | u32 event_log_flag; | ||
341 | char buf[8]; | ||
342 | int buf_size; | ||
343 | |||
344 | memset(buf, 0, sizeof(buf)); | ||
345 | buf_size = min(count, sizeof(buf) - 1); | ||
346 | if (copy_from_user(buf, user_buf, buf_size)) | ||
347 | return -EFAULT; | ||
348 | if (sscanf(buf, "%d", &event_log_flag) != 1) | ||
349 | return -EFAULT; | ||
350 | if (event_log_flag == 1) | ||
351 | iwl_dump_nic_event_log(priv); | ||
352 | |||
353 | return count; | ||
354 | } | ||
355 | |||
327 | DEBUGFS_READ_WRITE_FILE_OPS(sram); | 356 | DEBUGFS_READ_WRITE_FILE_OPS(sram); |
357 | DEBUGFS_WRITE_FILE_OPS(log_event); | ||
328 | DEBUGFS_READ_FILE_OPS(eeprom); | 358 | DEBUGFS_READ_FILE_OPS(eeprom); |
329 | DEBUGFS_READ_FILE_OPS(stations); | 359 | DEBUGFS_READ_FILE_OPS(stations); |
330 | DEBUGFS_READ_FILE_OPS(rx_statistics); | 360 | DEBUGFS_READ_FILE_OPS(rx_statistics); |
@@ -354,6 +384,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
354 | DEBUGFS_ADD_DIR(rf, dbgfs->dir_drv); | 384 | DEBUGFS_ADD_DIR(rf, dbgfs->dir_drv); |
355 | DEBUGFS_ADD_FILE(eeprom, data); | 385 | DEBUGFS_ADD_FILE(eeprom, data); |
356 | DEBUGFS_ADD_FILE(sram, data); | 386 | DEBUGFS_ADD_FILE(sram, data); |
387 | DEBUGFS_ADD_FILE(log_event, data); | ||
357 | DEBUGFS_ADD_FILE(stations, data); | 388 | DEBUGFS_ADD_FILE(stations, data); |
358 | DEBUGFS_ADD_FILE(rx_statistics, data); | 389 | DEBUGFS_ADD_FILE(rx_statistics, data); |
359 | DEBUGFS_ADD_FILE(tx_statistics, data); | 390 | DEBUGFS_ADD_FILE(tx_statistics, data); |
@@ -384,6 +415,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv) | |||
384 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_rx_statistics); | 415 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_rx_statistics); |
385 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_tx_statistics); | 416 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_tx_statistics); |
386 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_sram); | 417 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_sram); |
418 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_log_event); | ||
387 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_stations); | 419 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_stations); |
388 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); | 420 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); |
389 | #ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB | 421 | #ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB |