diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2009-11-03 12:17:24 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 23:23:22 +0300 |
commit | f61fb9356d20977258bb59a8d9f1857d2c58ac98 (patch) | |
tree | 42283f5a2ecfbac99c3ef3abdaefc206931ba55b /drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | |
parent | 8fc8598e61f6f384f3eaf1d9b09500c12af47b37 (diff) | |
download | linux-f61fb9356d20977258bb59a8d9f1857d2c58ac98.tar.xz |
Staging: rtl8192u: make it compile
Add it to staging Kbuild and fixes some API differences that prevents
compilation.
It seems that the ieee80211 stack is very close to rtl8192su one.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 62 |
1 files changed, 4 insertions, 58 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c index a86c26eceb34..181edc46909e 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c @@ -24,27 +24,13 @@ #include "ieee80211.h" -#if (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 <asm/scatterlist.h> MODULE_AUTHOR("Jouni Malinen"); MODULE_DESCRIPTION("Host AP crypt: CCMP"); MODULE_LICENSE("GPL"); -#ifndef OPENSUSE_SLED -#define OPENSUSE_SLED 0 -#endif - #define AES_BLOCK_LEN 16 #define CCMP_HDR_LEN 8 #define CCMP_MIC_LEN 8 @@ -75,21 +61,7 @@ struct ieee80211_ccmp_data { void ieee80211_ccmp_aes_encrypt(struct crypto_tfm *tfm, const u8 pt[16], u8 ct[16]) { -#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) - struct scatterlist src, dst; - - 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; - - crypto_cipher_encrypt(tfm, &dst, &src, AES_BLOCK_LEN); -#else crypto_cipher_encrypt_one((void*)tfm, ct, pt); -#endif } static void * ieee80211_ccmp_init(int key_idx) @@ -102,14 +74,6 @@ static void * ieee80211_ccmp_init(int key_idx) memset(priv, 0, sizeof(*priv)); priv->key_idx = key_idx; -#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) - priv->tfm = crypto_alloc_tfm("aes", 0); - if (priv->tfm == NULL) { - printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate " - "crypto API aes\n"); - goto fail; - } - #else priv->tfm = (void*)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); if (IS_ERR(priv->tfm)) { printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate " @@ -117,17 +81,13 @@ static void * ieee80211_ccmp_init(int key_idx) priv->tfm = NULL; goto fail; } - #endif + return priv; fail: if (priv) { if (priv->tfm) - #if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) - crypto_free_tfm(priv->tfm); - #else crypto_free_cipher((void*)priv->tfm); - #endif kfree(priv); } @@ -138,12 +98,9 @@ fail: static void ieee80211_ccmp_deinit(void *priv) { struct ieee80211_ccmp_data *_priv = priv; + if (_priv && _priv->tfm) -#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) - crypto_free_tfm(_priv->tfm); -#else crypto_free_cipher((void*)_priv->tfm); -#endif kfree(priv); } @@ -512,23 +469,12 @@ static struct ieee80211_crypto_ops ieee80211_crypt_ccmp = { .owner = THIS_MODULE, }; - -static int __init ieee80211_crypto_ccmp_init(void) +int __init ieee80211_crypto_ccmp_init(void) { return ieee80211_register_crypto_ops(&ieee80211_crypt_ccmp); } - -static void __exit ieee80211_crypto_ccmp_exit(void) +void __exit ieee80211_crypto_ccmp_exit(void) { ieee80211_unregister_crypto_ops(&ieee80211_crypt_ccmp); } - -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) -EXPORT_SYMBOL(ieee80211_ccmp_null); -#else -EXPORT_SYMBOL_NOVERS(ieee80211_ccmp_null); -#endif - -module_init(ieee80211_crypto_ccmp_init); -module_exit(ieee80211_crypto_ccmp_exit); |