]> err.no Git - linux-2.6/commitdiff
Fixes WEP firmware error condition.
authorHong Liu <hong.liu@intel.com>
Thu, 15 Sep 2005 02:04:15 +0000 (21:04 -0500)
committerJames Ketrenos <jketreno@linux.intel.com>
Mon, 7 Nov 2005 23:51:47 +0000 (17:51 -0600)
The problem is caused by the patch in bug455 -- Channel change flood
generates fatal error.

The patch set the DISASSOCIATING status bit after sending the command.
The process was scheduled out when waiting for the command to be sent to
the card. The disassociated notification clears the DISASSOCIATING bit
in the tasklet before the process set the bit.

Move the bit setting code before sending the command now.

Signed-off-by: Hong Liu <hong.liu@intel.com>
Signed-off-by: James Ketrenos <jketreno@linux.intel.com>
drivers/net/wireless/ipw2200.c

index 549f582551e588b80601cb9d9b755b76ab56540f..a7630920ace89c8fb3ec27f486d08c6895af5b81 100644 (file)
@@ -1882,18 +1882,6 @@ static int ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
                return -EAGAIN;
        }
 
-       if (priv->status & STATUS_ASSOCIATING) {
-               IPW_DEBUG_HC("abandon a command while associating\n");
-               spin_unlock_irqrestore(&priv->lock, flags);
-               return -1;
-       }
-
-       if (priv->status & STATUS_DISASSOCIATING) {
-               IPW_DEBUG_HC("abandon a command while disassociating\n");
-               spin_unlock_irqrestore(&priv->lock, flags);
-               return -1;
-       }
-
        priv->status |= STATUS_HCMD_ACTIVE;
 
        if (priv->cmdlog) {
@@ -3697,10 +3685,14 @@ static void ipw_send_disassociate(struct ipw_priv *priv, int quiet)
                        MAC_ARG(priv->assoc_request.bssid),
                        priv->assoc_request.channel);
 
+       priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED);
+       priv->status |= STATUS_DISASSOCIATING;
+
        if (quiet)
                priv->assoc_request.assoc_type = HC_DISASSOC_QUIET;
        else
                priv->assoc_request.assoc_type = HC_DISASSOCIATE;
+
        err = ipw_send_associate(priv, &priv->assoc_request);
        if (err) {
                IPW_DEBUG_HC("Attempt to send [dis]associate command "
@@ -3708,9 +3700,6 @@ static void ipw_send_disassociate(struct ipw_priv *priv, int quiet)
                return;
        }
 
-       priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED);
-       priv->status |= STATUS_DISASSOCIATING;
-
 }
 
 static int ipw_disassociate(void *data)
@@ -7672,6 +7661,8 @@ static int ipw_associate_network(struct ipw_priv *priv,
         */
        priv->channel = network->channel;
        memcpy(priv->bssid, network->bssid, ETH_ALEN);
+       priv->status |= STATUS_ASSOCIATING;
+       priv->status &= ~STATUS_SECURITY_UPDATED;
 
        priv->assoc_network = network;
 
@@ -7685,9 +7676,6 @@ static int ipw_associate_network(struct ipw_priv *priv,
                return err;
        }
 
-       priv->status |= STATUS_ASSOCIATING;
-       priv->status &= ~STATUS_SECURITY_UPDATED;
-
        IPW_DEBUG(IPW_DL_STATE, "associating: '%s' " MAC_FMT " \n",
                  escape_essid(priv->essid, priv->essid_len),
                  MAC_ARG(priv->bssid));
@@ -7791,6 +7779,13 @@ static int ipw_associate(void *data)
                return 0;
        }
 
+       if (priv->status & STATUS_DISASSOCIATING) {
+               IPW_DEBUG_ASSOC("Not attempting association (in "
+                               "disassociating)\n ");
+               queue_work(priv->workqueue, &priv->associate);
+               return 0;
+       }
+
        if (!ipw_is_init(priv) || (priv->status & STATUS_SCANNING)) {
                IPW_DEBUG_ASSOC("Not attempting association (scanning or not "
                                "initialized)\n");