aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/assoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/assoc.c')
-rw-r--r--drivers/net/wireless/libertas/assoc.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 12a2ef9dacea..aa06070e5eab 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -32,6 +32,9 @@ u8 lbs_bg_rates[MAX_RATES] =
320x00, 0x00 }; 320x00, 0x00 };
33 33
34 34
35static int assoc_helper_wep_keys(struct lbs_private *priv,
36 struct assoc_request *assoc_req);
37
35/** 38/**
36 * @brief This function finds common rates between rates and card rates. 39 * @brief This function finds common rates between rates and card rates.
37 * 40 *
@@ -611,7 +614,7 @@ static int lbs_assoc_post(struct lbs_private *priv,
611 614
612 if (status_code) { 615 if (status_code) {
613 lbs_mac_event_disconnected(priv); 616 lbs_mac_event_disconnected(priv);
614 ret = -1; 617 ret = status_code;
615 goto done; 618 goto done;
616 } 619 }
617 620
@@ -814,7 +817,24 @@ static int lbs_try_associate(struct lbs_private *priv,
814 goto out; 817 goto out;
815 818
816 ret = lbs_associate(priv, assoc_req, CMD_802_11_ASSOCIATE); 819 ret = lbs_associate(priv, assoc_req, CMD_802_11_ASSOCIATE);
820 /* If the association fails with current auth mode, let's
821 * try by changing the auth mode
822 */
823 if ((priv->authtype_auto) &&
824 (ret == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) &&
825 (assoc_req->secinfo.wep_enabled) &&
826 (priv->connect_status != LBS_CONNECTED)) {
827 if (priv->secinfo.auth_mode == IW_AUTH_ALG_OPEN_SYSTEM)
828 priv->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
829 else
830 priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
831 if (!assoc_helper_wep_keys(priv, assoc_req))
832 ret = lbs_associate(priv, assoc_req,
833 CMD_802_11_ASSOCIATE);
834 }
817 835
836 if (ret)
837 ret = -1;
818out: 838out:
819 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); 839 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
820 return ret; 840 return ret;