Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193859
b: refs/heads/master
c: 921ca03
h: refs/heads/master
i:
  193857: 28d7983
  193855: 0aadf07
v: v3
  • Loading branch information
Amitkumar Karwar authored and John W. Linville committed Mar 24, 2010
1 parent 14cedb4 commit 661c1f6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e1572c5eeca8ef87a250322364584458b2dadb35
refs/heads/master: 921ca03c8f8e982f27fc406bc301caf2196b99f7
22 changes: 21 additions & 1 deletion trunk/drivers/net/wireless/libertas/assoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ u8 lbs_bg_rates[MAX_RATES] =
0x00, 0x00 };


static int assoc_helper_wep_keys(struct lbs_private *priv,
struct assoc_request *assoc_req);

/**
* @brief This function finds common rates between rates and card rates.
*
Expand Down Expand Up @@ -610,7 +613,7 @@ static int lbs_assoc_post(struct lbs_private *priv,

if (status_code) {
lbs_mac_event_disconnected(priv);
ret = -1;
ret = status_code;
goto done;
}

Expand Down Expand Up @@ -813,7 +816,24 @@ static int lbs_try_associate(struct lbs_private *priv,
goto out;

ret = lbs_associate(priv, assoc_req, CMD_802_11_ASSOCIATE);
/* If the association fails with current auth mode, let's
* try by changing the auth mode
*/
if ((priv->authtype_auto) &&
(ret == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) &&
(assoc_req->secinfo.wep_enabled) &&
(priv->connect_status != LBS_CONNECTED)) {
if (priv->secinfo.auth_mode == IW_AUTH_ALG_OPEN_SYSTEM)
priv->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
else
priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
if (!assoc_helper_wep_keys(priv, assoc_req))
ret = lbs_associate(priv, assoc_req,
CMD_802_11_ASSOCIATE);
}

if (ret)
ret = -1;
out:
lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
return ret;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/libertas/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ struct lbs_private {
u8 wpa_ie_len;
u16 wep_tx_keyidx;
struct enc_key wep_keys[4];
u8 authtype_auto;

/* Wake On LAN */
uint32_t wol_criteria;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/libertas/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,7 @@ static int lbs_init_adapter(struct lbs_private *priv)
priv->is_auto_deep_sleep_enabled = 0;
priv->wakeup_dev_required = 0;
init_waitqueue_head(&priv->ds_awake_q);
priv->authtype_auto = 1;

mutex_init(&priv->lock);

Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/net/wireless/libertas/wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1440,8 +1440,10 @@ static int lbs_set_encode(struct net_device *dev,
set_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags);

if (dwrq->flags & IW_ENCODE_RESTRICTED) {
priv->authtype_auto = 0;
assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
} else if (dwrq->flags & IW_ENCODE_OPEN) {
priv->authtype_auto = 0;
assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
}

Expand Down Expand Up @@ -1620,8 +1622,10 @@ static int lbs_set_encodeext(struct net_device *dev,
goto out;

if (dwrq->flags & IW_ENCODE_RESTRICTED) {
priv->authtype_auto = 0;
assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
} else if (dwrq->flags & IW_ENCODE_OPEN) {
priv->authtype_auto = 0;
assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
}

Expand Down

0 comments on commit 661c1f6

Please sign in to comment.