diff options
author | Mike McCormack <mikem@ring3k.org> | 2011-07-10 23:56:20 (GMT) |
---|---|---|
committer | Larry Finger <Larry.Finger@lwfinger.net> | 2011-08-24 01:02:27 (GMT) |
commit | cb76215448947ddcc133c4b1c2ff2d4a77e851e0 (patch) | |
tree | fd624f3b0be586b9a1e182b0e5fa68f40db34132 /drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | |
parent | 1ec3e2f255c597c4bff693d0b045a49b12c5bb90 (diff) | |
download | linux-cb76215448947ddcc133c4b1c2ff2d4a77e851e0.tar.xz |
rtl8192e: Remove extra ifdefs
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Diffstat (limited to 'drivers/staging/rtl8192e/rtllib_crypt_ccmp.c')
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c index 80b56b4..ef17c99 100644 --- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c +++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c @@ -22,17 +22,9 @@ #include <linux/wireless.h> #include "rtllib.h" -#if defined(BUILT_IN_CRYPTO) || (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) -#include "rtl_crypto.h" -#else #include <linux/crypto.h> -#endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) - #include <asm/scatterlist.h> -#else - #include <linux/scatterlist.h> -#endif +#include <linux/scatterlist.h> #define AES_BLOCK_LEN 16 #define CCMP_HDR_LEN 8 @@ -64,27 +56,7 @@ struct rtllib_ccmp_data { void rtllib_ccmp_aes_encrypt(struct crypto_tfm *tfm, const u8 pt[16], u8 ct[16]) { -#if ( defined(BUILT_IN_CRYPTO) || ((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ) - struct scatterlist src, dst; - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) - src.page = virt_to_page(pt); - src.offset = offset_in_page(pt); - src.length = AES_BLOCK_LEN; - - dst.page = virt_to_page(ct); - dst.offset = offset_in_page(ct); - dst.length = AES_BLOCK_LEN; - -#else - sg_init_one(&src, pt, AES_BLOCK_LEN); - sg_init_one(&dst, ct, AES_BLOCK_LEN); -#endif - - crypto_cipher_encrypt(tfm, &dst, &src, AES_BLOCK_LEN); -#else crypto_cipher_encrypt_one((void*)tfm, ct, pt); -#endif } static void * rtllib_ccmp_init(int key_idx) @@ -97,32 +69,19 @@ static void * rtllib_ccmp_init(int key_idx) memset(priv, 0, sizeof(*priv)); priv->key_idx = key_idx; -#if ( defined(BUILT_IN_CRYPTO) || ((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ) - priv->tfm = crypto_alloc_tfm("aes", 0); - if (priv->tfm == NULL) { - printk(KERN_DEBUG "rtllib_crypt_ccmp: could not allocate " - "crypto API aes\n"); - goto fail; - } - #else - priv->tfm = (void*)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); + priv->tfm = (void*)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); if (IS_ERR(priv->tfm)) { printk(KERN_DEBUG "rtllib_crypt_ccmp: could not allocate " "crypto API aes\n"); priv->tfm = NULL; goto fail; } - #endif return priv; fail: if (priv) { if (priv->tfm) - #if defined(BUILT_IN_CRYPTO) || (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) - crypto_free_tfm(priv->tfm); - #else crypto_free_cipher((void*)priv->tfm); - #endif kfree(priv); } @@ -134,11 +93,7 @@ static void rtllib_ccmp_deinit(void *priv) { struct rtllib_ccmp_data *_priv = priv; if (_priv && _priv->tfm) -#if defined(BUILT_IN_CRYPTO) || (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) - crypto_free_tfm(_priv->tfm); -#else crypto_free_cipher((void*)_priv->tfm); -#endif kfree(priv); } |