Remove the files that are no longer needed and remove the #includes. Signed-off-by: Sean MacLennan <seanm@xxxxxxxx> --- drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h | 382 ------------------------ drivers/staging/rtl8192e/rtl819x_Qos.h | 2 - drivers/staging/rtl8192e/rtllib_crypt.c | 251 ---------------- drivers/staging/rtl8192e/rtllib_crypt.h | 35 --- drivers/staging/rtl8192e/rtllib_endianfree.h | 160 ---------- 5 files changed, 0 insertions(+), 830 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h b/drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h deleted file mode 100644 index ee57c0f..0000000 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Scatterlist Cryptographic API. - * - * Copyright (c) 2002 James Morris <jmorris@xxxxxxxxxxxxxxxx> - * Copyright (c) 2002 David S. Miller (davem@xxxxxxxxxx) - * - * Portions derived from Cryptoapi, by Alexander Kjeldaas <astor@xxxxxxx> - * and Nettle, by Niels Mler. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - */ -#ifndef _LINUX_CRYPTO_H -#define _LINUX_CRYPTO_H - -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/types.h> -#include <linux/list.h> -#include <linux/string.h> -#include <asm/page.h> -#include <linux/errno.h> - -#define crypto_register_alg crypto_register_alg_rsl -#define crypto_unregister_alg crypto_unregister_alg_rsl -#define crypto_alloc_tfm crypto_alloc_tfm_rsl -#define crypto_free_tfm crypto_free_tfm_rsl -#define crypto_alg_available crypto_alg_available_rsl - -/* - * Algorithm masks and types. - */ -#define CRYPTO_ALG_TYPE_MASK 0x000000ff -#define CRYPTO_ALG_TYPE_CIPHER 0x00000001 -#define CRYPTO_ALG_TYPE_DIGEST 0x00000002 -#define CRYPTO_ALG_TYPE_COMPRESS 0x00000004 - -/* - * Transform masks and values (for crt_flags). - */ -#define CRYPTO_TFM_MODE_MASK 0x000000ff -#define CRYPTO_TFM_REQ_MASK 0x000fff00 -#define CRYPTO_TFM_RES_MASK 0xfff00000 - -#define CRYPTO_TFM_MODE_ECB 0x00000001 -#define CRYPTO_TFM_MODE_CBC 0x00000002 -#define CRYPTO_TFM_MODE_CFB 0x00000004 -#define CRYPTO_TFM_MODE_CTR 0x00000008 - -#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 -#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 -#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000 -#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000 -#define CRYPTO_TFM_RES_BAD_BLOCK_LEN 0x00800000 -#define CRYPTO_TFM_RES_BAD_FLAGS 0x01000000 - -/* - * Miscellaneous stuff. - */ -#define CRYPTO_UNSPEC 0 -#define CRYPTO_MAX_ALG_NAME 64 - -struct scatterlist; - -/* - * Algorithms: modular crypto algorithm implementations, managed - * via crypto_register_alg() and crypto_unregister_alg(). - */ -struct cipher_alg { - unsigned int cia_min_keysize; - unsigned int cia_max_keysize; - int (*cia_setkey)(void *ctx, const u8 *key, - unsigned int keylen, u32 *flags); - void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src); - void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src); -}; - -struct digest_alg { - unsigned int dia_digestsize; - void (*dia_init)(void *ctx); - void (*dia_update)(void *ctx, const u8 *data, unsigned int len); - void (*dia_final)(void *ctx, u8 *out); - int (*dia_setkey)(void *ctx, const u8 *key, - unsigned int keylen, u32 *flags); -}; - -struct compress_alg { - int (*coa_init)(void *ctx); - void (*coa_exit)(void *ctx); - int (*coa_compress)(void *ctx, const u8 *src, unsigned int slen, - u8 *dst, unsigned int *dlen); - int (*coa_decompress)(void *ctx, const u8 *src, unsigned int slen, - u8 *dst, unsigned int *dlen); -}; - -#define cra_cipher cra_u.cipher -#define cra_digest cra_u.digest -#define cra_compress cra_u.compress - -struct crypto_alg { - struct list_head cra_list; - u32 cra_flags; - unsigned int cra_blocksize; - unsigned int cra_ctxsize; - const char cra_name[CRYPTO_MAX_ALG_NAME]; - - union { - struct cipher_alg cipher; - struct digest_alg digest; - struct compress_alg compress; - } cra_u; - - struct module *cra_module; -}; - -/* - * Algorithm registration interface. - */ -int crypto_register_alg(struct crypto_alg *alg); -int crypto_unregister_alg(struct crypto_alg *alg); - -/* - * Algorithm query interface. - */ -int crypto_alg_available(const char *name, u32 flags); - -/* - * Transforms: user-instantiated objects which encapsulate algorithms - * and core processing logic. Managed via crypto_alloc_tfm() and - * crypto_free_tfm(), as well as the various helpers below. - */ -struct crypto_tfm; - -struct cipher_tfm { - void *cit_iv; - unsigned int cit_ivsize; - u32 cit_mode; - int (*cit_setkey)(struct crypto_tfm *tfm, - const u8 *key, unsigned int keylen); - int (*cit_encrypt)(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes); - int (*cit_encrypt_iv)(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes, u8 *iv); - int (*cit_decrypt)(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes); - int (*cit_decrypt_iv)(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes, u8 *iv); - void (*cit_xor_block)(u8 *dst, const u8 *src); -}; - -struct digest_tfm { - void (*dit_init)(struct crypto_tfm *tfm); - void (*dit_update)(struct crypto_tfm *tfm, - struct scatterlist *sg, unsigned int nsg); - void (*dit_final)(struct crypto_tfm *tfm, u8 *out); - void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg, - unsigned int nsg, u8 *out); - int (*dit_setkey)(struct crypto_tfm *tfm, - const u8 *key, unsigned int keylen); -}; - -struct compress_tfm { - int (*cot_compress)(struct crypto_tfm *tfm, - const u8 *src, unsigned int slen, - u8 *dst, unsigned int *dlen); - int (*cot_decompress)(struct crypto_tfm *tfm, - const u8 *src, unsigned int slen, - u8 *dst, unsigned int *dlen); -}; - -#define crt_cipher crt_u.cipher -#define crt_digest crt_u.digest -#define crt_compress crt_u.compress - -struct crypto_tfm { - - u32 crt_flags; - - union { - struct cipher_tfm cipher; - struct digest_tfm digest; - struct compress_tfm compress; - } crt_u; - - struct crypto_alg *__crt_alg; -}; - -/* - * Transform user interface. - */ - -/* - * crypto_alloc_tfm() will first attempt to locate an already loaded algorithm. - * If that fails and the kernel supports dynamically loadable modules, it - * will then attempt to load a module of the same name or alias. A refcount - * is grabbed on the algorithm which is then associated with the new transform. - * - * crypto_free_tfm() frees up the transform and any associated resources, - * then drops the refcount on the associated algorithm. - */ -struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags); -void crypto_free_tfm(struct crypto_tfm *tfm); - -/* - * Transform helpers which query the underlying algorithm. - */ -static inline const char *crypto_tfm_alg_name(struct crypto_tfm *tfm) -{ - return tfm->__crt_alg->cra_name; -} - -static inline const char *crypto_tfm_alg_modname(struct crypto_tfm *tfm) -{ - struct crypto_alg *alg = tfm->__crt_alg; - - if (alg->cra_module) - return alg->cra_module->name; - else - return NULL; -} - -static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm) -{ - return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; -} - -static inline unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - return tfm->__crt_alg->cra_cipher.cia_min_keysize; -} - -static inline unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - return tfm->__crt_alg->cra_cipher.cia_max_keysize; -} - -static inline unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - return tfm->crt_cipher.cit_ivsize; -} - -static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm) -{ - return tfm->__crt_alg->cra_blocksize; -} - -static inline unsigned int crypto_tfm_alg_digestsize(struct crypto_tfm *tfm) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); - return tfm->__crt_alg->cra_digest.dia_digestsize; -} - -/* - * API wrappers. - */ -static inline void crypto_digest_init(struct crypto_tfm *tfm) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); - tfm->crt_digest.dit_init(tfm); -} - -static inline void crypto_digest_update(struct crypto_tfm *tfm, - struct scatterlist *sg, - unsigned int nsg) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); - tfm->crt_digest.dit_update(tfm, sg, nsg); -} - -static inline void crypto_digest_final(struct crypto_tfm *tfm, u8 *out) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); - tfm->crt_digest.dit_final(tfm, out); -} - -static inline void crypto_digest_digest(struct crypto_tfm *tfm, - struct scatterlist *sg, - unsigned int nsg, u8 *out) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); - tfm->crt_digest.dit_digest(tfm, sg, nsg, out); -} - -static inline int crypto_digest_setkey(struct crypto_tfm *tfm, - const u8 *key, unsigned int keylen) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); - if (tfm->crt_digest.dit_setkey == NULL) - return -ENOSYS; - return tfm->crt_digest.dit_setkey(tfm, key, keylen); -} - -static inline int crypto_cipher_setkey(struct crypto_tfm *tfm, - const u8 *key, unsigned int keylen) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - return tfm->crt_cipher.cit_setkey(tfm, key, keylen); -} - -static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes); -} - -static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes, u8 *iv) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB); - return tfm->crt_cipher.cit_encrypt_iv(tfm, dst, src, nbytes, iv); -} - -static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes); -} - -static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes, u8 *iv) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB); - return tfm->crt_cipher.cit_decrypt_iv(tfm, dst, src, nbytes, iv); -} - -static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm, - const u8 *src, unsigned int len) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - memcpy(tfm->crt_cipher.cit_iv, src, len); -} - -static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm, - u8 *dst, unsigned int len) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - memcpy(dst, tfm->crt_cipher.cit_iv, len); -} - -static inline int crypto_comp_compress(struct crypto_tfm *tfm, - const u8 *src, unsigned int slen, - u8 *dst, unsigned int *dlen) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); - return tfm->crt_compress.cot_compress(tfm, src, slen, dst, dlen); -} - -static inline int crypto_comp_decompress(struct crypto_tfm *tfm, - const u8 *src, unsigned int slen, - u8 *dst, unsigned int *dlen) -{ - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); - return tfm->crt_compress.cot_decompress(tfm, src, slen, dst, dlen); -} - -#endif /* _LINUX_CRYPTO_H */ diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h index 5ecd556..57b48e4 100644 --- a/drivers/staging/rtl8192e/rtl819x_Qos.h +++ b/drivers/staging/rtl8192e/rtl819x_Qos.h @@ -19,8 +19,6 @@ #ifndef __INC_QOS_TYPE_H #define __INC_QOS_TYPE_H -#include "rtllib_endianfree.h" - #define BIT0 0x00000001 #define BIT1 0x00000002 #define BIT2 0x00000004 diff --git a/drivers/staging/rtl8192e/rtllib_crypt.c b/drivers/staging/rtl8192e/rtllib_crypt.c deleted file mode 100644 index 86152d0..0000000 --- a/drivers/staging/rtl8192e/rtllib_crypt.c +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Host AP crypto routines - * - * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@xxxxxxxxx> - * Portions Copyright (C) 2004, Intel Corporation <jketreno@xxxxxxxxxxxxxxx> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. See README and COPYING for - * more details. - * - */ - -#include <linux/module.h> -#include <linux/init.h> -#include <linux/slab.h> -#include <linux/string.h> -#include <linux/errno.h> - -#include "rtllib.h" - -struct rtllib_crypto_alg { - struct list_head list; - struct lib80211_crypto_ops *ops; -}; - - -struct rtllib_crypto { - struct list_head algs; - spinlock_t lock; -}; - -static struct rtllib_crypto *hcrypt; - -void rtllib_crypt_deinit_entries(struct lib80211_crypt_info *info, - int force) -{ - struct list_head *ptr, *n; - struct lib80211_crypt_data *entry; - - for (ptr = info->crypt_deinit_list.next, n = ptr->next; - ptr != &info->crypt_deinit_list; ptr = n, n = ptr->next) { - entry = list_entry(ptr, struct lib80211_crypt_data, list); - - if (atomic_read(&entry->refcnt) != 0 && !force) - continue; - - list_del(ptr); - - if (entry->ops) - entry->ops->deinit(entry->priv); - kfree(entry); - } -} -EXPORT_SYMBOL(rtllib_crypt_deinit_entries); - -void rtllib_crypt_deinit_handler(unsigned long data) -{ - struct lib80211_crypt_info *info = (struct lib80211_crypt_info *)data; - unsigned long flags; - - spin_lock_irqsave(info->lock, flags); - rtllib_crypt_deinit_entries(info, 0); - if (!list_empty(&info->crypt_deinit_list)) { - printk(KERN_DEBUG "%s: entries remaining in delayed crypt " - "deletion list\n", info->name); - info->crypt_deinit_timer.expires = jiffies + HZ; - add_timer(&info->crypt_deinit_timer); - } - spin_unlock_irqrestore(info->lock, flags); - -} -EXPORT_SYMBOL(rtllib_crypt_deinit_handler); - -void rtllib_crypt_delayed_deinit(struct lib80211_crypt_info *info, - struct lib80211_crypt_data **crypt) -{ - struct lib80211_crypt_data *tmp; - unsigned long flags; - - if (*crypt == NULL) - return; - - tmp = *crypt; - *crypt = NULL; - - /* must not run ops->deinit() while there may be pending encrypt or - * decrypt operations. Use a list of delayed deinits to avoid needing - * locking. */ - - spin_lock_irqsave(info->lock, flags); - list_add(&tmp->list, &info->crypt_deinit_list); - if (!timer_pending(&info->crypt_deinit_timer)) { - info->crypt_deinit_timer.expires = jiffies + HZ; - add_timer(&info->crypt_deinit_timer); - } - spin_unlock_irqrestore(info->lock, flags); -} -EXPORT_SYMBOL(rtllib_crypt_delayed_deinit); - -int rtllib_register_crypto_ops(struct lib80211_crypto_ops *ops) -{ - unsigned long flags; - struct rtllib_crypto_alg *alg; - - if (hcrypt == NULL) - return -1; - - alg = kzalloc(sizeof(*alg), GFP_KERNEL); - if (alg == NULL) - return -ENOMEM; - - alg->ops = ops; - - spin_lock_irqsave(&hcrypt->lock, flags); - list_add(&alg->list, &hcrypt->algs); - spin_unlock_irqrestore(&hcrypt->lock, flags); - - printk(KERN_DEBUG "rtllib_crypt: registered algorithm '%s'\n", - ops->name); - - return 0; -} -EXPORT_SYMBOL(rtllib_register_crypto_ops); - -int rtllib_unregister_crypto_ops(struct lib80211_crypto_ops *ops) -{ - unsigned long flags; - struct list_head *ptr; - struct rtllib_crypto_alg *del_alg = NULL; - - if (hcrypt == NULL) - return -1; - - spin_lock_irqsave(&hcrypt->lock, flags); - for (ptr = hcrypt->algs.next; ptr != &hcrypt->algs; ptr = ptr->next) { - struct rtllib_crypto_alg *alg = - (struct rtllib_crypto_alg *) ptr; - if (alg->ops == ops) { - list_del(&alg->list); - del_alg = alg; - break; - } - } - spin_unlock_irqrestore(&hcrypt->lock, flags); - - if (del_alg) { - printk(KERN_DEBUG "rtllib_crypt: unregistered algorithm " - "'%s'\n", ops->name); - kfree(del_alg); - } - - return del_alg ? 0 : -1; -} -EXPORT_SYMBOL(rtllib_unregister_crypto_ops); - - -struct lib80211_crypto_ops *rtllib_get_crypto_ops(const char *name) -{ - unsigned long flags; - struct list_head *ptr; - struct rtllib_crypto_alg *found_alg = NULL; - - if (hcrypt == NULL) - return NULL; - - spin_lock_irqsave(&hcrypt->lock, flags); - for (ptr = hcrypt->algs.next; ptr != &hcrypt->algs; ptr = ptr->next) { - struct rtllib_crypto_alg *alg = - (struct rtllib_crypto_alg *) ptr; - if (strcmp(alg->ops->name, name) == 0) { - found_alg = alg; - break; - } - } - spin_unlock_irqrestore(&hcrypt->lock, flags); - - if (found_alg) - return found_alg->ops; - else - return NULL; -} -EXPORT_SYMBOL(rtllib_get_crypto_ops); - - -static void * rtllib_crypt_null_init(int keyidx) { return (void *) 1; } -static void rtllib_crypt_null_deinit(void *priv) {} - -static struct lib80211_crypto_ops rtllib_crypt_null = { - .name = "NULL", - .init = rtllib_crypt_null_init, - .deinit = rtllib_crypt_null_deinit, - .encrypt_mpdu = NULL, - .decrypt_mpdu = NULL, - .encrypt_msdu = NULL, - .decrypt_msdu = NULL, - .set_key = NULL, - .get_key = NULL, - .extra_mpdu_prefix_len = 0, - .extra_mpdu_postfix_len = 0, - .extra_msdu_prefix_len = 0, - .extra_msdu_postfix_len = 0, - .owner = THIS_MODULE, -}; - - -int __init rtllib_crypto_init(void) -{ - int ret = -ENOMEM; - - hcrypt = kzalloc(sizeof(*hcrypt), GFP_KERNEL); - if (!hcrypt) - goto out; - - INIT_LIST_HEAD(&hcrypt->algs); - spin_lock_init(&hcrypt->lock); - - ret = lib80211_register_crypto_ops(&rtllib_crypt_null); - if (ret < 0) { - kfree(hcrypt); - hcrypt = NULL; - } -out: - return ret; -} - - -void __exit rtllib_crypto_deinit(void) -{ - struct list_head *ptr, *n; - - if (hcrypt == NULL) - return; - - for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs; - ptr = n, n = ptr->next) { - struct rtllib_crypto_alg *alg = - (struct rtllib_crypto_alg *) ptr; - list_del(ptr); - printk(KERN_DEBUG "rtllib_crypt: unregistered algorithm " - "'%s' (deinit)\n", alg->ops->name); - kfree(alg); - } - - kfree(hcrypt); -} - -module_init(rtllib_crypto_init); -module_exit(rtllib_crypto_deinit); - -MODULE_LICENSE("GPL"); diff --git a/drivers/staging/rtl8192e/rtllib_crypt.h b/drivers/staging/rtl8192e/rtllib_crypt.h deleted file mode 100644 index e177c92..0000000 --- a/drivers/staging/rtl8192e/rtllib_crypt.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Original code based on Host AP (software wireless LAN access point) driver - * for Intersil Prism2/2.5/3. - * - * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen - * <jkmaline@xxxxxxxxx> - * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@xxxxxxxxx> - * - * Adaption to a generic IEEE 802.11 stack by James Ketrenos - * <jketreno@xxxxxxxxxxxxxxx> - * - * Copyright (c) 2004, Intel Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. See README and COPYING for - * more details. - */ - -/* - * This file defines the interface to the rtllib crypto module. - */ -#ifndef RTLLIB_CRYPT_H -#define RTLLIB_CRYPT_H - -#include <linux/skbuff.h> - -int rtllib_register_crypto_ops(struct lib80211_crypto_ops *ops); -int rtllib_unregister_crypto_ops(struct lib80211_crypto_ops *ops); -struct lib80211_crypto_ops *rtllib_get_crypto_ops(const char *name); -void rtllib_crypt_deinit_entries(struct lib80211_crypt_info *info, int force); -void rtllib_crypt_deinit_handler(unsigned long data); -void rtllib_crypt_delayed_deinit(struct lib80211_crypt_info *info, - struct lib80211_crypt_data **crypt); -#endif diff --git a/drivers/staging/rtl8192e/rtllib_endianfree.h b/drivers/staging/rtl8192e/rtllib_endianfree.h deleted file mode 100644 index b268605..0000000 --- a/drivers/staging/rtl8192e/rtllib_endianfree.h +++ /dev/null @@ -1,160 +0,0 @@ -#ifndef __INC_ENDIANFREE_H -#define __INC_ENDIANFREE_H - -/* - * Call endian free function when - * 1. Read/write packet content. - * 2. Before write integer to IO. - * 3. After read integer from IO. - */ - -#define __MACHINE_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define __MACHINE_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net, ppc */ - -#define BYTE_ORDER __MACHINE_LITTLE_ENDIAN - -#if BYTE_ORDER == __MACHINE_LITTLE_ENDIAN -#define EF1Byte(_val) ((u8)(_val)) -#define EF2Byte(_val) ((u16)(_val)) -#define EF4Byte(_val) ((u32)(_val)) - -#else -#define EF1Byte(_val) ((u8)(_val)) -#define EF2Byte(_val) \ - (((((u16)(_val))&0x00ff)<<8)|((((u16)(_val))&0xff00)>>8)) -#define EF4Byte(_val) \ - (((((u32)(_val))&0x000000ff)<<24)|\ - ((((u32)(_val))&0x0000ff00)<<8)|\ - ((((u32)(_val))&0x00ff0000)>>8)|\ - ((((u32)(_val))&0xff000000)>>24)) -#endif - -#define ReadEF1Byte(_ptr) EF1Byte(*((u8 *)(_ptr))) -#define ReadEF2Byte(_ptr) EF2Byte(*((u16 *)(_ptr))) -#define ReadEF4Byte(_ptr) EF4Byte(*((u32 *)(_ptr))) - -#define WriteEF1Byte(_ptr, _val) (*((u8 *)(_ptr))) = EF1Byte(_val) -#define WriteEF2Byte(_ptr, _val) (*((u16 *)(_ptr))) = EF2Byte(_val) -#define WriteEF4Byte(_ptr, _val) (*((u32 *)(_ptr))) = EF4Byte(_val) -#if BYTE_ORDER == __MACHINE_LITTLE_ENDIAN -#define H2N1BYTE(_val) ((u8)(_val)) -#define H2N2BYTE(_val) (((((u16)(_val))&0x00ff)<<8)|\ - ((((u16)(_val))&0xff00)>>8)) -#define H2N4BYTE(_val) (((((u32)(_val))&0x000000ff)<<24)|\ - ((((u32)(_val))&0x0000ff00)<<8) |\ - ((((u32)(_val))&0x00ff0000)>>8) |\ - ((((u32)(_val))&0xff000000)>>24)) -#else -#define H2N1BYTE(_val) ((u8)(_val)) -#define H2N2BYTE(_val) ((u16)(_val)) -#define H2N4BYTE(_val) ((u32)(_val)) -#endif - -#if BYTE_ORDER == __MACHINE_LITTLE_ENDIAN -#define N2H1BYTE(_val) ((u8)(_val)) -#define N2H2BYTE(_val) (((((u16)(_val))&0x00ff)<<8)|\ - ((((u16)(_val))&0xff00)>>8)) -#define N2H4BYTE(_val) (((((u32)(_val))&0x000000ff)<<24)|\ - ((((u32)(_val))&0x0000ff00)<<8) |\ - ((((u32)(_val))&0x00ff0000)>>8) |\ - ((((u32)(_val))&0xff000000)>>24)) -#else -#define N2H1BYTE(_val) ((u8)(_val)) -#define N2H2BYTE(_val) ((u16)(_val)) -#define N2H4BYTE(_val) ((u32)(_val)) -#endif - -#define BIT_LEN_MASK_32(__BitLen) (0xFFFFFFFF >> (32 - (__BitLen))) -#define BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen) \ - (BIT_LEN_MASK_32(__BitLen) << (__BitOffset)) - -#define LE_P4BYTE_TO_HOST_4BYTE(__pStart) (EF4Byte(*((u32 *)(__pStart)))) - -#define LE_BITS_TO_4BYTE(__pStart, __BitOffset, __BitLen) \ - ( \ - (LE_P4BYTE_TO_HOST_4BYTE(__pStart) >> (__BitOffset)) \ - & \ - BIT_LEN_MASK_32(__BitLen) \ - ) - -#define LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \ - ( \ - LE_P4BYTE_TO_HOST_4BYTE(__pStart) \ - & \ - (~BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen)) \ - ) - -#define SET_BITS_TO_LE_4BYTE(__pStart, __BitOffset, __BitLen, __Value) \ - *((u32 *)(__pStart)) = \ - EF4Byte( \ - LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \ - | \ - ((((u32)__Value) & BIT_LEN_MASK_32(__BitLen)) << (__BitOffset)) \ - ); - - -#define BIT_LEN_MASK_16(__BitLen) \ - (0xFFFF >> (16 - (__BitLen))) - -#define BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) \ - (BIT_LEN_MASK_16(__BitLen) << (__BitOffset)) - -#define LE_P2BYTE_TO_HOST_2BYTE(__pStart) \ - (EF2Byte(*((u16 *)(__pStart)))) - -#define LE_BITS_TO_2BYTE(__pStart, __BitOffset, __BitLen) \ - ( \ - (LE_P2BYTE_TO_HOST_2BYTE(__pStart) >> (__BitOffset)) \ - & \ - BIT_LEN_MASK_16(__BitLen) \ - ) - -#define LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \ - ( \ - LE_P2BYTE_TO_HOST_2BYTE(__pStart) \ - & \ - (~BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen)) \ - ) - -#define SET_BITS_TO_LE_2BYTE(__pStart, __BitOffset, __BitLen, __Value) \ - *((u16 *)(__pStart)) = \ - EF2Byte( \ - LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \ - | ((((u16)__Value) & BIT_LEN_MASK_16(__BitLen)) << \ - (__BitOffset)) \ - ); - -#define BIT_LEN_MASK_8(__BitLen) \ - (0xFF >> (8 - (__BitLen))) - -#define BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) \ - (BIT_LEN_MASK_8(__BitLen) << (__BitOffset)) - -#define LE_P1BYTE_TO_HOST_1BYTE(__pStart) \ - (EF1Byte(*((u8 *)(__pStart)))) - -#define LE_BITS_TO_1BYTE(__pStart, __BitOffset, __BitLen) \ - ( \ - (LE_P1BYTE_TO_HOST_1BYTE(__pStart) >> (__BitOffset)) \ - & \ - BIT_LEN_MASK_8(__BitLen) \ - ) - -#define LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \ - ( \ - LE_P1BYTE_TO_HOST_1BYTE(__pStart) \ - & \ - (~BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen)) \ - ) - -#define SET_BITS_TO_LE_1BYTE(__pStart, __BitOffset, __BitLen, __Value) \ - *((u8 *)(__pStart)) = EF1Byte( \ - LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \ - | ((((u8)__Value) & BIT_LEN_MASK_8(__BitLen)) << \ - (__BitOffset)) \ - ); - -#define N_BYTE_ALIGMENT(__Value, __Aligment) \ - ((__Aligment == 1) ? (__Value) : (((__Value + __Aligment - 1) / \ - __Aligment) * __Aligment)) -#endif _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel