Lines Matching refs:drv_ctx

62 	struct caam_drv_ctx *drv_ctx[NUM_OP];  member
263 if (ctx->drv_ctx[ENCRYPT]) { in aead_setkey()
264 ret = caam_drv_ctx_update(ctx->drv_ctx[ENCRYPT], in aead_setkey()
272 if (ctx->drv_ctx[DECRYPT]) { in aead_setkey()
273 ret = caam_drv_ctx_update(ctx->drv_ctx[DECRYPT], in aead_setkey()
363 if (ctx->drv_ctx[ENCRYPT]) { in gcm_setkey()
364 ret = caam_drv_ctx_update(ctx->drv_ctx[ENCRYPT], in gcm_setkey()
372 if (ctx->drv_ctx[DECRYPT]) { in gcm_setkey()
373 ret = caam_drv_ctx_update(ctx->drv_ctx[DECRYPT], in gcm_setkey()
467 if (ctx->drv_ctx[ENCRYPT]) { in rfc4106_setkey()
468 ret = caam_drv_ctx_update(ctx->drv_ctx[ENCRYPT], in rfc4106_setkey()
476 if (ctx->drv_ctx[DECRYPT]) { in rfc4106_setkey()
477 ret = caam_drv_ctx_update(ctx->drv_ctx[DECRYPT], in rfc4106_setkey()
571 if (ctx->drv_ctx[ENCRYPT]) { in rfc4543_setkey()
572 ret = caam_drv_ctx_update(ctx->drv_ctx[ENCRYPT], in rfc4543_setkey()
580 if (ctx->drv_ctx[DECRYPT]) { in rfc4543_setkey()
581 ret = caam_drv_ctx_update(ctx->drv_ctx[DECRYPT], in rfc4543_setkey()
641 if (ctx->drv_ctx[ENCRYPT]) { in ablkcipher_setkey()
642 ret = caam_drv_ctx_update(ctx->drv_ctx[ENCRYPT], in ablkcipher_setkey()
650 if (ctx->drv_ctx[DECRYPT]) { in ablkcipher_setkey()
651 ret = caam_drv_ctx_update(ctx->drv_ctx[DECRYPT], in ablkcipher_setkey()
659 if (ctx->drv_ctx[GIVENCRYPT]) { in ablkcipher_setkey()
660 ret = caam_drv_ctx_update(ctx->drv_ctx[GIVENCRYPT], in ablkcipher_setkey()
695 if (ctx->drv_ctx[ENCRYPT]) { in xts_ablkcipher_setkey()
696 ret = caam_drv_ctx_update(ctx->drv_ctx[ENCRYPT], in xts_ablkcipher_setkey()
704 if (ctx->drv_ctx[DECRYPT]) { in xts_ablkcipher_setkey()
705 ret = caam_drv_ctx_update(ctx->drv_ctx[DECRYPT], in xts_ablkcipher_setkey()
771 struct caam_drv_ctx *drv_ctx = ctx->drv_ctx[type]; in get_drv_ctx() local
774 if (unlikely(!drv_ctx)) { in get_drv_ctx()
778 drv_ctx = ctx->drv_ctx[type]; in get_drv_ctx()
779 if (!drv_ctx) { in get_drv_ctx()
790 drv_ctx = caam_drv_ctx_init(ctx->qidev, &cpu, desc); in get_drv_ctx()
791 if (likely(!IS_ERR_OR_NULL(drv_ctx))) in get_drv_ctx()
792 drv_ctx->op_type = type; in get_drv_ctx()
794 ctx->drv_ctx[type] = drv_ctx; in get_drv_ctx()
800 return drv_ctx; in get_drv_ctx()
833 edesc->iv_dma, ivsize, edesc->drv_req.drv_ctx->op_type, in aead_unmap()
846 edesc->iv_dma, ivsize, edesc->drv_req.drv_ctx->op_type, in ablkcipher_unmap()
904 struct caam_drv_ctx *drv_ctx; in aead_edesc_alloc() local
907 drv_ctx = get_drv_ctx(ctx, op_type); in aead_edesc_alloc()
908 if (unlikely(IS_ERR_OR_NULL(drv_ctx))) in aead_edesc_alloc()
909 return (struct aead_edesc *)drv_ctx; in aead_edesc_alloc()
1023 edesc->drv_req.drv_ctx = drv_ctx; in aead_edesc_alloc()
1171 if (edesc->drv_req.drv_ctx->op_type == GIVENCRYPT) { in ablkcipher_done()
1185 if (edesc->drv_req.drv_ctx->op_type != DECRYPT) in ablkcipher_done()
1208 struct caam_drv_ctx *drv_ctx; in ablkcipher_edesc_alloc() local
1211 drv_ctx = get_drv_ctx(ctx, op_type); in ablkcipher_edesc_alloc()
1212 if (unlikely(IS_ERR_OR_NULL(drv_ctx))) in ablkcipher_edesc_alloc()
1213 return (struct ablkcipher_edesc *)drv_ctx; in ablkcipher_edesc_alloc()
1296 edesc->drv_req.drv_ctx = drv_ctx; in ablkcipher_edesc_alloc()
1350 struct caam_drv_ctx *drv_ctx; in ablkcipher_giv_edesc_alloc() local
1352 drv_ctx = get_drv_ctx(ctx, GIVENCRYPT); in ablkcipher_giv_edesc_alloc()
1353 if (unlikely(IS_ERR_OR_NULL(drv_ctx))) in ablkcipher_giv_edesc_alloc()
1354 return (struct ablkcipher_edesc *)drv_ctx; in ablkcipher_giv_edesc_alloc()
1438 edesc->drv_req.drv_ctx = drv_ctx; in ablkcipher_giv_edesc_alloc()
2573 ctx->drv_ctx[ENCRYPT] = NULL; in caam_init_common()
2574 ctx->drv_ctx[DECRYPT] = NULL; in caam_init_common()
2575 ctx->drv_ctx[GIVENCRYPT] = NULL; in caam_init_common()
2603 caam_drv_ctx_rel(ctx->drv_ctx[ENCRYPT]); in caam_exit_common()
2604 caam_drv_ctx_rel(ctx->drv_ctx[DECRYPT]); in caam_exit_common()
2605 caam_drv_ctx_rel(ctx->drv_ctx[GIVENCRYPT]); in caam_exit_common()