iwlwifi: remember the last uCode sysassert error code
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 27 Aug 2010 17:41:37 +0000 (10:41 -0700)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Sat, 11 Sep 2010 15:50:59 +0000 (08:50 -0700)
When sysassert happen, uCode will report the error code,
driver dump the information to dmesg. Here also remember
the last error code for future reference.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-debugfs.c
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl3945-base.c

index c8a2ec802c8cb22e06e1d82565a955b875c93a22..df2edccdf9bd8ec1fcfd8872e11e57039ef0ab54 100644 (file)
@@ -1278,7 +1278,6 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv)
                IWL_ERR(priv, "Microcode SW error detected. "
                        " Restarting 0x%X.\n", inta);
                priv->isr_stats.sw++;
-               priv->isr_stats.sw_err = inta;
                iwl_irq_handle_error(priv);
                handled |= CSR_INT_BIT_SW_ERR;
        }
@@ -1459,7 +1458,6 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
                IWL_ERR(priv, "Microcode SW error detected. "
                        " Restarting 0x%X.\n", inta);
                priv->isr_stats.sw++;
-               priv->isr_stats.sw_err = inta;
                iwl_irq_handle_error(priv);
                handled |= CSR_INT_BIT_SW_ERR;
        }
@@ -2467,6 +2465,7 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
        }
 
        desc = iwl_read_targ_mem(priv, base + 1 * sizeof(u32));
+       priv->isr_stats.err_code = desc;
        pc = iwl_read_targ_mem(priv, base + 2 * sizeof(u32));
        blink1 = iwl_read_targ_mem(priv, base + 3 * sizeof(u32));
        blink2 = iwl_read_targ_mem(priv, base + 4 * sizeof(u32));
index 0ee8f516c4ab0e4b1711f32792ec89d84c52a65f..86017eda1f06a7035ca337fde344531156bf996b 100644 (file)
@@ -575,10 +575,10 @@ static ssize_t iwl_dbgfs_interrupt_read(struct file *file,
                priv->isr_stats.hw);
        pos += scnprintf(buf + pos, bufsz - pos, "SW Error:\t\t\t %u\n",
                priv->isr_stats.sw);
-       if (priv->isr_stats.sw > 0) {
+       if (priv->isr_stats.sw || priv->isr_stats.hw) {
                pos += scnprintf(buf + pos, bufsz - pos,
                        "\tLast Restarting Code:  0x%X\n",
-                       priv->isr_stats.sw_err);
+                       priv->isr_stats.err_code);
        }
 #ifdef CONFIG_IWLWIFI_DEBUG
        pos += scnprintf(buf + pos, bufsz - pos, "Frame transmitted:\t\t %u\n",
index 4dd38b7b8b743a1614678bab5732788c779e46fc..504ff0f922d942bf3826ce12c18a78161a9594d9 100644 (file)
@@ -945,7 +945,7 @@ enum iwl_pa_type {
 struct isr_statistics {
        u32 hw;
        u32 sw;
-       u32 sw_err;
+       u32 err_code;
        u32 sch;
        u32 alive;
        u32 rfkill;
index 68e624afb9879d28554e522e8857137aea5ff212..9c90be1ea0df30491319ba5b45317391a9f25ba7 100644 (file)
@@ -1730,7 +1730,6 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
                IWL_ERR(priv, "Microcode SW error detected. "
                        "Restarting 0x%X.\n", inta);
                priv->isr_stats.sw++;
-               priv->isr_stats.sw_err = inta;
                iwl_irq_handle_error(priv);
                handled |= CSR_INT_BIT_SW_ERR;
        }