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) {
{
int err;
- if (!(priv->status & (STATUS_ASSOCIATING | STATUS_ASSOCIATED))) {
+ if (priv->status & STATUS_ASSOCIATING) {
+ IPW_DEBUG_ASSOC("Disassociating while associating.\n");
+ queue_work(priv->workqueue, &priv->disassociate);
+ return;
+ }
+
+ if (!(priv->status & STATUS_ASSOCIATED)) {
IPW_DEBUG_ASSOC("Disassociating while not associated.\n");
return;
}
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
return;
}
+ priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED);
+ priv->status |= STATUS_DISASSOCIATING;
+
}
static int ipw_disassociate(void *data)
*/
priv->channel = network->channel;
memcpy(priv->bssid, network->bssid, ETH_ALEN);
- priv->status |= STATUS_ASSOCIATING;
- priv->status &= ~STATUS_SECURITY_UPDATED;
priv->assoc_network = network;
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));