#include <crypto/internal/skcipher.h>
#include "crypto4xx_reg_def.h"
#include "crypto4xx_core.h"
-@@ -518,7 +520,7 @@ static void crypto4xx_ret_sg_desc(struct
+@@ -514,7 +516,7 @@ static void crypto4xx_ret_sg_desc(struct
}
}
struct pd_uinfo *pd_uinfo,
struct ce_pd *pd)
{
-@@ -552,11 +554,9 @@ static u32 crypto4xx_ablkcipher_done(str
+@@ -548,11 +550,9 @@ static u32 crypto4xx_ablkcipher_done(str
if (pd_uinfo->state & PD_ENTRY_BUSY)
ablkcipher_request_complete(ablk_req, -EINPROGRESS);
ablkcipher_request_complete(ablk_req, 0);
struct pd_uinfo *pd_uinfo)
{
struct crypto4xx_ctx *ctx;
-@@ -572,20 +572,88 @@ static u32 crypto4xx_ahash_done(struct c
+@@ -568,20 +568,88 @@ static u32 crypto4xx_ahash_done(struct c
if (pd_uinfo->state & PD_ENTRY_BUSY)
ahash_request_complete(ahash_req, -EINPROGRESS);
ahash_request_complete(ahash_req, 0);
}
static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev)
-@@ -621,8 +689,10 @@ int crypto4xx_build_pd(struct crypto_asy
+@@ -617,8 +685,10 @@ int crypto4xx_build_pd(struct crypto_asy
const unsigned int datalen,
const __le32 *iv, const u32 iv_len,
const struct dynamic_sa_ctl *req_sa,
struct crypto4xx_device *dev = ctx->dev;
struct dynamic_sa_ctl *sa;
struct ce_gd *gd;
-@@ -636,18 +706,25 @@ int crypto4xx_build_pd(struct crypto_asy
+@@ -632,18 +702,25 @@ int crypto4xx_build_pd(struct crypto_asy
unsigned int nbytes = datalen;
size_t offset_to_sr_ptr;
u32 gd_idx = 0;
if (sg_is_last(dst)) {
num_sd = 0;
} else {
-@@ -733,6 +810,7 @@ int crypto4xx_build_pd(struct crypto_asy
+@@ -729,6 +806,7 @@ int crypto4xx_build_pd(struct crypto_asy
sa = pd_uinfo->sa_va;
memcpy(sa, req_sa, sa_len * 4);
offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa);
*(u32 *)((unsigned long)sa + offset_to_sr_ptr) = pd_uinfo->sr_pa;
-@@ -839,7 +917,7 @@ int crypto4xx_build_pd(struct crypto_asy
+@@ -835,7 +913,7 @@ int crypto4xx_build_pd(struct crypto_asy
((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) |
(crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ?
PD_CTL_HASH_FINAL : 0);
pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0);
wmb();
-@@ -852,40 +930,68 @@ int crypto4xx_build_pd(struct crypto_asy
+@@ -848,40 +926,68 @@ int crypto4xx_build_pd(struct crypto_asy
/**
* Algorithm Registration Functions
*/
{
struct crypto4xx_alg *alg;
int i;
-@@ -900,6 +1006,10 @@ int crypto4xx_register_alg(struct crypto
+@@ -896,6 +1002,10 @@ int crypto4xx_register_alg(struct crypto
alg->dev = sec_dev;
switch (alg->alg.type) {
case CRYPTO_ALG_TYPE_AHASH:
rc = crypto_register_ahash(&alg->alg.u.hash);
break;
-@@ -929,6 +1039,10 @@ static void crypto4xx_unregister_alg(str
+@@ -925,6 +1035,10 @@ static void crypto4xx_unregister_alg(str
crypto_unregister_ahash(&alg->alg.u.hash);
break;
default:
crypto_unregister_alg(&alg->alg.u.cipher);
}
-@@ -982,7 +1096,7 @@ static irqreturn_t crypto4xx_ce_interrup
+@@ -978,7 +1092,7 @@ static irqreturn_t crypto4xx_ce_interrup
/**
* Supported Crypto Algorithms
*/
/* Crypto AES modes */
{ .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = {
.cra_name = "cbc(aes)",
-@@ -994,8 +1108,8 @@ struct crypto4xx_alg_common crypto4xx_al
+@@ -990,8 +1104,8 @@ struct crypto4xx_alg_common crypto4xx_al
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto4xx_ctx),
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_u = {
.ablkcipher = {
-@@ -1018,8 +1132,8 @@ struct crypto4xx_alg_common crypto4xx_al
+@@ -1014,8 +1128,8 @@ struct crypto4xx_alg_common crypto4xx_al
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto4xx_ctx),
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_u = {
.ablkcipher = {
-@@ -1042,8 +1156,8 @@ struct crypto4xx_alg_common crypto4xx_al
+@@ -1038,8 +1152,8 @@ struct crypto4xx_alg_common crypto4xx_al
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto4xx_ctx),
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_u = {
.ablkcipher = {
-@@ -1068,8 +1182,8 @@ struct crypto4xx_alg_common crypto4xx_al
+@@ -1064,8 +1178,8 @@ struct crypto4xx_alg_common crypto4xx_al
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto4xx_ctx),
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_u = {
.ablkcipher = {
-@@ -1091,8 +1205,8 @@ struct crypto4xx_alg_common crypto4xx_al
+@@ -1087,8 +1201,8 @@ struct crypto4xx_alg_common crypto4xx_al
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto4xx_ctx),
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_u = {
.ablkcipher = {
-@@ -1158,6 +1272,7 @@ static int crypto4xx_probe(struct platfo
+@@ -1154,6 +1268,7 @@ static int crypto4xx_probe(struct platfo
core_dev->device = dev;
spin_lock_init(&core_dev->lock);
INIT_LIST_HEAD(&core_dev->dev->alg_list);