Commit bebe54b8 authored by Zixun LI's avatar Zixun LI Committed by Herbert Xu
Browse files

crypto: atmel - add CRYPTO_ALG_KERN_DRIVER_ONLY flag



This patch introduces the CRYPTO_ALG_KERN_DRIVER_ONLY flag to the
atmel-aes, atmel-sha, and atmel-tdes drivers. This flag is set for
hardware accelerated ciphers accessible through a kernel driver only,
which is the case of these drivers.

Signed-off-by: default avatarZixun LI <admin@hifiphile.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent fcfbdddc
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1743,7 +1743,8 @@ static struct skcipher_alg aes_xts_alg = {
	.base.cra_driver_name	= "atmel-xts-aes",
	.base.cra_blocksize	= AES_BLOCK_SIZE,
	.base.cra_ctxsize	= sizeof(struct atmel_aes_xts_ctx),
	.base.cra_flags		= CRYPTO_ALG_NEED_FALLBACK,
	.base.cra_flags		= CRYPTO_ALG_NEED_FALLBACK |
				  CRYPTO_ALG_KERN_DRIVER_ONLY,

	.min_keysize		= 2 * AES_MIN_KEY_SIZE,
	.max_keysize		= 2 * AES_MAX_KEY_SIZE,
@@ -2220,7 +2221,7 @@ static void atmel_aes_unregister_algs(struct atmel_aes_dev *dd)

static void atmel_aes_crypto_alg_init(struct crypto_alg *alg)
{
	alg->cra_flags |= CRYPTO_ALG_ASYNC;
	alg->cra_flags |= CRYPTO_ALG_ASYNC | CRYPTO_ALG_KERN_DRIVER_ONLY;
	alg->cra_alignmask = 0xf;
	alg->cra_priority = ATMEL_AES_PRIORITY;
	alg->cra_module = THIS_MODULE;
+4 −2
Original line number Diff line number Diff line
@@ -1254,7 +1254,8 @@ static int atmel_sha_cra_init(struct crypto_tfm *tfm)
static void atmel_sha_alg_init(struct ahash_alg *alg)
{
	alg->halg.base.cra_priority = ATMEL_SHA_PRIORITY;
	alg->halg.base.cra_flags = CRYPTO_ALG_ASYNC;
	alg->halg.base.cra_flags = CRYPTO_ALG_ASYNC |
				   CRYPTO_ALG_KERN_DRIVER_ONLY;
	alg->halg.base.cra_ctxsize = sizeof(struct atmel_sha_ctx);
	alg->halg.base.cra_module = THIS_MODULE;
	alg->halg.base.cra_init = atmel_sha_cra_init;
@@ -2041,7 +2042,8 @@ static void atmel_sha_hmac_cra_exit(struct crypto_tfm *tfm)
static void atmel_sha_hmac_alg_init(struct ahash_alg *alg)
{
	alg->halg.base.cra_priority = ATMEL_SHA_PRIORITY;
	alg->halg.base.cra_flags = CRYPTO_ALG_ASYNC;
	alg->halg.base.cra_flags = CRYPTO_ALG_ASYNC |
				   CRYPTO_ALG_KERN_DRIVER_ONLY;
	alg->halg.base.cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx);
	alg->halg.base.cra_module = THIS_MODULE;
	alg->halg.base.cra_init	= atmel_sha_hmac_cra_init;
+1 −1
Original line number Diff line number Diff line
@@ -785,7 +785,7 @@ static int atmel_tdes_init_tfm(struct crypto_skcipher *tfm)
static void atmel_tdes_skcipher_alg_init(struct skcipher_alg *alg)
{
	alg->base.cra_priority = ATMEL_TDES_PRIORITY;
	alg->base.cra_flags = CRYPTO_ALG_ASYNC;
	alg->base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_KERN_DRIVER_ONLY;
	alg->base.cra_ctxsize = sizeof(struct atmel_tdes_ctx);
	alg->base.cra_module = THIS_MODULE;