aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2009-07-17 12:30:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-24 15:05:25 -0400
commita562a9dda7f47e7cac58d80bf1ffe441feca510e (patch)
tree54750221d88a8dbd22fba73d4154dda9edbdf91b /drivers/net/wireless/iwlwifi/iwl-agn.c
parent34a66de628b5dcc4a93129610ccd24814935e8cd (diff)
iwlwifi: make debug level more user friendly
* Deprecate the "debug50" module parameter used to obtain 5000 series and up debugging. Replace it with "debug" module parameter to match with original driver and be consistent between them. The "debug50" module parameter can still be used, except that the module parameter is not writable in keeping with its previous state. We currently just mark it as "deprecated" and do not have it in the feature-removal-schedule. Some more cleanup of module parameters needs to be done and can then be entered together. * Only make "debug" module parameters visible if the driver is compiled with CONFIG_IWLWIFI_DEBUG. This will eliminate a lot of confusion where users think they have set debug flags but yet cannot see any debug output. * Make module parameters writable. This eliminates the need for the "debug_level" sysfs file, which can now also be deprecated and added to feature-removal-schedule. This file is in significant use though with many iwlwifi documents and text referring users to it. We can thus not take its removal lightly and keep it around. With iwlcore shared between iwlagn and iwl3945 we really do not need debug module parameters for each but can instead have one debug module parameter for the iwlcore module. The same issue is here as with the sysfs file - a lot of iwlwifi documentation and text (like bug reports) rely on iwlagn and iwl3945 having this module parameter, so changing this to a module parameter of iwlcore will have significant impact and we do not do this for that reason. One consequence of this patch is that if a user is running a system with both 3945 and later hardware then the setting of the one module parameter will affect the value of the other. The likelihood of this seems low - and even if this setup is present it does not seem like an issue for both modules to run with the same debug level. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index f61f653a1b72..ff4a546f1e6d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -904,7 +904,7 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv)
904 iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh); 904 iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh);
905 905
906#ifdef CONFIG_IWLWIFI_DEBUG 906#ifdef CONFIG_IWLWIFI_DEBUG
907 if (priv->debug_level & IWL_DL_ISR) { 907 if (iwl_debug_level & IWL_DL_ISR) {
908 /* just for debug */ 908 /* just for debug */
909 inta_mask = iwl_read32(priv, CSR_INT_MASK); 909 inta_mask = iwl_read32(priv, CSR_INT_MASK);
910 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", 910 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
@@ -939,7 +939,7 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv)
939 } 939 }
940 940
941#ifdef CONFIG_IWLWIFI_DEBUG 941#ifdef CONFIG_IWLWIFI_DEBUG
942 if (priv->debug_level & (IWL_DL_ISR)) { 942 if (iwl_debug_level & (IWL_DL_ISR)) {
943 /* NIC fires this, but we don't use it, redundant with WAKEUP */ 943 /* NIC fires this, but we don't use it, redundant with WAKEUP */
944 if (inta & CSR_INT_BIT_SCD) { 944 if (inta & CSR_INT_BIT_SCD) {
945 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit " 945 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit "
@@ -1053,7 +1053,7 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv)
1053 iwl_enable_interrupts(priv); 1053 iwl_enable_interrupts(priv);
1054 1054
1055#ifdef CONFIG_IWLWIFI_DEBUG 1055#ifdef CONFIG_IWLWIFI_DEBUG
1056 if (priv->debug_level & (IWL_DL_ISR)) { 1056 if (iwl_debug_level & (IWL_DL_ISR)) {
1057 inta = iwl_read32(priv, CSR_INT); 1057 inta = iwl_read32(priv, CSR_INT);
1058 inta_mask = iwl_read32(priv, CSR_INT_MASK); 1058 inta_mask = iwl_read32(priv, CSR_INT_MASK);
1059 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); 1059 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
@@ -1084,7 +1084,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1084 inta = priv->inta; 1084 inta = priv->inta;
1085 1085
1086#ifdef CONFIG_IWLWIFI_DEBUG 1086#ifdef CONFIG_IWLWIFI_DEBUG
1087 if (priv->debug_level & IWL_DL_ISR) { 1087 if (iwl_debug_level & IWL_DL_ISR) {
1088 /* just for debug */ 1088 /* just for debug */
1089 inta_mask = iwl_read32(priv, CSR_INT_MASK); 1089 inta_mask = iwl_read32(priv, CSR_INT_MASK);
1090 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x\n ", 1090 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x\n ",
@@ -1112,7 +1112,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1112 } 1112 }
1113 1113
1114#ifdef CONFIG_IWLWIFI_DEBUG 1114#ifdef CONFIG_IWLWIFI_DEBUG
1115 if (priv->debug_level & (IWL_DL_ISR)) { 1115 if (iwl_debug_level & (IWL_DL_ISR)) {
1116 /* NIC fires this, but we don't use it, redundant with WAKEUP */ 1116 /* NIC fires this, but we don't use it, redundant with WAKEUP */
1117 if (inta & CSR_INT_BIT_SCD) { 1117 if (inta & CSR_INT_BIT_SCD) {
1118 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit " 1118 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit "
@@ -2456,14 +2456,16 @@ static int iwl_mac_get_stats(struct ieee80211_hw *hw,
2456 * used for controlling the debug level. 2456 * used for controlling the debug level.
2457 * 2457 *
2458 * See the level definitions in iwl for details. 2458 * See the level definitions in iwl for details.
2459 *
2460 * FIXME This file can be deprecated as the module parameter is
2461 * writable and users can thus also change the debug level
2462 * using the /sys/module/iwl3945/parameters/debug file.
2459 */ 2463 */
2460 2464
2461static ssize_t show_debug_level(struct device *d, 2465static ssize_t show_debug_level(struct device *d,
2462 struct device_attribute *attr, char *buf) 2466 struct device_attribute *attr, char *buf)
2463{ 2467{
2464 struct iwl_priv *priv = dev_get_drvdata(d); 2468 return sprintf(buf, "0x%08X\n", iwl_debug_level);
2465
2466 return sprintf(buf, "0x%08X\n", priv->debug_level);
2467} 2469}
2468static ssize_t store_debug_level(struct device *d, 2470static ssize_t store_debug_level(struct device *d,
2469 struct device_attribute *attr, 2471 struct device_attribute *attr,
@@ -2477,7 +2479,7 @@ static ssize_t store_debug_level(struct device *d,
2477 if (ret) 2479 if (ret)
2478 IWL_ERR(priv, "%s is not in hex or decimal form.\n", buf); 2480 IWL_ERR(priv, "%s is not in hex or decimal form.\n", buf);
2479 else 2481 else
2480 priv->debug_level = val; 2482 iwl_debug_level = val;
2481 2483
2482 return strnlen(buf, count); 2484 return strnlen(buf, count);
2483} 2485}
@@ -2829,7 +2831,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2829 /* Disabling hardware scan means that mac80211 will perform scans 2831 /* Disabling hardware scan means that mac80211 will perform scans
2830 * "the hard way", rather than using device's scan. */ 2832 * "the hard way", rather than using device's scan. */
2831 if (cfg->mod_params->disable_hw_scan) { 2833 if (cfg->mod_params->disable_hw_scan) {
2832 if (cfg->mod_params->debug & IWL_DL_INFO) 2834 if (iwl_debug_level & IWL_DL_INFO)
2833 dev_printk(KERN_DEBUG, &(pdev->dev), 2835 dev_printk(KERN_DEBUG, &(pdev->dev),
2834 "Disabling hw_scan\n"); 2836 "Disabling hw_scan\n");
2835 iwl_hw_ops.hw_scan = NULL; 2837 iwl_hw_ops.hw_scan = NULL;
@@ -2851,7 +2853,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2851 priv->inta_mask = CSR_INI_SET_MASK; 2853 priv->inta_mask = CSR_INI_SET_MASK;
2852 2854
2853#ifdef CONFIG_IWLWIFI_DEBUG 2855#ifdef CONFIG_IWLWIFI_DEBUG
2854 priv->debug_level = priv->cfg->mod_params->debug;
2855 atomic_set(&priv->restrict_refcnt, 0); 2856 atomic_set(&priv->restrict_refcnt, 0);
2856#endif 2857#endif
2857 2858
@@ -3211,3 +3212,11 @@ static void __exit iwl_exit(void)
3211 3212
3212module_exit(iwl_exit); 3213module_exit(iwl_exit);
3213module_init(iwl_init); 3214module_init(iwl_init);
3215
3216#ifdef CONFIG_IWLWIFI_DEBUG
3217module_param_named(debug50, iwl_debug_level, uint, 0444);
3218MODULE_PARM_DESC(debug50, "50XX debug output mask (deprecated)");
3219module_param_named(debug, iwl_debug_level, uint, 0644);
3220MODULE_PARM_DESC(debug, "debug output mask");
3221#endif
3222