aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index a198bcf6102..1794b9c4e6a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -383,6 +383,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
383 int pos = 0, ofs = 0, buf_size = 0; 383 int pos = 0, ofs = 0, buf_size = 0;
384 const u8 *ptr; 384 const u8 *ptr;
385 char *buf; 385 char *buf;
386 u16 eeprom_ver;
386 size_t eeprom_len = priv->cfg->eeprom_size; 387 size_t eeprom_len = priv->cfg->eeprom_size;
387 buf_size = 4 * eeprom_len + 256; 388 buf_size = 4 * eeprom_len + 256;
388 389
@@ -403,9 +404,11 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
403 IWL_ERR(priv, "Can not allocate Buffer\n"); 404 IWL_ERR(priv, "Can not allocate Buffer\n");
404 return -ENOMEM; 405 return -ENOMEM;
405 } 406 }
406 pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n", 407 eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION);
408 pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s, "
409 "version: 0x%x\n",
407 (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) 410 (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP)
408 ? "OTP" : "EEPROM"); 411 ? "OTP" : "EEPROM", eeprom_ver);
409 for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) { 412 for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) {
410 pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs); 413 pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs);
411 hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos, 414 hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos,
@@ -532,6 +535,8 @@ static ssize_t iwl_dbgfs_status_read(struct file *file,
532 test_bit(STATUS_INT_ENABLED, &priv->status)); 535 test_bit(STATUS_INT_ENABLED, &priv->status));
533 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_RF_KILL_HW:\t %d\n", 536 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_RF_KILL_HW:\t %d\n",
534 test_bit(STATUS_RF_KILL_HW, &priv->status)); 537 test_bit(STATUS_RF_KILL_HW, &priv->status));
538 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_CT_KILL:\t\t %d\n",
539 test_bit(STATUS_CT_KILL, &priv->status));
535 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_INIT:\t\t %d\n", 540 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_INIT:\t\t %d\n",
536 test_bit(STATUS_INIT, &priv->status)); 541 test_bit(STATUS_INIT, &priv->status));
537 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_ALIVE:\t\t %d\n", 542 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_ALIVE:\t\t %d\n",
@@ -672,7 +677,6 @@ static ssize_t iwl_dbgfs_qos_read(struct file *file, char __user *user_buf,
672 return ret; 677 return ret;
673} 678}
674 679
675#ifdef CONFIG_IWLWIFI_LEDS
676static ssize_t iwl_dbgfs_led_read(struct file *file, char __user *user_buf, 680static ssize_t iwl_dbgfs_led_read(struct file *file, char __user *user_buf,
677 size_t count, loff_t *ppos) 681 size_t count, loff_t *ppos)
678{ 682{
@@ -697,7 +701,6 @@ static ssize_t iwl_dbgfs_led_read(struct file *file, char __user *user_buf,
697 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); 701 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
698 return ret; 702 return ret;
699} 703}
700#endif
701 704
702static ssize_t iwl_dbgfs_thermal_throttling_read(struct file *file, 705static ssize_t iwl_dbgfs_thermal_throttling_read(struct file *file,
703 char __user *user_buf, 706 char __user *user_buf,
@@ -861,9 +864,7 @@ DEBUGFS_READ_FILE_OPS(channels);
861DEBUGFS_READ_FILE_OPS(status); 864DEBUGFS_READ_FILE_OPS(status);
862DEBUGFS_READ_WRITE_FILE_OPS(interrupt); 865DEBUGFS_READ_WRITE_FILE_OPS(interrupt);
863DEBUGFS_READ_FILE_OPS(qos); 866DEBUGFS_READ_FILE_OPS(qos);
864#ifdef CONFIG_IWLWIFI_LEDS
865DEBUGFS_READ_FILE_OPS(led); 867DEBUGFS_READ_FILE_OPS(led);
866#endif
867DEBUGFS_READ_FILE_OPS(thermal_throttling); 868DEBUGFS_READ_FILE_OPS(thermal_throttling);
868DEBUGFS_READ_WRITE_FILE_OPS(disable_ht40); 869DEBUGFS_READ_WRITE_FILE_OPS(disable_ht40);
869DEBUGFS_READ_WRITE_FILE_OPS(sleep_level_override); 870DEBUGFS_READ_WRITE_FILE_OPS(sleep_level_override);
@@ -1661,9 +1662,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
1661 DEBUGFS_ADD_FILE(status, data); 1662 DEBUGFS_ADD_FILE(status, data);
1662 DEBUGFS_ADD_FILE(interrupt, data); 1663 DEBUGFS_ADD_FILE(interrupt, data);
1663 DEBUGFS_ADD_FILE(qos, data); 1664 DEBUGFS_ADD_FILE(qos, data);
1664#ifdef CONFIG_IWLWIFI_LEDS
1665 DEBUGFS_ADD_FILE(led, data); 1665 DEBUGFS_ADD_FILE(led, data);
1666#endif
1667 DEBUGFS_ADD_FILE(sleep_level_override, data); 1666 DEBUGFS_ADD_FILE(sleep_level_override, data);
1668 DEBUGFS_ADD_FILE(current_sleep_command, data); 1667 DEBUGFS_ADD_FILE(current_sleep_command, data);
1669 DEBUGFS_ADD_FILE(thermal_throttling, data); 1668 DEBUGFS_ADD_FILE(thermal_throttling, data);
@@ -1716,9 +1715,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv)
1716 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_status); 1715 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_status);
1717 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_interrupt); 1716 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_interrupt);
1718 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_qos); 1717 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_qos);
1719#ifdef CONFIG_IWLWIFI_LEDS
1720 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_led); 1718 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_led);
1721#endif
1722 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_thermal_throttling); 1719 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_thermal_throttling);
1723 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_disable_ht40); 1720 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_disable_ht40);
1724 DEBUGFS_REMOVE(priv->dbgfs->dir_data); 1721 DEBUGFS_REMOVE(priv->dbgfs->dir_data);