diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-03-24 13:02:54 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-27 20:13:20 -0400 |
commit | 08df05aa9b25f3079585855506022bb33a011183 (patch) | |
tree | b42e7b57158fe59fb357c2aa3111190533379ae4 /drivers | |
parent | dd970e43d86c253ff159d9668499aaf42d175722 (diff) |
iwlwifi: show current driver status in user readable format
change the display of current driver status bit to user readable format
for better and easier debugging
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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 36cfeccfafbc..64eb585f1578 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -425,6 +425,56 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf, | |||
425 | return ret; | 425 | return ret; |
426 | } | 426 | } |
427 | 427 | ||
428 | static ssize_t iwl_dbgfs_status_read(struct file *file, | ||
429 | char __user *user_buf, | ||
430 | size_t count, loff_t *ppos) { | ||
431 | |||
432 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | ||
433 | char buf[512]; | ||
434 | int pos = 0; | ||
435 | const size_t bufsz = sizeof(buf); | ||
436 | |||
437 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_HCMD_ACTIVE:\t %d\n", | ||
438 | test_bit(STATUS_HCMD_ACTIVE, &priv->status)); | ||
439 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_HCMD_SYNC_ACTIVE: %d\n", | ||
440 | test_bit(STATUS_HCMD_SYNC_ACTIVE, &priv->status)); | ||
441 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_INT_ENABLED:\t %d\n", | ||
442 | test_bit(STATUS_INT_ENABLED, &priv->status)); | ||
443 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_RF_KILL_HW:\t %d\n", | ||
444 | test_bit(STATUS_RF_KILL_HW, &priv->status)); | ||
445 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_RF_KILL_SW:\t %d\n", | ||
446 | test_bit(STATUS_RF_KILL_SW, &priv->status)); | ||
447 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_INIT:\t\t %d\n", | ||
448 | test_bit(STATUS_INIT, &priv->status)); | ||
449 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_ALIVE:\t\t %d\n", | ||
450 | test_bit(STATUS_ALIVE, &priv->status)); | ||
451 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_READY:\t\t %d\n", | ||
452 | test_bit(STATUS_READY, &priv->status)); | ||
453 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_TEMPERATURE:\t %d\n", | ||
454 | test_bit(STATUS_TEMPERATURE, &priv->status)); | ||
455 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_GEO_CONFIGURED:\t %d\n", | ||
456 | test_bit(STATUS_GEO_CONFIGURED, &priv->status)); | ||
457 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_EXIT_PENDING:\t %d\n", | ||
458 | test_bit(STATUS_EXIT_PENDING, &priv->status)); | ||
459 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_IN_SUSPEND:\t %d\n", | ||
460 | test_bit(STATUS_IN_SUSPEND, &priv->status)); | ||
461 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_STATISTICS:\t %d\n", | ||
462 | test_bit(STATUS_STATISTICS, &priv->status)); | ||
463 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_SCANNING:\t %d\n", | ||
464 | test_bit(STATUS_SCANNING, &priv->status)); | ||
465 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_SCAN_ABORTING:\t %d\n", | ||
466 | test_bit(STATUS_SCAN_ABORTING, &priv->status)); | ||
467 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_SCAN_HW:\t\t %d\n", | ||
468 | test_bit(STATUS_SCAN_HW, &priv->status)); | ||
469 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_POWER_PMI:\t %d\n", | ||
470 | test_bit(STATUS_POWER_PMI, &priv->status)); | ||
471 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_FW_ERROR:\t %d\n", | ||
472 | test_bit(STATUS_FW_ERROR, &priv->status)); | ||
473 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_MODE_PENDING:\t %d\n", | ||
474 | test_bit(STATUS_MODE_PENDING, &priv->status)); | ||
475 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
476 | } | ||
477 | |||
428 | DEBUGFS_READ_WRITE_FILE_OPS(sram); | 478 | DEBUGFS_READ_WRITE_FILE_OPS(sram); |
429 | DEBUGFS_WRITE_FILE_OPS(log_event); | 479 | DEBUGFS_WRITE_FILE_OPS(log_event); |
430 | DEBUGFS_READ_FILE_OPS(eeprom); | 480 | DEBUGFS_READ_FILE_OPS(eeprom); |
@@ -432,6 +482,7 @@ DEBUGFS_READ_FILE_OPS(stations); | |||
432 | DEBUGFS_READ_FILE_OPS(rx_statistics); | 482 | DEBUGFS_READ_FILE_OPS(rx_statistics); |
433 | DEBUGFS_READ_FILE_OPS(tx_statistics); | 483 | DEBUGFS_READ_FILE_OPS(tx_statistics); |
434 | DEBUGFS_READ_FILE_OPS(channels); | 484 | DEBUGFS_READ_FILE_OPS(channels); |
485 | DEBUGFS_READ_FILE_OPS(status); | ||
435 | 486 | ||
436 | /* | 487 | /* |
437 | * Create the debugfs files and directories | 488 | * Create the debugfs files and directories |
@@ -466,7 +517,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
466 | DEBUGFS_ADD_FILE(rx_statistics, data); | 517 | DEBUGFS_ADD_FILE(rx_statistics, data); |
467 | DEBUGFS_ADD_FILE(tx_statistics, data); | 518 | DEBUGFS_ADD_FILE(tx_statistics, data); |
468 | DEBUGFS_ADD_FILE(channels, data); | 519 | DEBUGFS_ADD_FILE(channels, data); |
469 | DEBUGFS_ADD_X32(status, data, (u32 *)&priv->status); | 520 | DEBUGFS_ADD_FILE(status, data); |
470 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); | 521 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); |
471 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, | 522 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, |
472 | &priv->disable_chain_noise_cal); | 523 | &priv->disable_chain_noise_cal); |
@@ -496,6 +547,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv) | |||
496 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_log_event); | 547 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_log_event); |
497 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_stations); | 548 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_stations); |
498 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_channels); | 549 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_channels); |
550 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_status); | ||
499 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); | 551 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); |
500 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); | 552 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); |
501 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); | 553 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); |