diff --git a/drivers/crypto/tegra/tegra-se-aes.c b/drivers/crypto/tegra/tegra-se-aes.c index 0e0ece65..40ca9d9b 100644 --- a/drivers/crypto/tegra/tegra-se-aes.c +++ b/drivers/crypto/tegra/tegra-se-aes.c @@ -25,7 +25,7 @@ #include "tegra-se.h" struct tegra_aes_ctx { -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT struct crypto_engine_ctx enginectx; #endif struct tegra_se *se; @@ -50,7 +50,7 @@ struct tegra_aes_reqctx { }; struct tegra_aead_ctx { -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT struct crypto_engine_ctx enginectx; #endif struct tegra_se *se; @@ -81,7 +81,7 @@ struct tegra_aead_reqctx { }; struct tegra_cmac_ctx { -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT struct crypto_engine_ctx enginectx; #endif struct tegra_se *se; @@ -378,7 +378,7 @@ static int tegra_aes_cra_init(struct crypto_skcipher *tfm) const char *algname; int ret; -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT se_alg = container_of(alg, struct tegra_se_alg, alg.skcipher.base); #else se_alg = container_of(alg, struct tegra_se_alg, alg.skcipher); @@ -401,7 +401,7 @@ static int tegra_aes_cra_init(struct crypto_skcipher *tfm) ctx->alg = ret; -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT ctx->enginectx.op.prepare_request = NULL; ctx->enginectx.op.unprepare_request = NULL; ctx->enginectx.op.do_one_request = tegra_aes_do_one_req; @@ -691,7 +691,7 @@ static int tegra_aes_decrypt(struct skcipher_request *req) static struct tegra_se_alg tegra_aes_algs[] = { { .alg.skcipher = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_aes_cra_init, @@ -712,14 +712,14 @@ static struct tegra_se_alg tegra_aes_algs[] = { .cra_alignmask = 0xf, .cra_module = THIS_MODULE, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_aes_do_one_req, #endif } }, { .alg.skcipher = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_aes_cra_init, @@ -739,14 +739,14 @@ static struct tegra_se_alg tegra_aes_algs[] = { .cra_alignmask = 0xf, .cra_module = THIS_MODULE, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_aes_do_one_req, #endif } }, { .alg.skcipher = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_aes_cra_init, @@ -767,14 +767,14 @@ static struct tegra_se_alg tegra_aes_algs[] = { .cra_alignmask = 0xf, .cra_module = THIS_MODULE, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_aes_do_one_req, #endif } }, { .alg.skcipher = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_aes_cra_init, @@ -794,7 +794,7 @@ static struct tegra_se_alg tegra_aes_algs[] = { .cra_alignmask = (__alignof__(u64) - 1), .cra_module = THIS_MODULE, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_aes_do_one_req, #endif @@ -1628,7 +1628,7 @@ static int tegra_ccm_cra_init(struct crypto_aead *tfm) algname = crypto_tfm_alg_name(&tfm->base); -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT se_alg = container_of(alg, struct tegra_se_alg, alg.aead.base); #else se_alg = container_of(alg, struct tegra_se_alg, alg.aead); @@ -1648,7 +1648,7 @@ static int tegra_ccm_cra_init(struct crypto_aead *tfm) ctx->alg = ret; -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT ctx->enginectx.op.prepare_request = NULL; ctx->enginectx.op.unprepare_request = NULL; ctx->enginectx.op.do_one_request = tegra_ccm_do_one_req; @@ -1663,7 +1663,7 @@ static int tegra_gcm_cra_init(struct crypto_aead *tfm) struct aead_alg *alg = crypto_aead_alg(tfm); struct tegra_se_alg *se_alg; -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT se_alg = container_of(alg, struct tegra_se_alg, alg.aead.base); #else se_alg = container_of(alg, struct tegra_se_alg, alg.aead); @@ -1680,7 +1680,7 @@ static int tegra_gcm_cra_init(struct crypto_aead *tfm) ctx->verify_alg = SE_ALG_GCM_VERIFY; ctx->mac_alg = SE_ALG_GMAC; -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT ctx->enginectx.op.prepare_request = NULL; ctx->enginectx.op.unprepare_request = NULL; ctx->enginectx.op.do_one_request = tegra_gcm_do_one_req; @@ -2112,7 +2112,7 @@ static int tegra_cmac_cra_init(struct crypto_tfm *tfm) const char *algname; algname = crypto_tfm_alg_name(tfm); -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT se_alg = container_of(alg, struct tegra_se_alg, alg.ahash.base); #else se_alg = container_of(alg, struct tegra_se_alg, alg.ahash); @@ -2126,7 +2126,7 @@ static int tegra_cmac_cra_init(struct crypto_tfm *tfm) ctx->final_alg = SE_ALG_CMAC_FINAL; -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT ctx->enginectx.op.prepare_request = NULL; ctx->enginectx.op.unprepare_request = NULL; ctx->enginectx.op.do_one_request = tegra_cmac_do_one_req; @@ -2246,7 +2246,7 @@ static int tegra_cmac_import(struct ahash_request *req, const void *in) static struct tegra_se_alg tegra_aead_algs[] = { { .alg.aead = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_gcm_cra_init, @@ -2266,14 +2266,14 @@ static struct tegra_se_alg tegra_aead_algs[] = { .cra_alignmask = 0xf, .cra_module = THIS_MODULE, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_gcm_do_one_req, #endif } }, { .alg.aead = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_ccm_cra_init, @@ -2294,7 +2294,7 @@ static struct tegra_se_alg tegra_aead_algs[] = { .cra_alignmask = 0xf, .cra_module = THIS_MODULE, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_ccm_do_one_req, #endif @@ -2305,7 +2305,7 @@ static struct tegra_se_alg tegra_aead_algs[] = { static struct tegra_se_alg tegra_cmac_algs[] = { { .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_cmac_init, @@ -2330,7 +2330,7 @@ static struct tegra_se_alg tegra_cmac_algs[] = { .cra_init = tegra_cmac_cra_init, .cra_exit = tegra_cmac_cra_exit, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_cmac_do_one_req, #endif @@ -2338,7 +2338,7 @@ static struct tegra_se_alg tegra_cmac_algs[] = { } }; -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT int tegra_init_aes(struct tegra_se *se) { struct aead_engine_alg *aead_alg; diff --git a/drivers/crypto/tegra/tegra-se-hash.c b/drivers/crypto/tegra/tegra-se-hash.c index 6cbfe5b9..a8f35c4f 100644 --- a/drivers/crypto/tegra/tegra-se-hash.c +++ b/drivers/crypto/tegra/tegra-se-hash.c @@ -24,7 +24,7 @@ #include "tegra-se.h" struct tegra_sha_ctx { -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT struct crypto_engine_ctx enginectx; #endif struct tegra_se *se; @@ -597,7 +597,7 @@ static int tegra_sha_cra_init(struct crypto_tfm *tfm) int ret; algname = crypto_tfm_alg_name(tfm); -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT se_alg = container_of(alg, struct tegra_se_alg, alg.ahash.base); #else se_alg = container_of(alg, struct tegra_se_alg, alg.ahash); @@ -620,7 +620,7 @@ static int tegra_sha_cra_init(struct crypto_tfm *tfm) ctx->alg = ret; -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT ctx->enginectx.op.prepare_request = NULL; ctx->enginectx.op.unprepare_request = NULL; ctx->enginectx.op.do_one_request = tegra_sha_do_one_req; @@ -767,7 +767,7 @@ static int tegra_sha_import(struct ahash_request *req, const void *in) static struct tegra_se_alg tegra_hash_algs[] = { { .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -791,14 +791,14 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif } }, { .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -822,14 +822,14 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif } }, { .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -853,14 +853,14 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif } }, { .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -884,14 +884,14 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif } }, { .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -915,14 +915,14 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif } }, { .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -946,14 +946,14 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif } }, { .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -977,14 +977,14 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif } }, { .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -1008,14 +1008,14 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif } }, { .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -1039,7 +1039,7 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif @@ -1047,7 +1047,7 @@ static struct tegra_se_alg tegra_hash_algs[] = { }, { .alg_base = "sha224", .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -1072,7 +1072,7 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif @@ -1080,7 +1080,7 @@ static struct tegra_se_alg tegra_hash_algs[] = { }, { .alg_base = "sha256", .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -1105,7 +1105,7 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif @@ -1113,7 +1113,7 @@ static struct tegra_se_alg tegra_hash_algs[] = { }, { .alg_base = "sha384", .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -1138,7 +1138,7 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif @@ -1146,7 +1146,7 @@ static struct tegra_se_alg tegra_hash_algs[] = { }, { .alg_base = "sha512", .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -1171,7 +1171,7 @@ static struct tegra_se_alg tegra_hash_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif @@ -1182,7 +1182,7 @@ static struct tegra_se_alg tegra_hash_algs[] = { static struct tegra_se_alg tegra_sm3_algs[] = { { .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sha_init, @@ -1207,7 +1207,7 @@ static struct tegra_se_alg tegra_sm3_algs[] = { .cra_init = tegra_sha_cra_init, .cra_exit = tegra_sha_cra_exit, } -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sha_do_one_req, #endif @@ -1301,7 +1301,7 @@ static void tegra_hash_set_regcfg(struct tegra_se *se) int tegra_init_hash(struct tegra_se *se) { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT struct ahash_engine_alg *alg; #else struct ahash_alg *alg; @@ -1316,7 +1316,7 @@ int tegra_init_hash(struct tegra_se *se) ret = CRYPTO_REGISTER(ahash, alg); if (ret) { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT dev_err(se->dev, "failed to register %s\n", alg->base.halg.base.cra_name); #else @@ -1335,7 +1335,7 @@ int tegra_init_hash(struct tegra_se *se) alg = &tegra_sm3_algs[i].alg.ahash; ret = CRYPTO_REGISTER(ahash, alg); if (ret) { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT dev_err(se->dev, "failed to register %s\n", alg->base.halg.base.cra_name); #else diff --git a/drivers/crypto/tegra/tegra-se-sm4.c b/drivers/crypto/tegra/tegra-se-sm4.c index 98027196..b20e1c8a 100644 --- a/drivers/crypto/tegra/tegra-se-sm4.c +++ b/drivers/crypto/tegra/tegra-se-sm4.c @@ -25,7 +25,7 @@ #include "tegra-se.h" struct tegra_sm4_ctx { -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT struct crypto_engine_ctx enginectx; #endif struct tegra_se *se; @@ -49,7 +49,7 @@ struct tegra_sm4_reqctx { }; struct tegra_sm4_gcm_ctx { -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT struct crypto_engine_ctx enginectx; #endif struct tegra_se *se; @@ -80,7 +80,7 @@ struct tegra_sm4_gcm_reqctx { }; struct tegra_sm4_cmac_ctx { -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT struct crypto_engine_ctx enginectx; #endif struct tegra_se *se; @@ -293,7 +293,7 @@ static int tegra_sm4_cra_init(struct crypto_skcipher *tfm) const char *algname; int ret; -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT se_alg = container_of(alg, struct tegra_se_alg, alg.skcipher.base); #else se_alg = container_of(alg, struct tegra_se_alg, alg.skcipher); @@ -316,7 +316,7 @@ static int tegra_sm4_cra_init(struct crypto_skcipher *tfm) ctx->alg = ret; -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT ctx->enginectx.op.do_one_request = tegra_sm4_do_one_req; #endif @@ -548,7 +548,7 @@ static int tegra_sm4_decrypt(struct skcipher_request *req) static struct tegra_se_alg tegra_sm4_algs[] = { { .alg.skcipher = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sm4_cra_init, @@ -570,14 +570,14 @@ static struct tegra_se_alg tegra_sm4_algs[] = { .cra_alignmask = 0, .cra_module = THIS_MODULE, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sm4_do_one_req, #endif } }, { .alg.skcipher = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sm4_cra_init, @@ -599,14 +599,14 @@ static struct tegra_se_alg tegra_sm4_algs[] = { .cra_alignmask = 0, .cra_module = THIS_MODULE, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sm4_do_one_req, #endif } }, { .alg.skcipher = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sm4_cra_init, @@ -628,14 +628,14 @@ static struct tegra_se_alg tegra_sm4_algs[] = { .cra_alignmask = 0, .cra_module = THIS_MODULE, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sm4_do_one_req, #endif } }, { .alg.skcipher = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sm4_cra_init, @@ -657,14 +657,14 @@ static struct tegra_se_alg tegra_sm4_algs[] = { .cra_alignmask = 0, .cra_module = THIS_MODULE, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sm4_do_one_req, #endif } }, { .alg.skcipher = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sm4_cra_init, @@ -686,7 +686,7 @@ static struct tegra_se_alg tegra_sm4_algs[] = { .cra_alignmask = 0, .cra_module = THIS_MODULE, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sm4_do_one_req, #endif @@ -1067,7 +1067,7 @@ static int tegra_sm4_gcm_cra_init(struct crypto_aead *tfm) struct aead_alg *alg = crypto_aead_alg(tfm); struct tegra_se_alg *se_alg; -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT se_alg = container_of(alg, struct tegra_se_alg, alg.aead.base); #else se_alg = container_of(alg, struct tegra_se_alg, alg.aead); @@ -1083,7 +1083,7 @@ static int tegra_sm4_gcm_cra_init(struct crypto_aead *tfm) ctx->verify_alg = SE_ALG_SM4_GCM_VERIFY; ctx->mac_alg = SE_ALG_SM4_GMAC; -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT ctx->enginectx.op.do_one_request = tegra_sm4_gcm_do_one_req; #endif @@ -1457,7 +1457,7 @@ static int tegra_sm4_cmac_cra_init(struct crypto_tfm *tfm) algname = crypto_tfm_alg_name(tfm); -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT se_alg = container_of(alg, struct tegra_se_alg, alg.ahash.base); #else se_alg = container_of(alg, struct tegra_se_alg, alg.ahash); @@ -1471,7 +1471,7 @@ static int tegra_sm4_cmac_cra_init(struct crypto_tfm *tfm) ctx->alg = SE_ALG_SM4_CMAC; ctx->final_alg = SE_ALG_SM4_CMAC_FINAL; -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifndef NV_CRYPTO_ENGINE_OPS_PRESENT ctx->enginectx.op.do_one_request = tegra_sm4_cmac_do_one_req; #endif @@ -1581,7 +1581,7 @@ static int tegra_sm4_cmac_import(struct ahash_request *req, const void *in) static struct tegra_se_alg tegra_sm4_gcm_algs[] = { { .alg.aead = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif @@ -1602,7 +1602,7 @@ static struct tegra_se_alg tegra_sm4_gcm_algs[] = { .cra_alignmask = 0, .cra_module = THIS_MODULE, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sm4_gcm_do_one_req, #endif @@ -1613,7 +1613,7 @@ static struct tegra_se_alg tegra_sm4_gcm_algs[] = { static struct tegra_se_alg tegra_sm4_cmac_algs[] = { { .alg.ahash = { -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT .base = { #endif .init = tegra_sm4_cmac_init, @@ -1639,7 +1639,7 @@ static struct tegra_se_alg tegra_sm4_cmac_algs[] = { .cra_init = tegra_sm4_cmac_cra_init, .cra_exit = tegra_sm4_cmac_cra_exit, }, -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT }, .op.do_one_request = tegra_sm4_cmac_do_one_req, #endif @@ -1653,7 +1653,7 @@ struct tegra_se_regcfg tegra264_sm4_regcfg = { .manifest = tegra_sm4_kac2_manifest }; -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT int tegra_init_sm4(struct tegra_se *se) { struct aead_engine_alg *aead_alg; diff --git a/drivers/crypto/tegra/tegra-se.h b/drivers/crypto/tegra/tegra-se.h index 69a83b6a..db1c2966 100644 --- a/drivers/crypto/tegra/tegra-se.h +++ b/drivers/crypto/tegra/tegra-se.h @@ -540,18 +540,18 @@ #define TEGRA_AES_RESERVED_KSLT 14 #define TEGRA_XTS_RESERVED_KSLT 15 -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX -#define CRYPTO_REGISTER(alg, x) \ - crypto_engine_register_##alg(x) -#else -#define CRYPTO_REGISTER(alg, x) \ - crypto_register_##alg(x) +#if NV_IS_EXPORT_SYMBOL_PRESENT_crypto_engine_register_aead /* Linux v6.6 */ +#define NV_CRYPTO_ENGINE_OPS_PRESENT #endif -#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT +#define CRYPTO_REGISTER(alg, x) \ + crypto_engine_register_##alg(x) #define CRYPTO_UNREGISTER(alg, x) \ crypto_engine_unregister_##alg(x) #else +#define CRYPTO_REGISTER(alg, x) \ + crypto_register_##alg(x) #define CRYPTO_UNREGISTER(alg, x) \ crypto_unregister_##alg(x) #endif @@ -609,14 +609,14 @@ struct tegra_se_alg { const char *alg_base; union { -#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX - struct skcipher_alg skcipher; - struct aead_alg aead; - struct ahash_alg ahash; -#else +#ifdef NV_CRYPTO_ENGINE_OPS_PRESENT struct skcipher_engine_alg skcipher; struct aead_engine_alg aead; struct ahash_engine_alg ahash; +#else + struct skcipher_alg skcipher; + struct aead_alg aead; + struct ahash_alg ahash; #endif } alg; }; diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 1dcc6c25..83cd241c 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -264,10 +264,9 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += of_property_read_reg NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_fd_to_handle NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_handle_to_fd NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_queue_limits_set -NV_CONFTEST_FUNCTION_COMPILE_TESTS += crypto_engine_ctx_struct_removed_test NV_CONFTEST_MACRO_COMPILE_TESTS ?= NV_CONFTEST_MACRO_COMPILE_TESTS += tegra264_bwmgr_debug_macro -NV_CONFTEST_SYMBOL_COMPILE_TESTS ?= +NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_crypto_engine_register_aead $(eval $(call NV_GENERATE_COMPILE_TEST_HEADER,functions,$(NV_CONFTEST_FUNCTION_COMPILE_TESTS))) $(eval $(call NV_GENERATE_COMPILE_TEST_HEADER,generic,$(NV_CONFTEST_GENERIC_COMPILE_TESTS))) diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 008495bd..fbe14b47 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -9335,23 +9335,6 @@ compile_test() { compile_check_conftest "$CODE" "NV_WORK_ON_CPU_KEY_PRESENT" "" "functions" ;; - crypto_engine_ctx_struct_removed_test) - # - # Determine if struct 'crypto_engine_ctx' is removed in linux kernel. - # - # Commit 5ce0bc68e0ee ("crypto: engine - Remove crypto_engine_ctx") - # Linux v6.6 removed struct crypto_engine_ctx - # - CODE=" - #include - void conftest_crypto_engine_ctx_struct_removed_test(void) { - struct crypto_engine_ctx *ptr = NULL; - struct crypto_engine_ctx enginectx; - ptr = &enginectx; - }" - - compile_check_conftest "$CODE" "NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX" "" "functions" - ;; of_property_read_reg) # # Determine if the function of_property_read_reg is present or not.