mirror of https://gitee.com/openkylin/linux.git
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: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
29701e5abf
commit
2ddfa129bb
|
@ -3652,16 +3652,6 @@ static ssize_t show_statistics(struct device *d,
|
|||
|
||||
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[] = {
|
|||
&dev_attr_power_level.attr,
|
||||
&dev_attr_retry_rate.attr,
|
||||
&dev_attr_statistics.attr,
|
||||
&dev_attr_status.attr,
|
||||
&dev_attr_temperature.attr,
|
||||
&dev_attr_tx_power.attr,
|
||||
#ifdef CONFIG_IWLWIFI_DEBUG
|
||||
|
|
|
@ -61,6 +61,7 @@ struct iwl_debugfs {
|
|||
struct dentry *file_tx_statistics;
|
||||
struct dentry *file_log_event;
|
||||
struct dentry *file_channels;
|
||||
struct dentry *file_status;
|
||||
} dbgfs_data_files;
|
||||
struct dir_rf_files {
|
||||
struct dentry *file_disable_sensitivity;
|
||||
|
|
|
@ -63,6 +63,14 @@
|
|||
goto err; \
|
||||
} 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 { \
|
||||
debugfs_remove(name); \
|
||||
name = NULL; \
|
||||
|
@ -420,7 +428,6 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf,
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
DEBUGFS_READ_WRITE_FILE_OPS(sram);
|
||||
DEBUGFS_WRITE_FILE_OPS(log_event);
|
||||
DEBUGFS_READ_FILE_OPS(eeprom);
|
||||
|
@ -462,6 +469,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
|
|||
DEBUGFS_ADD_FILE(rx_statistics, data);
|
||||
DEBUGFS_ADD_FILE(tx_statistics, 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_chain_noise, rf,
|
||||
&priv->disable_chain_noise_cal);
|
||||
|
|
Loading…
Reference in New Issue