Commit 43e85115 authored by Wey-Yi Guy's avatar Wey-Yi Guy Committed by John W. Linville

iwlwifi: set read/write permission for debugfs files

Set the correct Read/Write file permission for iwlwifi debugfs files
based on the functionality of the files
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent bc6c94f6
...@@ -2964,16 +2964,16 @@ static void rs_add_debugfs(void *priv, void *priv_sta, ...@@ -2964,16 +2964,16 @@ static void rs_add_debugfs(void *priv, void *priv_sta,
{ {
struct iwl_lq_sta *lq_sta = priv_sta; struct iwl_lq_sta *lq_sta = priv_sta;
lq_sta->rs_sta_dbgfs_scale_table_file = lq_sta->rs_sta_dbgfs_scale_table_file =
debugfs_create_file("rate_scale_table", 0600, dir, debugfs_create_file("rate_scale_table", S_IRUSR | S_IWUSR, dir,
lq_sta, &rs_sta_dbgfs_scale_table_ops); lq_sta, &rs_sta_dbgfs_scale_table_ops);
lq_sta->rs_sta_dbgfs_stats_table_file = lq_sta->rs_sta_dbgfs_stats_table_file =
debugfs_create_file("rate_stats_table", 0600, dir, debugfs_create_file("rate_stats_table", S_IRUSR, dir,
lq_sta, &rs_sta_dbgfs_stats_table_ops); lq_sta, &rs_sta_dbgfs_stats_table_ops);
lq_sta->rs_sta_dbgfs_rate_scale_data_file = lq_sta->rs_sta_dbgfs_rate_scale_data_file =
debugfs_create_file("rate_scale_data", 0600, dir, debugfs_create_file("rate_scale_data", S_IRUSR, dir,
lq_sta, &rs_sta_dbgfs_rate_scale_data_ops); lq_sta, &rs_sta_dbgfs_rate_scale_data_ops);
lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file = lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file =
debugfs_create_u8("tx_agg_tid_enable", 0600, dir, debugfs_create_u8("tx_agg_tid_enable", S_IRUSR | S_IWUSR, dir,
&lq_sta->tx_agg_tid_en); &lq_sta->tx_agg_tid_en);
} }
......
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
goto err; \ goto err; \
} while (0) } while (0)
#define DEBUGFS_ADD_FILE(name, parent) do { \ #define DEBUGFS_ADD_FILE(name, parent, mode) do { \
dbgfs->dbgfs_##parent##_files.file_##name = \ dbgfs->dbgfs_##parent##_files.file_##name = \
debugfs_create_file(#name, S_IWUSR | S_IRUSR, \ debugfs_create_file(#name, mode, \
dbgfs->dir_##parent, priv, \ dbgfs->dir_##parent, priv, \
&iwl_dbgfs_##name##_ops); \ &iwl_dbgfs_##name##_ops); \
if (!(dbgfs->dbgfs_##parent##_files.file_##name)) \ if (!(dbgfs->dbgfs_##parent##_files.file_##name)) \
...@@ -1868,34 +1868,34 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) ...@@ -1868,34 +1868,34 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
DEBUGFS_ADD_DIR(data, dbgfs->dir_drv); DEBUGFS_ADD_DIR(data, dbgfs->dir_drv);
DEBUGFS_ADD_DIR(rf, dbgfs->dir_drv); DEBUGFS_ADD_DIR(rf, dbgfs->dir_drv);
DEBUGFS_ADD_DIR(debug, dbgfs->dir_drv); DEBUGFS_ADD_DIR(debug, dbgfs->dir_drv);
DEBUGFS_ADD_FILE(nvm, data); DEBUGFS_ADD_FILE(nvm, data, S_IRUSR);
DEBUGFS_ADD_FILE(sram, data); DEBUGFS_ADD_FILE(sram, data, S_IWUSR | S_IRUSR);
DEBUGFS_ADD_FILE(log_event, data); DEBUGFS_ADD_FILE(log_event, data, S_IWUSR);
DEBUGFS_ADD_FILE(stations, data); DEBUGFS_ADD_FILE(stations, data, S_IRUSR);
DEBUGFS_ADD_FILE(channels, data); DEBUGFS_ADD_FILE(channels, data, S_IRUSR);
DEBUGFS_ADD_FILE(status, data); DEBUGFS_ADD_FILE(status, data, S_IRUSR);
DEBUGFS_ADD_FILE(interrupt, data); DEBUGFS_ADD_FILE(interrupt, data, S_IWUSR | S_IRUSR);
DEBUGFS_ADD_FILE(qos, data); DEBUGFS_ADD_FILE(qos, data, S_IRUSR);
DEBUGFS_ADD_FILE(led, data); DEBUGFS_ADD_FILE(led, data, S_IRUSR);
DEBUGFS_ADD_FILE(sleep_level_override, data); DEBUGFS_ADD_FILE(sleep_level_override, data, S_IWUSR | S_IRUSR);
DEBUGFS_ADD_FILE(current_sleep_command, data); DEBUGFS_ADD_FILE(current_sleep_command, data, S_IRUSR);
DEBUGFS_ADD_FILE(thermal_throttling, data); DEBUGFS_ADD_FILE(thermal_throttling, data, S_IRUSR);
DEBUGFS_ADD_FILE(disable_ht40, data); DEBUGFS_ADD_FILE(disable_ht40, data, S_IWUSR | S_IRUSR);
DEBUGFS_ADD_FILE(rx_statistics, debug); DEBUGFS_ADD_FILE(rx_statistics, debug, S_IRUSR);
DEBUGFS_ADD_FILE(tx_statistics, debug); DEBUGFS_ADD_FILE(tx_statistics, debug, S_IRUSR);
DEBUGFS_ADD_FILE(traffic_log, debug); DEBUGFS_ADD_FILE(traffic_log, debug, S_IWUSR | S_IRUSR);
DEBUGFS_ADD_FILE(rx_queue, debug); DEBUGFS_ADD_FILE(rx_queue, debug, S_IRUSR);
DEBUGFS_ADD_FILE(tx_queue, debug); DEBUGFS_ADD_FILE(tx_queue, debug, S_IRUSR);
DEBUGFS_ADD_FILE(tx_power, debug); DEBUGFS_ADD_FILE(tx_power, debug, S_IRUSR);
DEBUGFS_ADD_FILE(power_save_status, debug); DEBUGFS_ADD_FILE(power_save_status, debug, S_IRUSR);
DEBUGFS_ADD_FILE(clear_ucode_statistics, debug); DEBUGFS_ADD_FILE(clear_ucode_statistics, debug, S_IWUSR);
DEBUGFS_ADD_FILE(clear_traffic_statistics, debug); DEBUGFS_ADD_FILE(clear_traffic_statistics, debug, S_IWUSR);
if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) {
DEBUGFS_ADD_FILE(ucode_rx_stats, debug); DEBUGFS_ADD_FILE(ucode_rx_stats, debug, S_IRUSR);
DEBUGFS_ADD_FILE(ucode_tx_stats, debug); DEBUGFS_ADD_FILE(ucode_tx_stats, debug, S_IRUSR);
DEBUGFS_ADD_FILE(ucode_general_stats, debug); DEBUGFS_ADD_FILE(ucode_general_stats, debug, S_IRUSR);
DEBUGFS_ADD_FILE(sensitivity, debug); DEBUGFS_ADD_FILE(sensitivity, debug, S_IRUSR);
DEBUGFS_ADD_FILE(chain_noise, debug); DEBUGFS_ADD_FILE(chain_noise, debug, S_IRUSR);
} }
DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal);
DEBUGFS_ADD_BOOL(disable_chain_noise, rf, DEBUGFS_ADD_BOOL(disable_chain_noise, rf,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment