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