diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2010-02-25 20:16:36 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-24 16:02:37 -0400 |
commit | 921ca03c8f8e982f27fc406bc301caf2196b99f7 (patch) | |
tree | 3ec4576e19f066a843a63e6eab1fd2ba90370937 /drivers/net/wireless/libertas/assoc.c | |
parent | e1572c5eeca8ef87a250322364584458b2dadb35 (diff) |
libertas: add auto auth mode feature
Auto auth mode is enabled by default. If user doesn't specify the
auth mode, while association driver will first try with open mode
and then with shared key mode. If user specifies an auth mode,
auto auth is disabled and driver will not try association with
another auth mode.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
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; |