summaryrefslogtreecommitdiff
path: root/crypto/internal.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-08-06 15:16:34 +0400
committerHerbert Xu <herbert@gondor.apana.org.au>2006-09-21 05:17:12 +0400
commit4cc7720cd165273b08a72b4193146dffee58e34b (patch)
tree19c49af8a8195624ae101f665a05efc086c7f53b /crypto/internal.h
parentcce9e06d100df19a327b19f23adad76e7bf63edd (diff)
downloadlinux-4cc7720cd165273b08a72b4193146dffee58e34b.tar.xz
[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 @@
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/list.h>
+#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/rwsem.h>
#include <linux/slab.h>
#include <asm/kmap_types.h>
+struct crypto_instance;
+struct crypto_template;
+
extern struct list_head crypto_alg_list;
extern struct rw_semaphore crypto_alg_sem;
@@ -112,5 +116,18 @@ void crypto_exit_digest_ops(struct crypto_tfm *tfm);
void crypto_exit_cipher_ops(struct crypto_tfm *tfm);
void crypto_exit_compress_ops(struct crypto_tfm *tfm);
+int crypto_register_instance(struct crypto_template *tmpl,
+ struct crypto_instance *inst);
+
+static inline int crypto_tmpl_get(struct crypto_template *tmpl)
+{
+ return try_module_get(tmpl->module);
+}
+
+static inline void crypto_tmpl_put(struct crypto_template *tmpl)
+{
+ module_put(tmpl->module);
+}
+
#endif /* _CRYPTO_INTERNAL_H */