diff options
author | Ester Kummer <ester.kummer@intel.com> | 2008-05-05 23:05:11 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-14 16:29:47 -0400 |
commit | 8cf769c6dcb7b83d380f20d2873ac20ec7a734b1 (patch) | |
tree | 1bca8925319b81e846a30c9a48843ddbc774e326 | |
parent | 5d9276daa4c489e9c37c0f0cda915ece632f3cf1 (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>
-rw-r--r-- | drivers/net/wireless/iwlwifi/Kconfig | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debug.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 31 |
4 files changed, 17 insertions, 24 deletions
diff --git a/drivers/net/wireless/iwlwifi/Kconfig b/drivers/net/wireless/iwlwifi/Kconfig index cc0006900b3..193e48f3ed5 100644 --- a/drivers/net/wireless/iwlwifi/Kconfig +++ b/drivers/net/wireless/iwlwifi/Kconfig | |||
@@ -97,13 +97,13 @@ config IWLWIFI_DEBUG | |||
97 | control which debug output is sent to the kernel log by setting the | 97 | control which debug output is sent to the kernel log by setting the |
98 | value in | 98 | value in |
99 | 99 | ||
100 | /sys/bus/pci/drivers/${DRIVER}/debug_level | 100 | /sys/class/net/wlan0/device/debug_level |
101 | 101 | ||
102 | This entry will only exist if this option is enabled. | 102 | This entry will only exist if this option is enabled. |
103 | 103 | ||
104 | To set a value, simply echo an 8-byte hex value to the same file: | 104 | To set a value, simply echo an 8-byte hex value to the same file: |
105 | 105 | ||
106 | % echo 0x43fff > /sys/bus/pci/drivers/${DRIVER}/debug_level | 106 | % echo 0x43fff > /sys/class/net/wlan0/device/debug_level |
107 | 107 | ||
108 | You can find the list of debug mask values in: | 108 | You can find the list of debug mask values in: |
109 | drivers/net/wireless/iwlwifi/iwl-4965-debug.h | 109 | drivers/net/wireless/iwlwifi/iwl-4965-debug.h |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 7759e63b2bc..27e56b89d94 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -46,11 +46,6 @@ MODULE_VERSION(IWLWIFI_VERSION); | |||
46 | MODULE_AUTHOR(DRV_COPYRIGHT); | 46 | MODULE_AUTHOR(DRV_COPYRIGHT); |
47 | MODULE_LICENSE("GPL"); | 47 | MODULE_LICENSE("GPL"); |
48 | 48 | ||
49 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
50 | u32 iwl_debug_level; | ||
51 | EXPORT_SYMBOL(iwl_debug_level); | ||
52 | #endif | ||
53 | |||
54 | #define IWL_DECLARE_RATE_INFO(r, s, ip, in, rp, rn, pp, np) \ | 49 | #define IWL_DECLARE_RATE_INFO(r, s, ip, in, rp, rn, pp, np) \ |
55 | [IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP, \ | 50 | [IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP, \ |
56 | IWL_RATE_SISO_##s##M_PLCP, \ | 51 | IWL_RATE_SISO_##s##M_PLCP, \ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h index 14d95dd0e14..2f24594c5fe 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debug.h +++ b/drivers/net/wireless/iwlwifi/iwl-debug.h | |||
@@ -30,7 +30,6 @@ | |||
30 | #define __iwl_debug_h__ | 30 | #define __iwl_debug_h__ |
31 | 31 | ||
32 | #ifdef CONFIG_IWLWIFI_DEBUG | 32 | #ifdef CONFIG_IWLWIFI_DEBUG |
33 | extern u32 iwl_debug_level; | ||
34 | #define IWL_DEBUG(level, fmt, args...) \ | 33 | #define IWL_DEBUG(level, fmt, args...) \ |
35 | do { if (priv->debug_level & (level)) \ | 34 | do { if (priv->debug_level & (level)) \ |
36 | dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \ | 35 | dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \ |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 45bbce7f66a..7902d90d58c 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 | ||
5966 | static ssize_t show_debug_level(struct device_driver *d, char *buf) | 5966 | static 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 | } |
5970 | static ssize_t store_debug_level(struct device_driver *d, | 5973 | static 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 | ||
5986 | static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO, | 5991 | static 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 | ||
6839 | static void __exit iwl4965_exit(void) | 6841 | static 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 | } |