Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2bcde51d095490c223bb4ade351cb7981c367934
Commit:     2bcde51d095490c223bb4ade351cb7981c367934
Parent:     515ea2492cfc93233ba31402d1992a435aa78f37
Author:     Dan Williams <[EMAIL PROTECTED]>
AuthorDate: Wed Oct 3 10:37:45 2007 -0400
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:55:18 2007 -0700

    [PATCH] libertas: problems setting wpa keys
    
    The 88w8385 chip, using SDIO interface and firmware release 5.0.11p0,
    has problems when both unicast and multicast WPA keys are set in one
    command. This patch ensures the keys are set independently.
    
    The original author of this patch is Marc Pignat <[EMAIL PROTECTED]>
    
    Signed-off-by: Marc Pignat <[EMAIL PROTECTED]>
    Signed-off-by: Dan Williams <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 drivers/net/wireless/libertas/assoc.c |   35 ++++++++++++++++++++++++++++----
 1 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/libertas/assoc.c 
b/drivers/net/wireless/libertas/assoc.c
index 2c6ddb1..b61b176 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -374,15 +374,40 @@ static int assoc_helper_wpa_keys(wlan_private *priv,
                                  struct assoc_request * assoc_req)
 {
        int ret = 0;
+       unsigned int flags = assoc_req->flags;
 
        lbs_deb_enter(LBS_DEB_ASSOC);
 
-       ret = libertas_prepare_and_send_command(priv,
-                                   CMD_802_11_KEY_MATERIAL,
-                                   CMD_ACT_SET,
-                                   CMD_OPTION_WAITFORRSP,
-                                   0, assoc_req);
+       /* Work around older firmware bug where WPA unicast and multicast
+        * keys must be set independently.  Seen in SDIO parts with firmware
+        * version 5.0.11p0.
+        */
 
+       if (test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) {
+               clear_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags);
+               ret = libertas_prepare_and_send_command(priv,
+                                       CMD_802_11_KEY_MATERIAL,
+                                       CMD_ACT_SET,
+                                       CMD_OPTION_WAITFORRSP,
+                                       0, assoc_req);
+               assoc_req->flags = flags;
+       }
+
+       if (ret)
+               goto out;
+
+       if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) {
+               clear_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags);
+
+               ret = libertas_prepare_and_send_command(priv,
+                                       CMD_802_11_KEY_MATERIAL,
+                                       CMD_ACT_SET,
+                                       CMD_OPTION_WAITFORRSP,
+                                       0, assoc_req);
+               assoc_req->flags = flags;
+       }
+
+out:
        lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
        return ret;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to