iwlwifi: Loading correct uCode again when fail to load
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Tue, 8 Feb 2011 00:54:50 +0000 (16:54 -0800)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Mon, 21 Feb 2011 18:08:38 +0000 (10:08 -0800)
During uCode loading, if the reply_alive come back with "failure",
try to load the same uCode again.

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

index abd0461..c04d991 100644 (file)
@@ -466,6 +466,15 @@ static void iwl_rx_reply_alive(struct iwl_priv *priv,
                IWL_WARN(priv, "%s uCode did not respond OK.\n",
                        (palive->ver_subtype == INITIALIZE_SUBTYPE) ?
                        "init" : "runtime");
+               /*
+                * If fail to load init uCode,
+                * let's try to load the init uCode again.
+                * We should not get into this situation, but if it
+                * does happen, we should not move on and loading "runtime"
+                * without proper calibrate the device.
+                */
+               if (palive->ver_subtype == INITIALIZE_SUBTYPE)
+                       priv->ucode_type = UCODE_NONE;
                queue_work(priv->workqueue, &priv->restart);
        }
 }