]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ieee80211/ieee80211_crypt_wep.c
hugetlbfs: handle pages higher order than MAX_ORDER
[linux-2.6-omap-h63xx.git] / net / ieee80211 / ieee80211_crypt_wep.c
index 8d182459344e9a94d7f992c97da3fae33e8a2e25..3fa30c40779f6b7c8242541a6a484440409a40d3 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/random.h>
+#include <linux/scatterlist.h>
 #include <linux/skbuff.h>
 #include <linux/mm.h>
 #include <asm/string.h>
@@ -21,7 +22,6 @@
 #include <net/ieee80211.h>
 
 #include <linux/crypto.h>
-#include <asm/scatterlist.h>
 #include <linux/crc32.h>
 
 MODULE_AUTHOR("Jouni Malinen");
@@ -170,9 +170,7 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
        icv[3] = crc >> 24;
 
        crypto_blkcipher_setkey(wep->tx_tfm, key, klen);
-       sg.page = virt_to_page(pos);
-       sg.offset = offset_in_page(pos);
-       sg.length = len + 4;
+       sg_init_one(&sg, pos, len + 4);
        return crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4);
 }
 
@@ -212,9 +210,7 @@ static int prism2_wep_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
        plen = skb->len - hdr_len - 8;
 
        crypto_blkcipher_setkey(wep->rx_tfm, key, klen);
-       sg.page = virt_to_page(pos);
-       sg.offset = offset_in_page(pos);
-       sg.length = plen + 4;
+       sg_init_one(&sg, pos, plen + 4);
        if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4))
                return -7;