libertas: fix scheduling while atomic bug in CMD_MAC_CONTROL
authorHolger Schurig <hs4233@mail.mn-solutions.de>
Tue, 18 Mar 2008 10:20:21 +0000 (11:20 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 25 Mar 2008 20:41:48 +0000 (16:41 -0400)
The old code incorrectly used lbs_cmd_with_response() and now uses
lbs_cmd_async().

While there I noticed that there is no real useful return values for
asynchronous command functions, so I made the function "void".

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/assoc.c
drivers/net/wireless/libertas/cmd.c
drivers/net/wireless/libertas/decl.h

index 54161f1e742a326c4834c26bef0d7363b16299c8..fcea2a124a5614eb84a7c7a917499945c89068f8 100644 (file)
@@ -272,9 +272,7 @@ static int assoc_helper_wep_keys(struct lbs_private *priv,
        else
                priv->mac_control &= ~CMD_ACT_MAC_WEP_ENABLE;
 
-       ret = lbs_set_mac_control(priv);
-       if (ret)
-               goto out;
+       lbs_set_mac_control(priv);
 
        mutex_lock(&priv->lock);
 
@@ -304,9 +302,7 @@ static int assoc_helper_secinfo(struct lbs_private *priv,
        memcpy(&priv->secinfo, &assoc_req->secinfo,
                sizeof(struct lbs_802_11_security));
 
-       ret = lbs_set_mac_control(priv);
-       if (ret)
-               goto out;
+       lbs_set_mac_control(priv);
 
        /* If RSN is already enabled, don't try to enable it again, since
         * ENABLE_RSN resets internal state machines and will clobber the
index be461c5c42ae84191b6f8dba914eb9cf3a09db30..be8a170b633f0023d530b2f55598ebeae75f8409 100644 (file)
@@ -1326,9 +1326,8 @@ int lbs_set_radio_control(struct lbs_private *priv)
        return ret;
 }
 
-int lbs_set_mac_control(struct lbs_private *priv)
+void lbs_set_mac_control(struct lbs_private *priv)
 {
-       int ret = 0;
        struct cmd_ds_mac_control cmd;
 
        lbs_deb_enter(LBS_DEB_CMD);
@@ -1337,10 +1336,10 @@ int lbs_set_mac_control(struct lbs_private *priv)
        cmd.action = cpu_to_le16(priv->mac_control);
        cmd.reserved = 0;
 
-       ret = lbs_cmd_with_response(priv, CMD_MAC_CONTROL, &cmd);
+       lbs_cmd_async(priv, CMD_MAC_CONTROL,
+               &cmd.hdr, sizeof(cmd));
 
-       lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
-       return ret;
+       lbs_deb_leave(LBS_DEB_CMD);
 }
 
 /**
index f0de2a1e918f56f9c48669a02b4d14c160b3f7f7..989fb77e66dcaaf37f3629a01828947488d3c777 100644 (file)
@@ -17,7 +17,7 @@ struct net_device;
 struct cmd_ctrl_node;
 struct cmd_ds_command;
 
-int lbs_set_mac_control(struct lbs_private *priv);
+void lbs_set_mac_control(struct lbs_private *priv);
 
 void lbs_send_tx_feedback(struct lbs_private *priv);