aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-02-18 03:36:07 -0500
committerReinette Chatre <reinette.chatre@intel.com>2010-03-09 19:10:38 -0500
commit60987206cba0dbb547bce2d23c3a3338c5aaf5ac (patch)
tree6c6d49750ff992db7cce443a430d074a699c498c /drivers/net/wireless/iwlwifi
parentb55e75ed926ded110293b0d1e24eb6a878883115 (diff)
iwlagn: move sysfs flags and filter_flags files to debugfs
These files are incompatible with some changes I'm making, and don't really belong into sysfs anyway as they can only be used for debugging. Since writing them will probably crash the firmware, keep only the reading part and move them into debugfs. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c83
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c29
2 files changed, 29 insertions, 83 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 6c816d9b524..bc84fd4a8d2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3109,87 +3109,6 @@ static ssize_t store_tx_power(struct device *d,
3109 3109
3110static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power); 3110static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power);
3111 3111
3112static ssize_t show_flags(struct device *d,
3113 struct device_attribute *attr, char *buf)
3114{
3115 struct iwl_priv *priv = dev_get_drvdata(d);
3116
3117 return sprintf(buf, "0x%04X\n", priv->active_rxon.flags);
3118}
3119
3120static ssize_t store_flags(struct device *d,
3121 struct device_attribute *attr,
3122 const char *buf, size_t count)
3123{
3124 struct iwl_priv *priv = dev_get_drvdata(d);
3125 unsigned long val;
3126 u32 flags;
3127 int ret = strict_strtoul(buf, 0, &val);
3128 if (ret)
3129 return ret;
3130 flags = (u32)val;
3131
3132 mutex_lock(&priv->mutex);
3133 if (le32_to_cpu(priv->staging_rxon.flags) != flags) {
3134 /* Cancel any currently running scans... */
3135 if (iwl_scan_cancel_timeout(priv, 100))
3136 IWL_WARN(priv, "Could not cancel scan.\n");
3137 else {
3138 IWL_DEBUG_INFO(priv, "Commit rxon.flags = 0x%04X\n", flags);
3139 priv->staging_rxon.flags = cpu_to_le32(flags);
3140 iwlcore_commit_rxon(priv);
3141 }
3142 }
3143 mutex_unlock(&priv->mutex);
3144
3145 return count;
3146}
3147
3148static DEVICE_ATTR(flags, S_IWUSR | S_IRUGO, show_flags, store_flags);
3149
3150static ssize_t show_filter_flags(struct device *d,
3151 struct device_attribute *attr, char *buf)
3152{
3153 struct iwl_priv *priv = dev_get_drvdata(d);
3154
3155 return sprintf(buf, "0x%04X\n",
3156 le32_to_cpu(priv->active_rxon.filter_flags));
3157}
3158
3159static ssize_t store_filter_flags(struct device *d,
3160 struct device_attribute *attr,
3161 const char *buf, size_t count)
3162{
3163 struct iwl_priv *priv = dev_get_drvdata(d);
3164 unsigned long val;
3165 u32 filter_flags;
3166 int ret = strict_strtoul(buf, 0, &val);
3167 if (ret)
3168 return ret;
3169 filter_flags = (u32)val;
3170
3171 mutex_lock(&priv->mutex);
3172 if (le32_to_cpu(priv->staging_rxon.filter_flags) != filter_flags) {
3173 /* Cancel any currently running scans... */
3174 if (iwl_scan_cancel_timeout(priv, 100))
3175 IWL_WARN(priv, "Could not cancel scan.\n");
3176 else {
3177 IWL_DEBUG_INFO(priv, "Committing rxon.filter_flags = "
3178 "0x%04X\n", filter_flags);
3179 priv->staging_rxon.filter_flags =
3180 cpu_to_le32(filter_flags);
3181 iwlcore_commit_rxon(priv);
3182 }
3183 }
3184 mutex_unlock(&priv->mutex);
3185
3186 return count;
3187}
3188
3189static DEVICE_ATTR(filter_flags, S_IWUSR | S_IRUGO, show_filter_flags,
3190 store_filter_flags);
3191
3192
3193static ssize_t show_statistics(struct device *d, 3112static ssize_t show_statistics(struct device *d,
3194 struct device_attribute *attr, char *buf) 3113 struct device_attribute *attr, char *buf)
3195{ 3114{
@@ -3414,8 +3333,6 @@ static void iwl_uninit_drv(struct iwl_priv *priv)
3414} 3333}
3415 3334
3416static struct attribute *iwl_sysfs_entries[] = { 3335static struct attribute *iwl_sysfs_entries[] = {
3417 &dev_attr_flags.attr,
3418 &dev_attr_filter_flags.attr,
3419 &dev_attr_statistics.attr, 3336 &dev_attr_statistics.attr,
3420 &dev_attr_temperature.attr, 3337 &dev_attr_temperature.attr,
3421 &dev_attr_tx_power.attr, 3338 &dev_attr_tx_power.attr,
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index fc084dd2d14..50d0ee96629 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -2093,6 +2093,31 @@ static ssize_t iwl_dbgfs_ucode_tracing_write(struct file *file,
2093 return count; 2093 return count;
2094} 2094}
2095 2095
2096static ssize_t iwl_dbgfs_rxon_flags_read(struct file *file,
2097 char __user *user_buf,
2098 size_t count, loff_t *ppos) {
2099
2100 struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
2101 int len = 0;
2102 char buf[20];
2103
2104 len = sprintf(buf, "0x%04X\n", le32_to_cpu(priv->active_rxon.flags));
2105 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
2106}
2107
2108static ssize_t iwl_dbgfs_rxon_filter_flags_read(struct file *file,
2109 char __user *user_buf,
2110 size_t count, loff_t *ppos) {
2111
2112 struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
2113 int len = 0;
2114 char buf[20];
2115
2116 len = sprintf(buf, "0x%04X\n",
2117 le32_to_cpu(priv->active_rxon.filter_flags));
2118 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
2119}
2120
2096static ssize_t iwl_dbgfs_fh_reg_read(struct file *file, 2121static ssize_t iwl_dbgfs_fh_reg_read(struct file *file,
2097 char __user *user_buf, 2122 char __user *user_buf,
2098 size_t count, loff_t *ppos) 2123 size_t count, loff_t *ppos)
@@ -2296,6 +2321,8 @@ DEBUGFS_READ_WRITE_FILE_OPS(missed_beacon);
2296DEBUGFS_WRITE_FILE_OPS(internal_scan); 2321DEBUGFS_WRITE_FILE_OPS(internal_scan);
2297DEBUGFS_READ_WRITE_FILE_OPS(plcp_delta); 2322DEBUGFS_READ_WRITE_FILE_OPS(plcp_delta);
2298DEBUGFS_READ_WRITE_FILE_OPS(force_reset); 2323DEBUGFS_READ_WRITE_FILE_OPS(force_reset);
2324DEBUGFS_READ_FILE_OPS(rxon_flags);
2325DEBUGFS_READ_FILE_OPS(rxon_filter_flags);
2299 2326
2300/* 2327/*
2301 * Create the debugfs files and directories 2328 * Create the debugfs files and directories
@@ -2358,6 +2385,8 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
2358 DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR); 2385 DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR);
2359 DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR); 2386 DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR);
2360 } 2387 }
2388 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
2389 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
2361 DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, &priv->disable_sens_cal); 2390 DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, &priv->disable_sens_cal);
2362 DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf, 2391 DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf,
2363 &priv->disable_chain_noise_cal); 2392 &priv->disable_chain_noise_cal);