From: David Cohen <david.cohen@xxxxxxxxxxx> This patch adds support for private data on crypto_alg struct. It is needed to avoid the use of global variables to save the driver's private data. This private data stores information in the probe function, when the ctx struct is not vailable yet. Signed-off-by: David Cohen <david.cohen@xxxxxxxxxxx> --- include/linux/crypto.h | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/include/linux/crypto.h b/include/linux/crypto.h index f3110eb..61a385c 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -262,6 +262,7 @@ struct crypto_alg { unsigned int cra_blocksize; unsigned int cra_ctxsize; unsigned int cra_alignmask; + void *cra_data; int cra_priority; atomic_t cra_refcnt; @@ -294,6 +295,11 @@ struct crypto_alg { int crypto_register_alg(struct crypto_alg *alg); int crypto_unregister_alg(struct crypto_alg *alg); +static inline void crypto_set_alg_data(struct crypto_alg *alg, void *data) +{ + alg->cra_data = data; +} + /* * Algorithm query interface. */ @@ -510,6 +516,11 @@ static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) return tfm->__crt_ctx; } +static inline void *crypto_tfm_data(struct crypto_tfm *tfm) +{ + return tfm->__crt_alg->cra_data; +} + static inline unsigned int crypto_tfm_ctx_alignment(void) { struct crypto_tfm *tfm; -- 1.5.3.5 - To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html