diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-08-06 07:16:34 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2006-09-20 21:17:12 -0400 |
commit | 4cc7720cd165273b08a72b4193146dffee58e34b (patch) | |
tree | 19c49af8a8195624ae101f665a05efc086c7f53b /crypto/internal.h | |
parent | cce9e06d100df19a327b19f23adad76e7bf63edd (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.h | 17 |
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 | ||
28 | struct crypto_instance; | ||
29 | struct crypto_template; | ||
30 | |||
27 | extern struct list_head crypto_alg_list; | 31 | extern struct list_head crypto_alg_list; |
28 | extern struct rw_semaphore crypto_alg_sem; | 32 | extern struct rw_semaphore crypto_alg_sem; |
29 | 33 | ||
@@ -112,5 +116,18 @@ void crypto_exit_digest_ops(struct crypto_tfm *tfm); | |||
112 | void crypto_exit_cipher_ops(struct crypto_tfm *tfm); | 116 | void crypto_exit_cipher_ops(struct crypto_tfm *tfm); |
113 | void crypto_exit_compress_ops(struct crypto_tfm *tfm); | 117 | void crypto_exit_compress_ops(struct crypto_tfm *tfm); |
114 | 118 | ||
119 | int crypto_register_instance(struct crypto_template *tmpl, | ||
120 | struct crypto_instance *inst); | ||
121 | |||
122 | static inline int crypto_tmpl_get(struct crypto_template *tmpl) | ||
123 | { | ||
124 | return try_module_get(tmpl->module); | ||
125 | } | ||
126 | |||
127 | static 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 | ||