[PATCH] ieee80211: Allow drivers to fix an issue when using wpa_supplicant with WEP
authorJames Ketrenos <jketreno@linux.intel.com>
Wed, 21 Sep 2005 16:54:22 +0000 (11:54 -0500)
committerJeff Garzik <jgarzik@pobox.com>
Thu, 22 Sep 2005 03:01:52 +0000 (23:01 -0400)
tree 898fedef6ca1b5b58b8bdf7e6d8894a78bbde4cd
parent 8720fff53090ae428d2159332b6f4b2749dea10f
author Zhu Yi <jketreno@io.(none)> 1124435746 -0500
committer James Ketrenos <jketreno@linux.intel.com> 1127312509 -0500

Allow drivers to fix an issue when using wpa_supplicant with WEP.

The problem is introduced by the hwcrypto patch. We changed indicator of
the encryption request from the upper layer (i.e. wpa_supplicant):

In the original host based crypto the driver could use: crypt &&
crypt->ops.

In the new hardware based crypto, the driver should use the flags
specified in ieee->sec.encrypt.

Signed-off-by: James Ketrenos <jketreno@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
include/net/ieee80211.h
net/ieee80211/ieee80211_wx.c

index 6cc0674e560603219a720b73e141d73b33a285fa..c7ab7cd9de133a185ecd6efd309c0235790ca895 100644 (file)
@@ -439,7 +439,7 @@ struct ieee80211_device;
 #define SEC_UNICAST_GROUP      (1<<6)
 #define SEC_LEVEL              (1<<7)
 #define SEC_ENABLED            (1<<8)
-#define SEC_TGI_KEY_RESET      (1<<9)
+#define SEC_ENCRYPT            (1<<9)
 
 #define SEC_LEVEL_0            0       /* None */
 #define SEC_LEVEL_1            1       /* WEP 40 and 104 bit */
index df64bf3716b78704f2b543520c2f3f946e5f2227..49afea7989d0b69c17484ed77dfc1315d6f36be6 100644 (file)
@@ -322,7 +322,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
                        sec.enabled = 0;
                        sec.encrypt = 0;
                        sec.level = SEC_LEVEL_0;
-                       sec.flags |= SEC_ENABLED | SEC_LEVEL;
+                       sec.flags |= SEC_ENABLED | SEC_LEVEL | SEC_ENCRYPT;
                }
 
                goto done;
@@ -330,7 +330,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
 
        sec.enabled = 1;
        sec.encrypt = 1;
-       sec.flags |= SEC_ENABLED;
+       sec.flags |= SEC_ENABLED | SEC_ENCRYPT;
 
        if (*crypt != NULL && (*crypt)->ops != NULL &&
            strcmp((*crypt)->ops->name, "WEP") != 0) {
@@ -412,8 +412,6 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
                        sec.flags |= SEC_ACTIVE_KEY;
                }
        }
-
-      done:
        ieee->open_wep = !(erq->flags & IW_ENCODE_RESTRICTED);
        sec.auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN : WLAN_AUTH_SHARED_KEY;
        sec.flags |= SEC_AUTH_MODE;
@@ -425,6 +423,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
        sec.flags |= SEC_LEVEL;
        sec.level = SEC_LEVEL_1;        /* 40 and 104 bit WEP */
 
+      done:
        if (ieee->set_security)
                ieee->set_security(dev, &sec);