Skip to content

Commit bebe54b

Browse files
HiFiPhileherbertx
authored andcommitted
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: Zixun LI <admin@hifiphile.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent fcfbddd commit bebe54b

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

drivers/crypto/atmel-aes.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,8 @@ static struct skcipher_alg aes_xts_alg = {
17431743
.base.cra_driver_name = "atmel-xts-aes",
17441744
.base.cra_blocksize = AES_BLOCK_SIZE,
17451745
.base.cra_ctxsize = sizeof(struct atmel_aes_xts_ctx),
1746-
.base.cra_flags = CRYPTO_ALG_NEED_FALLBACK,
1746+
.base.cra_flags = CRYPTO_ALG_NEED_FALLBACK |
1747+
CRYPTO_ALG_KERN_DRIVER_ONLY,
17471748

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

22212222
static void atmel_aes_crypto_alg_init(struct crypto_alg *alg)
22222223
{
2223-
alg->cra_flags |= CRYPTO_ALG_ASYNC;
2224+
alg->cra_flags |= CRYPTO_ALG_ASYNC | CRYPTO_ALG_KERN_DRIVER_ONLY;
22242225
alg->cra_alignmask = 0xf;
22252226
alg->cra_priority = ATMEL_AES_PRIORITY;
22262227
alg->cra_module = THIS_MODULE;

drivers/crypto/atmel-sha.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,8 @@ static int atmel_sha_cra_init(struct crypto_tfm *tfm)
12541254
static void atmel_sha_alg_init(struct ahash_alg *alg)
12551255
{
12561256
alg->halg.base.cra_priority = ATMEL_SHA_PRIORITY;
1257-
alg->halg.base.cra_flags = CRYPTO_ALG_ASYNC;
1257+
alg->halg.base.cra_flags = CRYPTO_ALG_ASYNC |
1258+
CRYPTO_ALG_KERN_DRIVER_ONLY;
12581259
alg->halg.base.cra_ctxsize = sizeof(struct atmel_sha_ctx);
12591260
alg->halg.base.cra_module = THIS_MODULE;
12601261
alg->halg.base.cra_init = atmel_sha_cra_init;
@@ -2041,7 +2042,8 @@ static void atmel_sha_hmac_cra_exit(struct crypto_tfm *tfm)
20412042
static void atmel_sha_hmac_alg_init(struct ahash_alg *alg)
20422043
{
20432044
alg->halg.base.cra_priority = ATMEL_SHA_PRIORITY;
2044-
alg->halg.base.cra_flags = CRYPTO_ALG_ASYNC;
2045+
alg->halg.base.cra_flags = CRYPTO_ALG_ASYNC |
2046+
CRYPTO_ALG_KERN_DRIVER_ONLY;
20452047
alg->halg.base.cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx);
20462048
alg->halg.base.cra_module = THIS_MODULE;
20472049
alg->halg.base.cra_init = atmel_sha_hmac_cra_init;

drivers/crypto/atmel-tdes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ static int atmel_tdes_init_tfm(struct crypto_skcipher *tfm)
785785
static void atmel_tdes_skcipher_alg_init(struct skcipher_alg *alg)
786786
{
787787
alg->base.cra_priority = ATMEL_TDES_PRIORITY;
788-
alg->base.cra_flags = CRYPTO_ALG_ASYNC;
788+
alg->base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_KERN_DRIVER_ONLY;
789789
alg->base.cra_ctxsize = sizeof(struct atmel_tdes_ctx);
790790
alg->base.cra_module = THIS_MODULE;
791791

0 commit comments

Comments
 (0)