Commit 2ddfa129 authored by Winkler, Tomas's avatar Winkler, Tomas Committed by John W. Linville
Browse files

iwlwifi: move sysfs status entry to debugfs



This patch moves priv->status sysfs entry to debugfs. It is for
debugging only anyway.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 29701e5a
...@@ -3652,16 +3652,6 @@ static ssize_t show_statistics(struct device *d, ...@@ -3652,16 +3652,6 @@ static ssize_t show_statistics(struct device *d,
static DEVICE_ATTR(statistics, S_IRUGO, show_statistics, NULL); static DEVICE_ATTR(statistics, S_IRUGO, show_statistics, NULL);
static ssize_t show_status(struct device *d,
struct device_attribute *attr, char *buf)
{
struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
if (!iwl_is_alive(priv))
return -EAGAIN;
return sprintf(buf, "0x%08x\n", (int)priv->status);
}
static DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
/***************************************************************************** /*****************************************************************************
* *
...@@ -3717,7 +3707,6 @@ static struct attribute *iwl_sysfs_entries[] = { ...@@ -3717,7 +3707,6 @@ static struct attribute *iwl_sysfs_entries[] = {
&dev_attr_power_level.attr, &dev_attr_power_level.attr,
&dev_attr_retry_rate.attr, &dev_attr_retry_rate.attr,
&dev_attr_statistics.attr, &dev_attr_statistics.attr,
&dev_attr_status.attr,
&dev_attr_temperature.attr, &dev_attr_temperature.attr,
&dev_attr_tx_power.attr, &dev_attr_tx_power.attr,
#ifdef CONFIG_IWLWIFI_DEBUG #ifdef CONFIG_IWLWIFI_DEBUG
......
...@@ -61,6 +61,7 @@ struct iwl_debugfs { ...@@ -61,6 +61,7 @@ struct iwl_debugfs {
struct dentry *file_tx_statistics; struct dentry *file_tx_statistics;
struct dentry *file_log_event; struct dentry *file_log_event;
struct dentry *file_channels; struct dentry *file_channels;
struct dentry *file_status;
} dbgfs_data_files; } dbgfs_data_files;
struct dir_rf_files { struct dir_rf_files {
struct dentry *file_disable_sensitivity; struct dentry *file_disable_sensitivity;
......
...@@ -63,6 +63,14 @@ ...@@ -63,6 +63,14 @@
goto err; \ goto err; \
} while (0) } while (0)
#define DEBUGFS_ADD_X32(name, parent, ptr) do { \
dbgfs->dbgfs_##parent##_files.file_##name = \
debugfs_create_x32(#name, 0444, dbgfs->dir_##parent, ptr); \
if (IS_ERR(dbgfs->dbgfs_##parent##_files.file_##name) \
|| !dbgfs->dbgfs_##parent##_files.file_##name) \
goto err; \
} while (0)
#define DEBUGFS_REMOVE(name) do { \ #define DEBUGFS_REMOVE(name) do { \
debugfs_remove(name); \ debugfs_remove(name); \
name = NULL; \ name = NULL; \
...@@ -420,7 +428,6 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf, ...@@ -420,7 +428,6 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf,
return ret; return ret;
} }
DEBUGFS_READ_WRITE_FILE_OPS(sram); DEBUGFS_READ_WRITE_FILE_OPS(sram);
DEBUGFS_WRITE_FILE_OPS(log_event); DEBUGFS_WRITE_FILE_OPS(log_event);
DEBUGFS_READ_FILE_OPS(eeprom); DEBUGFS_READ_FILE_OPS(eeprom);
...@@ -462,6 +469,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) ...@@ -462,6 +469,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
DEBUGFS_ADD_FILE(rx_statistics, data); DEBUGFS_ADD_FILE(rx_statistics, data);
DEBUGFS_ADD_FILE(tx_statistics, data); DEBUGFS_ADD_FILE(tx_statistics, data);
DEBUGFS_ADD_FILE(channels, data); DEBUGFS_ADD_FILE(channels, data);
DEBUGFS_ADD_X32(status, data, (u32 *)&priv->status);
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,
&priv->disable_chain_noise_cal); &priv->disable_chain_noise_cal);
......
Supports Markdown
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