iwlwifi: re-introduce per device debugging
Commit "iwlwifi: make debug level more user friendly" cleaned up the debug level handling. In doing so it created a single global debug level for all devices. Some setups do consits of more that one iwlwifi device and in these setups there is a requirement that debug levels should be unique per device. We now re-introduce the per device debugging while maintaining the cleanup effort of the previous patch. The maintain the global debug level and now introduce a per-device debug level that will be used if it (the per-device debug level) is set. The per-device debug level can be controlled via the debug_level sysfs file while the global debug level is controlled by the debug module parameter. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
34b921cf6f
commit
3d816c77ec
@@ -614,8 +614,8 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
|
||||
IWL_DEBUG_TX(priv, "sequence nr = 0X%x \n",
|
||||
le16_to_cpu(out_cmd->hdr.sequence));
|
||||
IWL_DEBUG_TX(priv, "tx_flags = 0X%x \n", le32_to_cpu(tx->tx_flags));
|
||||
iwl_print_hex_dump(IWL_DL_TX, tx, sizeof(*tx));
|
||||
iwl_print_hex_dump(IWL_DL_TX, (u8 *)tx->hdr,
|
||||
iwl_print_hex_dump(priv, IWL_DL_TX, tx, sizeof(*tx));
|
||||
iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx->hdr,
|
||||
ieee80211_hdrlen(fc));
|
||||
|
||||
/*
|
||||
@@ -1646,7 +1646,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
|
||||
iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh);
|
||||
|
||||
#ifdef CONFIG_IWLWIFI_DEBUG
|
||||
if (iwl_debug_level & IWL_DL_ISR) {
|
||||
if (iwl_get_debug_level(priv) & IWL_DL_ISR) {
|
||||
/* just for debug */
|
||||
inta_mask = iwl_read32(priv, CSR_INT_MASK);
|
||||
IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
|
||||
@@ -1681,7 +1681,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IWLWIFI_DEBUG
|
||||
if (iwl_debug_level & (IWL_DL_ISR)) {
|
||||
if (iwl_get_debug_level(priv) & (IWL_DL_ISR)) {
|
||||
/* NIC fires this, but we don't use it, redundant with WAKEUP */
|
||||
if (inta & CSR_INT_BIT_SCD) {
|
||||
IWL_DEBUG_ISR(priv, "Scheduler finished to transmit "
|
||||
@@ -1760,7 +1760,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
|
||||
iwl_enable_interrupts(priv);
|
||||
|
||||
#ifdef CONFIG_IWLWIFI_DEBUG
|
||||
if (iwl_debug_level & (IWL_DL_ISR)) {
|
||||
if (iwl_get_debug_level(priv) & (IWL_DL_ISR)) {
|
||||
inta = iwl_read32(priv, CSR_INT);
|
||||
inta_mask = iwl_read32(priv, CSR_INT_MASK);
|
||||
inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
|
||||
@@ -3311,14 +3311,15 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
||||
*
|
||||
* See the level definitions in iwl for details.
|
||||
*
|
||||
* FIXME This file can be deprecated as the module parameter is
|
||||
* writable and users can thus also change the debug level
|
||||
* using the /sys/module/iwl3945/parameters/debug file.
|
||||
* The debug_level being managed using sysfs below is a per device debug
|
||||
* level that is used instead of the global debug level if it (the per
|
||||
* device debug level) is set.
|
||||
*/
|
||||
static ssize_t show_debug_level(struct device *d,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return sprintf(buf, "0x%08X\n", iwl_debug_level);
|
||||
struct iwl_priv *priv = dev_get_drvdata(d);
|
||||
return sprintf(buf, "0x%08X\n", iwl_get_debug_level(priv));
|
||||
}
|
||||
static ssize_t store_debug_level(struct device *d,
|
||||
struct device_attribute *attr,
|
||||
@@ -3332,7 +3333,7 @@ static ssize_t store_debug_level(struct device *d,
|
||||
if (ret)
|
||||
IWL_INFO(priv, "%s is not in hex or decimal form.\n", buf);
|
||||
else
|
||||
iwl_debug_level = val;
|
||||
priv->debug_level = val;
|
||||
|
||||
return strnlen(buf, count);
|
||||
}
|
||||
|
Reference in New Issue
Block a user