Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58140
b: refs/heads/master
c: 18c96c3
h: refs/heads/master
v: v3
  • Loading branch information
Dan Williams authored and John W. Linville committed Jun 28, 2007
1 parent 7b3b342 commit 04a70a2
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 9 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: f8f551089b0ca571b8f95465b6c3e1dd7bcea28e
refs/heads/master: 18c96c3497aa871608d57ca5e08de3558159a6c9
28 changes: 26 additions & 2 deletions trunk/drivers/net/wireless/libertas/assoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ static int assoc_helper_secinfo(wlan_private *priv,
{
wlan_adapter *adapter = priv->adapter;
int ret = 0;
u32 do_wpa;
u32 rsn = 0;

lbs_deb_enter(LBS_DEB_ASSOC);

Expand All @@ -333,12 +335,34 @@ static int assoc_helper_secinfo(wlan_private *priv,
if (ret)
goto out;

/* enable/disable RSN */
/* If RSN is already enabled, don't try to enable it again, since
* ENABLE_RSN resets internal state machines and will clobber the
* 4-way WPA handshake.
*/

/* Get RSN enabled/disabled */
ret = libertas_prepare_and_send_command(priv,
cmd_802_11_enable_rsn,
cmd_act_set,
cmd_option_waitforrsp,
0, assoc_req);
0, &rsn);
if (ret) {
lbs_deb_assoc("Failed to get RSN status: %d", ret);
goto out;
}

/* Don't re-enable RSN if it's already enabled */
do_wpa = (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled);
if (do_wpa == rsn)
goto out;

/* Set RSN enabled/disabled */
rsn = do_wpa;
ret = libertas_prepare_and_send_command(priv,
cmd_802_11_enable_rsn,
cmd_act_set,
cmd_option_waitforrsp,
0, &rsn);

out:
lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
Expand Down
12 changes: 7 additions & 5 deletions trunk/drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,19 @@ static int wlan_cmd_802_11_enable_rsn(wlan_private * priv,
void * pdata_buf)
{
struct cmd_ds_802_11_enable_rsn *penableRSN = &cmd->params.enbrsn;
struct assoc_request * assoc_req = pdata_buf;
u32 * enable = pdata_buf;

lbs_deb_enter(LBS_DEB_CMD);

cmd->command = cpu_to_le16(cmd_802_11_enable_rsn);
cmd->size = cpu_to_le16(sizeof(*penableRSN) + S_DS_GEN);
penableRSN->action = cpu_to_le16(cmd_action);
if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) {
penableRSN->enable = cpu_to_le16(cmd_enable_rsn);
} else {
penableRSN->enable = cpu_to_le16(cmd_disable_rsn);

if (cmd_action == cmd_act_set) {
if (*enable)
penableRSN->enable = cpu_to_le16(cmd_enable_rsn);
else
penableRSN->enable = cpu_to_le16(cmd_enable_rsn);
}

lbs_deb_leave(LBS_DEB_CMD);
Expand Down
21 changes: 21 additions & 0 deletions trunk/drivers/net/wireless/libertas/cmdresp.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,24 @@ static int wlan_ret_get_log(wlan_private * priv,
return 0;
}

static int libertas_ret_802_11_enable_rsn(wlan_private * priv,
struct cmd_ds_command *resp)
{
struct cmd_ds_802_11_enable_rsn *enable_rsn = &resp->params.enbrsn;
wlan_adapter *adapter = priv->adapter;
u32 * pdata_buf = adapter->cur_cmd->pdata_buf;

lbs_deb_enter(LBS_DEB_CMD);

if (enable_rsn->action == cpu_to_le16(cmd_act_get)) {
if (pdata_buf)
*pdata_buf = (u32) le16_to_cpu(enable_rsn->enable);
}

lbs_deb_enter(LBS_DEB_CMD);
return 0;
}

static inline int handle_cmd_response(u16 respcmd,
struct cmd_ds_command *resp,
wlan_private *priv)
Expand Down Expand Up @@ -610,7 +628,10 @@ static inline int handle_cmd_response(u16 respcmd,
case cmd_ret_802_11_authenticate:
case cmd_ret_802_11_radio_control:
case cmd_ret_802_11_beacon_stop:
break;

case cmd_ret_802_11_enable_rsn:
ret = libertas_ret_802_11_enable_rsn(priv, resp);
break;

case cmd_ret_802_11_data_rate:
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/libertas/hostcmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ struct cmd_ds_802_11_ad_hoc_join {
struct cmd_ds_802_11_enable_rsn {
__le16 action;
__le16 enable;
};
} __attribute__ ((packed));

struct MrvlIEtype_keyParamSet {
/* type ID */
Expand Down

0 comments on commit 04a70a2

Please sign in to comment.