diff options
Diffstat (limited to 'drivers/net/wireless/libertas/assoc.c')
-rw-r--r-- | drivers/net/wireless/libertas/assoc.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index f67efa0815fe..afd5617dd92b 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c | |||
@@ -323,6 +323,8 @@ static int assoc_helper_secinfo(wlan_private *priv, | |||
323 | { | 323 | { |
324 | wlan_adapter *adapter = priv->adapter; | 324 | wlan_adapter *adapter = priv->adapter; |
325 | int ret = 0; | 325 | int ret = 0; |
326 | u32 do_wpa; | ||
327 | u32 rsn = 0; | ||
326 | 328 | ||
327 | lbs_deb_enter(LBS_DEB_ASSOC); | 329 | lbs_deb_enter(LBS_DEB_ASSOC); |
328 | 330 | ||
@@ -333,12 +335,34 @@ static int assoc_helper_secinfo(wlan_private *priv, | |||
333 | if (ret) | 335 | if (ret) |
334 | goto out; | 336 | goto out; |
335 | 337 | ||
336 | /* enable/disable RSN */ | 338 | /* If RSN is already enabled, don't try to enable it again, since |
339 | * ENABLE_RSN resets internal state machines and will clobber the | ||
340 | * 4-way WPA handshake. | ||
341 | */ | ||
342 | |||
343 | /* Get RSN enabled/disabled */ | ||
337 | ret = libertas_prepare_and_send_command(priv, | 344 | ret = libertas_prepare_and_send_command(priv, |
338 | cmd_802_11_enable_rsn, | 345 | cmd_802_11_enable_rsn, |
339 | cmd_act_set, | 346 | cmd_act_set, |
340 | cmd_option_waitforrsp, | 347 | cmd_option_waitforrsp, |
341 | 0, assoc_req); | 348 | 0, &rsn); |
349 | if (ret) { | ||
350 | lbs_deb_assoc("Failed to get RSN status: %d", ret); | ||
351 | goto out; | ||
352 | } | ||
353 | |||
354 | /* Don't re-enable RSN if it's already enabled */ | ||
355 | do_wpa = (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled); | ||
356 | if (do_wpa == rsn) | ||
357 | goto out; | ||
358 | |||
359 | /* Set RSN enabled/disabled */ | ||
360 | rsn = do_wpa; | ||
361 | ret = libertas_prepare_and_send_command(priv, | ||
362 | cmd_802_11_enable_rsn, | ||
363 | cmd_act_set, | ||
364 | cmd_option_waitforrsp, | ||
365 | 0, &rsn); | ||
342 | 366 | ||
343 | out: | 367 | out: |
344 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); | 368 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |