]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/mac80211/wep.c
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[net-next-2.6.git] / net / mac80211 / wep.c
index 247123fe1a7a6307aa41a7fea01a7378ccec53e3..5f3a4113bda1682bb0d30f0eaebd6f153037e3b5 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/err.h>
 #include <linux/mm.h>
 #include <linux/scatterlist.h>
+#include <linux/slab.h>
 #include <asm/unaligned.h>
 
 #include <net/mac80211.h>
@@ -305,20 +306,19 @@ static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb)
 {
        struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 
-       if (!(tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) {
+       if (!info->control.hw_key) {
                if (ieee80211_wep_encrypt(tx->local, skb, tx->key->conf.key,
                                          tx->key->conf.keylen,
                                          tx->key->conf.keyidx))
                        return -1;
-       } else {
-               info->control.hw_key = &tx->key->conf;
-               if (tx->key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) {
-                       if (!ieee80211_wep_add_iv(tx->local, skb,
-                                                 tx->key->conf.keylen,
-                                                 tx->key->conf.keyidx))
-                               return -1;
-               }
+       } else if (info->control.hw_key->flags &
+                       IEEE80211_KEY_FLAG_GENERATE_IV) {
+               if (!ieee80211_wep_add_iv(tx->local, skb,
+                                         tx->key->conf.keylen,
+                                         tx->key->conf.keyidx))
+                       return -1;
        }
+
        return 0;
 }