diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2018-08-30 17:00:14 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-09-04 05:37:04 +0200 |
commit | dd8b083f9a5ed06946d559e0ca1eda0577ef24a9 (patch) | |
tree | b51a09a36977e0b3c96a290c1bcb053963b6d5f5 /include/crypto/algapi.h | |
parent | crypto: arm64/crct10dif - implement non-Crypto Extensions alternative (diff) | |
download | linux-dd8b083f9a5ed06946d559e0ca1eda0577ef24a9.tar.xz linux-dd8b083f9a5ed06946d559e0ca1eda0577ef24a9.zip |
crypto: api - Introduce notifier for new crypto algorithms
Introduce a facility that can be used to receive a notification
callback when a new algorithm becomes available. This can be used by
existing crypto registrations to trigger a switch from a software-only
algorithm to a hardware-accelerated version.
A new CRYPTO_MSG_ALG_LOADED state is introduced to the existing crypto
notification chain, and the register/unregister functions are exported
so they can be called by subsystems outside of crypto.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Suggested-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/algapi.h')
-rw-r--r-- | include/crypto/algapi.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 21371ac8f355..4a5ad10e75f0 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h @@ -427,4 +427,14 @@ static inline void crypto_yield(u32 flags) #endif } +int crypto_register_notifier(struct notifier_block *nb); +int crypto_unregister_notifier(struct notifier_block *nb); + +/* Crypto notification events. */ +enum { + CRYPTO_MSG_ALG_REQUEST, + CRYPTO_MSG_ALG_REGISTER, + CRYPTO_MSG_ALG_LOADED, +}; + #endif /* _CRYPTO_ALGAPI_H */ |