aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl4965-base.c
diff options
context:
space:
mode:
authorEster Kummer <ester.kummer@intel.com>2008-05-05 23:05:11 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-14 16:29:47 -0400
commit8cf769c6dcb7b83d380f20d2873ac20ec7a734b1 (patch)
tree1bca8925319b81e846a30c9a48843ddbc774e326 /drivers/net/wireless/iwlwifi/iwl4965-base.c
parent5d9276daa4c489e9c37c0f0cda915ece632f3cf1 (diff)
iwlwifi: move debug_level to sysfs/bus/pci/devices
This patch ports the debug_level from sysfs/bus/pci/drivers/iwl4965 to /sys/class/net/wlanX/device/debug_level Signed-off-by: Ester Kummer <ester.kummer@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 45bbce7f66a4..7902d90d58c0 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -5963,13 +5963,18 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
5963 * See the level definitions in iwl for details. 5963 * See the level definitions in iwl for details.
5964 */ 5964 */
5965 5965
5966static ssize_t show_debug_level(struct device_driver *d, char *buf) 5966static ssize_t show_debug_level(struct device *d,
5967 struct device_attribute *attr, char *buf)
5967{ 5968{
5968 return sprintf(buf, "0x%08X\n", iwl_debug_level); 5969 struct iwl_priv *priv = d->driver_data;
5970
5971 return sprintf(buf, "0x%08X\n", priv->debug_level);
5969} 5972}
5970static ssize_t store_debug_level(struct device_driver *d, 5973static ssize_t store_debug_level(struct device *d,
5974 struct device_attribute *attr,
5971 const char *buf, size_t count) 5975 const char *buf, size_t count)
5972{ 5976{
5977 struct iwl_priv *priv = d->driver_data;
5973 char *p = (char *)buf; 5978 char *p = (char *)buf;
5974 u32 val; 5979 u32 val;
5975 5980
@@ -5978,13 +5983,14 @@ static ssize_t store_debug_level(struct device_driver *d,
5978 printk(KERN_INFO DRV_NAME 5983 printk(KERN_INFO DRV_NAME
5979 ": %s is not in hex or decimal form.\n", buf); 5984 ": %s is not in hex or decimal form.\n", buf);
5980 else 5985 else
5981 iwl_debug_level = val; 5986 priv->debug_level = val;
5982 5987
5983 return strnlen(buf, count); 5988 return strnlen(buf, count);
5984} 5989}
5985 5990
5986static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO, 5991static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO,
5987 show_debug_level, store_debug_level); 5992 show_debug_level, store_debug_level);
5993
5988 5994
5989#endif /* CONFIG_IWLWIFI_DEBUG */ 5995#endif /* CONFIG_IWLWIFI_DEBUG */
5990 5996
@@ -6431,6 +6437,9 @@ static struct attribute *iwl4965_sysfs_entries[] = {
6431 &dev_attr_status.attr, 6437 &dev_attr_status.attr,
6432 &dev_attr_temperature.attr, 6438 &dev_attr_temperature.attr,
6433 &dev_attr_tx_power.attr, 6439 &dev_attr_tx_power.attr,
6440#ifdef CONFIG_IWLWIFI_DEBUG
6441 &dev_attr_debug_level.attr,
6442#endif
6434 6443
6435 NULL 6444 NULL
6436}; 6445};
@@ -6817,13 +6826,6 @@ static int __init iwl4965_init(void)
6817 IWL_ERROR("Unable to initialize PCI module\n"); 6826 IWL_ERROR("Unable to initialize PCI module\n");
6818 goto error_register; 6827 goto error_register;
6819 } 6828 }
6820#ifdef CONFIG_IWLWIFI_DEBUG
6821 ret = driver_create_file(&iwl_driver.driver, &driver_attr_debug_level);
6822 if (ret) {
6823 IWL_ERROR("Unable to create driver sysfs file\n");
6824 goto error_debug;
6825 }
6826#endif
6827 6829
6828 return ret; 6830 return ret;
6829 6831
@@ -6838,9 +6840,6 @@ error_register:
6838 6840
6839static void __exit iwl4965_exit(void) 6841static void __exit iwl4965_exit(void)
6840{ 6842{
6841#ifdef CONFIG_IWLWIFI_DEBUG
6842 driver_remove_file(&iwl_driver.driver, &driver_attr_debug_level);
6843#endif
6844 pci_unregister_driver(&iwl_driver); 6843 pci_unregister_driver(&iwl_driver);
6845 iwl4965_rate_control_unregister(); 6844 iwl4965_rate_control_unregister();
6846} 6845}