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.c53
1 files changed, 18 insertions, 35 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 92f6efd2c73f..c272204fccff 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -437,8 +437,7 @@ static ssize_t iwl_dbgfs_log_event_read(struct file *file,
437 int pos = 0; 437 int pos = 0;
438 ssize_t ret = -ENOMEM; 438 ssize_t ret = -ENOMEM;
439 439
440 ret = pos = priv->cfg->ops->lib->dump_nic_event_log( 440 ret = pos = iwl_dump_nic_event_log(priv, true, &buf, true);
441 priv, true, &buf, true);
442 if (buf) { 441 if (buf) {
443 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); 442 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
444 kfree(buf); 443 kfree(buf);
@@ -462,8 +461,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
462 if (sscanf(buf, "%d", &event_log_flag) != 1) 461 if (sscanf(buf, "%d", &event_log_flag) != 1)
463 return -EFAULT; 462 return -EFAULT;
464 if (event_log_flag == 1) 463 if (event_log_flag == 1)
465 priv->cfg->ops->lib->dump_nic_event_log(priv, true, 464 iwl_dump_nic_event_log(priv, true, NULL, false);
466 NULL, false);
467 465
468 return count; 466 return count;
469} 467}
@@ -1268,8 +1266,7 @@ static ssize_t iwl_dbgfs_csr_write(struct file *file,
1268 if (sscanf(buf, "%d", &csr) != 1) 1266 if (sscanf(buf, "%d", &csr) != 1)
1269 return -EFAULT; 1267 return -EFAULT;
1270 1268
1271 if (priv->cfg->ops->lib->dump_csr) 1269 iwl_dump_csr(priv);
1272 priv->cfg->ops->lib->dump_csr(priv);
1273 1270
1274 return count; 1271 return count;
1275} 1272}
@@ -1359,13 +1356,11 @@ static ssize_t iwl_dbgfs_fh_reg_read(struct file *file,
1359 int pos = 0; 1356 int pos = 0;
1360 ssize_t ret = -EFAULT; 1357 ssize_t ret = -EFAULT;
1361 1358
1362 if (priv->cfg->ops->lib->dump_fh) { 1359 ret = pos = iwl_dump_fh(priv, &buf, true);
1363 ret = pos = priv->cfg->ops->lib->dump_fh(priv, &buf, true); 1360 if (buf) {
1364 if (buf) { 1361 ret = simple_read_from_buffer(user_buf,
1365 ret = simple_read_from_buffer(user_buf, 1362 count, ppos, buf, pos);
1366 count, ppos, buf, pos); 1363 kfree(buf);
1367 kfree(buf);
1368 }
1369 } 1364 }
1370 1365
1371 return ret; 1366 return ret;
@@ -1728,11 +1723,8 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
1728 DEBUGFS_ADD_FILE(status, dir_data, S_IRUSR); 1723 DEBUGFS_ADD_FILE(status, dir_data, S_IRUSR);
1729 DEBUGFS_ADD_FILE(interrupt, dir_data, S_IWUSR | S_IRUSR); 1724 DEBUGFS_ADD_FILE(interrupt, dir_data, S_IWUSR | S_IRUSR);
1730 DEBUGFS_ADD_FILE(qos, dir_data, S_IRUSR); 1725 DEBUGFS_ADD_FILE(qos, dir_data, S_IRUSR);
1731 if (!priv->cfg->base_params->broken_powersave) { 1726 DEBUGFS_ADD_FILE(sleep_level_override, dir_data, S_IWUSR | S_IRUSR);
1732 DEBUGFS_ADD_FILE(sleep_level_override, dir_data, 1727 DEBUGFS_ADD_FILE(current_sleep_command, dir_data, S_IRUSR);
1733 S_IWUSR | S_IRUSR);
1734 DEBUGFS_ADD_FILE(current_sleep_command, dir_data, S_IRUSR);
1735 }
1736 DEBUGFS_ADD_FILE(thermal_throttling, dir_data, S_IRUSR); 1728 DEBUGFS_ADD_FILE(thermal_throttling, dir_data, S_IRUSR);
1737 DEBUGFS_ADD_FILE(disable_ht40, dir_data, S_IWUSR | S_IRUSR); 1729 DEBUGFS_ADD_FILE(disable_ht40, dir_data, S_IWUSR | S_IRUSR);
1738 DEBUGFS_ADD_FILE(rx_statistics, dir_debug, S_IRUSR); 1730 DEBUGFS_ADD_FILE(rx_statistics, dir_debug, S_IRUSR);
@@ -1755,29 +1747,20 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
1755 DEBUGFS_ADD_FILE(txfifo_flush, dir_debug, S_IWUSR); 1747 DEBUGFS_ADD_FILE(txfifo_flush, dir_debug, S_IWUSR);
1756 DEBUGFS_ADD_FILE(protection_mode, dir_debug, S_IWUSR | S_IRUSR); 1748 DEBUGFS_ADD_FILE(protection_mode, dir_debug, S_IWUSR | S_IRUSR);
1757 1749
1758 if (priv->cfg->base_params->sensitivity_calib_by_driver) 1750 DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR);
1759 DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR); 1751 DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR);
1760 if (priv->cfg->base_params->chain_noise_calib_by_driver) 1752 DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR);
1761 DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR); 1753 DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR);
1762 if (priv->cfg->base_params->ucode_tracing)
1763 DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR);
1764 if (iwl_bt_statistics(priv))
1765 DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR);
1766 DEBUGFS_ADD_FILE(reply_tx_error, dir_debug, S_IRUSR); 1754 DEBUGFS_ADD_FILE(reply_tx_error, dir_debug, S_IRUSR);
1767 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); 1755 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
1768 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); 1756 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
1769 DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR); 1757 DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR);
1770 if (iwl_advanced_bt_coexist(priv)) 1758 if (iwl_advanced_bt_coexist(priv))
1771 DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); 1759 DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR);
1772 if (priv->cfg->base_params->sensitivity_calib_by_driver) 1760 DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf,
1773 DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, 1761 &priv->disable_sens_cal);
1774 &priv->disable_sens_cal); 1762 DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf,
1775 if (priv->cfg->base_params->chain_noise_calib_by_driver) 1763 &priv->disable_chain_noise_cal);
1776 DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf,
1777 &priv->disable_chain_noise_cal);
1778 if (priv->cfg->base_params->tx_power_by_driver)
1779 DEBUGFS_ADD_BOOL(disable_tx_power, dir_rf,
1780 &priv->disable_tx_power_cal);
1781 return 0; 1764 return 0;
1782 1765
1783err: 1766err: