aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/atmel-aes.c
diff options
context:
space:
mode:
authorCyrille Pitchen <cyrille.pitchen@atmel.com>2015-12-17 11:48:34 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2015-12-23 05:19:48 -0500
commit88efd9a999e032d68bccfb80c4b7446a217686de (patch)
tree869b0d5b5f9e00777ac968dfeaeab6654e571426 /drivers/crypto/atmel-aes.c
parentc0b28d8c32a42c6a54b5ddee06ce078d99f93e51 (diff)
crypto: atmel-aes - change algorithm priorities
Increase the algorithm priorities so the hardware acceleration is now preferred to the software computation: the "aes-generice" driver uses 100 as priority. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/atmel-aes.c')
-rw-r--r--drivers/crypto/atmel-aes.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index 1d3997a45610..e545636a7ddc 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -43,6 +43,8 @@
43#include <dt-bindings/dma/at91.h> 43#include <dt-bindings/dma/at91.h>
44#include "atmel-aes-regs.h" 44#include "atmel-aes-regs.h"
45 45
46#define ATMEL_AES_PRIORITY 300
47
46#define CFB8_BLOCK_SIZE 1 48#define CFB8_BLOCK_SIZE 1
47#define CFB16_BLOCK_SIZE 2 49#define CFB16_BLOCK_SIZE 2
48#define CFB32_BLOCK_SIZE 4 50#define CFB32_BLOCK_SIZE 4
@@ -960,7 +962,7 @@ static struct crypto_alg aes_algs[] = {
960{ 962{
961 .cra_name = "ecb(aes)", 963 .cra_name = "ecb(aes)",
962 .cra_driver_name = "atmel-ecb-aes", 964 .cra_driver_name = "atmel-ecb-aes",
963 .cra_priority = 100, 965 .cra_priority = ATMEL_AES_PRIORITY,
964 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, 966 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
965 .cra_blocksize = AES_BLOCK_SIZE, 967 .cra_blocksize = AES_BLOCK_SIZE,
966 .cra_ctxsize = sizeof(struct atmel_aes_ctx), 968 .cra_ctxsize = sizeof(struct atmel_aes_ctx),
@@ -980,7 +982,7 @@ static struct crypto_alg aes_algs[] = {
980{ 982{
981 .cra_name = "cbc(aes)", 983 .cra_name = "cbc(aes)",
982 .cra_driver_name = "atmel-cbc-aes", 984 .cra_driver_name = "atmel-cbc-aes",
983 .cra_priority = 100, 985 .cra_priority = ATMEL_AES_PRIORITY,
984 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, 986 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
985 .cra_blocksize = AES_BLOCK_SIZE, 987 .cra_blocksize = AES_BLOCK_SIZE,
986 .cra_ctxsize = sizeof(struct atmel_aes_ctx), 988 .cra_ctxsize = sizeof(struct atmel_aes_ctx),
@@ -1001,7 +1003,7 @@ static struct crypto_alg aes_algs[] = {
1001{ 1003{
1002 .cra_name = "ofb(aes)", 1004 .cra_name = "ofb(aes)",
1003 .cra_driver_name = "atmel-ofb-aes", 1005 .cra_driver_name = "atmel-ofb-aes",
1004 .cra_priority = 100, 1006 .cra_priority = ATMEL_AES_PRIORITY,
1005 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, 1007 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
1006 .cra_blocksize = AES_BLOCK_SIZE, 1008 .cra_blocksize = AES_BLOCK_SIZE,
1007 .cra_ctxsize = sizeof(struct atmel_aes_ctx), 1009 .cra_ctxsize = sizeof(struct atmel_aes_ctx),
@@ -1022,7 +1024,7 @@ static struct crypto_alg aes_algs[] = {
1022{ 1024{
1023 .cra_name = "cfb(aes)", 1025 .cra_name = "cfb(aes)",
1024 .cra_driver_name = "atmel-cfb-aes", 1026 .cra_driver_name = "atmel-cfb-aes",
1025 .cra_priority = 100, 1027 .cra_priority = ATMEL_AES_PRIORITY,
1026 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, 1028 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
1027 .cra_blocksize = AES_BLOCK_SIZE, 1029 .cra_blocksize = AES_BLOCK_SIZE,
1028 .cra_ctxsize = sizeof(struct atmel_aes_ctx), 1030 .cra_ctxsize = sizeof(struct atmel_aes_ctx),
@@ -1043,7 +1045,7 @@ static struct crypto_alg aes_algs[] = {
1043{ 1045{
1044 .cra_name = "cfb32(aes)", 1046 .cra_name = "cfb32(aes)",
1045 .cra_driver_name = "atmel-cfb32-aes", 1047 .cra_driver_name = "atmel-cfb32-aes",
1046 .cra_priority = 100, 1048 .cra_priority = ATMEL_AES_PRIORITY,
1047 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, 1049 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
1048 .cra_blocksize = CFB32_BLOCK_SIZE, 1050 .cra_blocksize = CFB32_BLOCK_SIZE,
1049 .cra_ctxsize = sizeof(struct atmel_aes_ctx), 1051 .cra_ctxsize = sizeof(struct atmel_aes_ctx),
@@ -1064,7 +1066,7 @@ static struct crypto_alg aes_algs[] = {
1064{ 1066{
1065 .cra_name = "cfb16(aes)", 1067 .cra_name = "cfb16(aes)",
1066 .cra_driver_name = "atmel-cfb16-aes", 1068 .cra_driver_name = "atmel-cfb16-aes",
1067 .cra_priority = 100, 1069 .cra_priority = ATMEL_AES_PRIORITY,
1068 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, 1070 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
1069 .cra_blocksize = CFB16_BLOCK_SIZE, 1071 .cra_blocksize = CFB16_BLOCK_SIZE,
1070 .cra_ctxsize = sizeof(struct atmel_aes_ctx), 1072 .cra_ctxsize = sizeof(struct atmel_aes_ctx),
@@ -1085,7 +1087,7 @@ static struct crypto_alg aes_algs[] = {
1085{ 1087{
1086 .cra_name = "cfb8(aes)", 1088 .cra_name = "cfb8(aes)",
1087 .cra_driver_name = "atmel-cfb8-aes", 1089 .cra_driver_name = "atmel-cfb8-aes",
1088 .cra_priority = 100, 1090 .cra_priority = ATMEL_AES_PRIORITY,
1089 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, 1091 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
1090 .cra_blocksize = CFB8_BLOCK_SIZE, 1092 .cra_blocksize = CFB8_BLOCK_SIZE,
1091 .cra_ctxsize = sizeof(struct atmel_aes_ctx), 1093 .cra_ctxsize = sizeof(struct atmel_aes_ctx),
@@ -1106,7 +1108,7 @@ static struct crypto_alg aes_algs[] = {
1106{ 1108{
1107 .cra_name = "ctr(aes)", 1109 .cra_name = "ctr(aes)",
1108 .cra_driver_name = "atmel-ctr-aes", 1110 .cra_driver_name = "atmel-ctr-aes",
1109 .cra_priority = 100, 1111 .cra_priority = ATMEL_AES_PRIORITY,
1110 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, 1112 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
1111 .cra_blocksize = AES_BLOCK_SIZE, 1113 .cra_blocksize = AES_BLOCK_SIZE,
1112 .cra_ctxsize = sizeof(struct atmel_aes_ctx), 1114 .cra_ctxsize = sizeof(struct atmel_aes_ctx),
@@ -1129,7 +1131,7 @@ static struct crypto_alg aes_algs[] = {
1129static struct crypto_alg aes_cfb64_alg = { 1131static struct crypto_alg aes_cfb64_alg = {
1130 .cra_name = "cfb64(aes)", 1132 .cra_name = "cfb64(aes)",
1131 .cra_driver_name = "atmel-cfb64-aes", 1133 .cra_driver_name = "atmel-cfb64-aes",
1132 .cra_priority = 100, 1134 .cra_priority = ATMEL_AES_PRIORITY,
1133 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, 1135 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
1134 .cra_blocksize = CFB64_BLOCK_SIZE, 1136 .cra_blocksize = CFB64_BLOCK_SIZE,
1135 .cra_ctxsize = sizeof(struct atmel_aes_ctx), 1137 .cra_ctxsize = sizeof(struct atmel_aes_ctx),