aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/internal.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-08-06 07:16:34 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2006-09-20 21:17:12 -0400
commit4cc7720cd165273b08a72b4193146dffee58e34b (patch)
tree19c49af8a8195624ae101f665a05efc086c7f53b /crypto/internal.h
parentcce9e06d100df19a327b19f23adad76e7bf63edd (diff)
[CRYPTO] api: Add template registration
A crypto_template generates a crypto_alg object when given a set of parameters. this patch adds the basic data structure fo templates and code to handle their registration/deregistration. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'crypto/internal.h')
-rw-r--r--crypto/internal.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/crypto/internal.h b/crypto/internal.h
index 26f47d331551..c3ab4a950f30 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -19,11 +19,15 @@
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/module.h>
22#include <linux/kernel.h> 23#include <linux/kernel.h>
23#include <linux/rwsem.h> 24#include <linux/rwsem.h>
24#include <linux/slab.h> 25#include <linux/slab.h>
25#include <asm/kmap_types.h> 26#include <asm/kmap_types.h>
26 27
28struct crypto_instance;
29struct crypto_template;
30
27extern struct list_head crypto_alg_list; 31extern struct list_head crypto_alg_list;
28extern struct rw_semaphore crypto_alg_sem; 32extern struct rw_semaphore crypto_alg_sem;
29 33
@@ -112,5 +116,18 @@ void crypto_exit_digest_ops(struct crypto_tfm *tfm);
112void crypto_exit_cipher_ops(struct crypto_tfm *tfm); 116void crypto_exit_cipher_ops(struct crypto_tfm *tfm);
113void crypto_exit_compress_ops(struct crypto_tfm *tfm); 117void crypto_exit_compress_ops(struct crypto_tfm *tfm);
114 118
119int crypto_register_instance(struct crypto_template *tmpl,
120 struct crypto_instance *inst);
121
122static inline int crypto_tmpl_get(struct crypto_template *tmpl)
123{
124 return try_module_get(tmpl->module);
125}
126
127static inline void crypto_tmpl_put(struct crypto_template *tmpl)
128{
129 module_put(tmpl->module);
130}
131
115#endif /* _CRYPTO_INTERNAL_H */ 132#endif /* _CRYPTO_INTERNAL_H */
116 133