aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.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/iwl3945-base.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/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index bd6a067b4881..221a875b0161 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -612,8 +612,8 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
612 IWL_DEBUG_TX(priv, "sequence nr = 0X%x \n", 612 IWL_DEBUG_TX(priv, "sequence nr = 0X%x \n",
613 le16_to_cpu(out_cmd->hdr.sequence)); 613 le16_to_cpu(out_cmd->hdr.sequence));
614 IWL_DEBUG_TX(priv, "tx_flags = 0X%x \n", le32_to_cpu(tx->tx_flags)); 614 IWL_DEBUG_TX(priv, "tx_flags = 0X%x \n", le32_to_cpu(tx->tx_flags));
615 iwl_print_hex_dump(priv, IWL_DL_TX, tx, sizeof(*tx)); 615 iwl_print_hex_dump(IWL_DL_TX, tx, sizeof(*tx));
616 iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx->hdr, 616 iwl_print_hex_dump(IWL_DL_TX, (u8 *)tx->hdr,
617 ieee80211_hdrlen(fc)); 617 ieee80211_hdrlen(fc));
618 618
619 /* 619 /*
@@ -1644,7 +1644,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
1644 iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh); 1644 iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh);
1645 1645
1646#ifdef CONFIG_IWLWIFI_DEBUG 1646#ifdef CONFIG_IWLWIFI_DEBUG
1647 if (priv->debug_level & IWL_DL_ISR) { 1647 if (iwl_debug_level & IWL_DL_ISR) {
1648 /* just for debug */ 1648 /* just for debug */
1649 inta_mask = iwl_read32(priv, CSR_INT_MASK); 1649 inta_mask = iwl_read32(priv, CSR_INT_MASK);
1650 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", 1650 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
@@ -1679,7 +1679,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
1679 } 1679 }
1680 1680
1681#ifdef CONFIG_IWLWIFI_DEBUG 1681#ifdef CONFIG_IWLWIFI_DEBUG
1682 if (priv->debug_level & (IWL_DL_ISR)) { 1682 if (iwl_debug_level & (IWL_DL_ISR)) {
1683 /* NIC fires this, but we don't use it, redundant with WAKEUP */ 1683 /* NIC fires this, but we don't use it, redundant with WAKEUP */
1684 if (inta & CSR_INT_BIT_SCD) { 1684 if (inta & CSR_INT_BIT_SCD) {
1685 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit " 1685 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit "
@@ -1758,7 +1758,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
1758 iwl_enable_interrupts(priv); 1758 iwl_enable_interrupts(priv);
1759 1759
1760#ifdef CONFIG_IWLWIFI_DEBUG 1760#ifdef CONFIG_IWLWIFI_DEBUG
1761 if (priv->debug_level & (IWL_DL_ISR)) { 1761 if (iwl_debug_level & (IWL_DL_ISR)) {
1762 inta = iwl_read32(priv, CSR_INT); 1762 inta = iwl_read32(priv, CSR_INT);
1763 inta_mask = iwl_read32(priv, CSR_INT_MASK); 1763 inta_mask = iwl_read32(priv, CSR_INT_MASK);
1764 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); 1764 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
@@ -3308,13 +3308,15 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3308 * used for controlling the debug level. 3308 * used for controlling the debug level.
3309 * 3309 *
3310 * See the level definitions in iwl for details. 3310 * See the level definitions in iwl for details.
3311 *
3312 * FIXME This file can be deprecated as the module parameter is
3313 * writable and users can thus also change the debug level
3314 * using the /sys/module/iwl3945/parameters/debug file.
3311 */ 3315 */
3312static ssize_t show_debug_level(struct device *d, 3316static ssize_t show_debug_level(struct device *d,
3313 struct device_attribute *attr, char *buf) 3317 struct device_attribute *attr, char *buf)
3314{ 3318{
3315 struct iwl_priv *priv = dev_get_drvdata(d); 3319 return sprintf(buf, "0x%08X\n", iwl_debug_level);
3316
3317 return sprintf(buf, "0x%08X\n", priv->debug_level);
3318} 3320}
3319static ssize_t store_debug_level(struct device *d, 3321static ssize_t store_debug_level(struct device *d,
3320 struct device_attribute *attr, 3322 struct device_attribute *attr,
@@ -3328,7 +3330,7 @@ static ssize_t store_debug_level(struct device *d,
3328 if (ret) 3330 if (ret)
3329 IWL_INFO(priv, "%s is not in hex or decimal form.\n", buf); 3331 IWL_INFO(priv, "%s is not in hex or decimal form.\n", buf);
3330 else 3332 else
3331 priv->debug_level = val; 3333 iwl_debug_level = val;
3332 3334
3333 return strnlen(buf, count); 3335 return strnlen(buf, count);
3334} 3336}
@@ -3966,7 +3968,6 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
3966 priv->inta_mask = CSR_INI_SET_MASK; 3968 priv->inta_mask = CSR_INI_SET_MASK;
3967 3969
3968#ifdef CONFIG_IWLWIFI_DEBUG 3970#ifdef CONFIG_IWLWIFI_DEBUG
3969 priv->debug_level = iwl3945_mod_params.debug;
3970 atomic_set(&priv->restrict_refcnt, 0); 3971 atomic_set(&priv->restrict_refcnt, 0);
3971#endif 3972#endif
3972 3973
@@ -4262,8 +4263,10 @@ MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
4262module_param_named(swcrypto, iwl3945_mod_params.sw_crypto, int, 0444); 4263module_param_named(swcrypto, iwl3945_mod_params.sw_crypto, int, 0444);
4263MODULE_PARM_DESC(swcrypto, 4264MODULE_PARM_DESC(swcrypto,
4264 "using software crypto (default 1 [software])\n"); 4265 "using software crypto (default 1 [software])\n");
4265module_param_named(debug, iwl3945_mod_params.debug, uint, 0444); 4266#ifdef CONFIG_IWLWIFI_DEBUG
4267module_param_named(debug, iwl_debug_level, uint, 0644);
4266MODULE_PARM_DESC(debug, "debug output mask"); 4268MODULE_PARM_DESC(debug, "debug output mask");
4269#endif
4267module_param_named(disable_hw_scan, iwl3945_mod_params.disable_hw_scan, int, 0444); 4270module_param_named(disable_hw_scan, iwl3945_mod_params.disable_hw_scan, int, 0444);
4268MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)"); 4271MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)");
4269module_param_named(fw_restart3945, iwl3945_mod_params.restart_fw, int, 0444); 4272module_param_named(fw_restart3945, iwl3945_mod_params.restart_fw, int, 0444);