iwlagn: alwasy send RXON with disassociate falge before associate
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Sat, 7 May 2011 00:06:44 +0000 (17:06 -0700)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 13 May 2011 19:02:49 +0000 (12:02 -0700)
Before send the RXON command with associated flag set, always do disassociate
first to make sure uCode is in the correct state.

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

index 02387430f7fe0dddae5006aa80e59301c19ecaec..7d40e2d42873b88529a6e68e42f22c68ca9a2b4c 100644 (file)
@@ -389,11 +389,9 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
         * AP station must be done after the BSSID is set to correctly
         * set up filters in the device.
         */
-       if ((old_assoc && new_assoc) || !new_assoc) {
-               ret = iwlagn_rxon_disconn(priv, ctx);
-               if (ret)
-                       return ret;
-       }
+       ret = iwlagn_rxon_disconn(priv, ctx);
+       if (ret)
+               return ret;
 
        if (new_assoc)
                return iwlagn_rxon_connect(priv, ctx);
index 2f6b38cfcc138837a58b4855c124517412a90809..54a935ff38fa5264dad5966f0b0d5c7c799ae5f2 100644 (file)
@@ -582,6 +582,11 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
        int trace_idx;
 #endif
 
+       if (test_bit(STATUS_FW_ERROR, &priv->status)) {
+               IWL_WARN(priv, "fw recovery, no hcmd send\n");
+               return -EIO;
+       }
+
        copy_size = sizeof(out_cmd->hdr);
        cmd_size = sizeof(out_cmd->hdr);