diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-07-02 14:14:30 +0200 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-02 14:14:30 +0200 |
commit | 36f9d0c5e9dc650de26b112079f46e6160a881a0 (patch) | |
tree | ec98b93b6292e1bdf1d8a523c40739de4201baf0 /drivers/net/wireless/libertas/assoc.c | |
parent | Linux 2.6.22-rc7 (diff) | |
parent | [PATCH] libertas: remove private ioctls (diff) | |
download | linux-36f9d0c5e9dc650de26b112079f46e6160a881a0.tar.xz linux-36f9d0c5e9dc650de26b112079f46e6160a881a0.zip |
Merge branch 'libertas-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream-fixes
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, { wlan_adapter *adapter = priv->adapter; int ret = 0; + u32 do_wpa; + u32 rsn = 0; lbs_deb_enter(LBS_DEB_ASSOC); @@ -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); |