[PATCH] Use sg_set_buf/sg_init_one where applicable
[safe/jmp/linux-2.6] / drivers / net / wireless / airo.c
index 4c11699..1609ce1 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/interrupt.h>
 #include <linux/in.h>
 #include <linux/bitops.h>
+#include <linux/scatterlist.h>
 #include <asm/io.h>
 #include <asm/system.h>
 
@@ -1590,9 +1591,7 @@ static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct
                aes_counter[12] = (u8)(counter >> 24);
                counter++;
                memcpy (plain, aes_counter, 16);
-               sg[0].page = virt_to_page(plain);
-               sg[0].offset = ((long) plain & ~PAGE_MASK);
-               sg[0].length = 16;
+               sg_set_buf(&sg[0], plain, 16);
                crypto_cipher_encrypt(tfm, sg, sg, 16);
                cipher = kmap(sg[0].page) + sg[0].offset;
                for (j=0; (j<16) && (i< (sizeof(context->coeff)/sizeof(context->coeff[0]))); ) {