Lines Matching refs:jrdev

112 	struct device *jrdev;  member
121 struct device *jrdev = ctx->jrdev; in aead_null_set_sh_desc() local
122 struct caam_drv_private *ctrlpriv = dev_get_drvdata(jrdev->parent); in aead_null_set_sh_desc()
143 dma_sync_single_for_device(jrdev, ctx->sh_desc_enc_dma, in aead_null_set_sh_desc()
162 dma_sync_single_for_device(jrdev, ctx->sh_desc_dec_dma, in aead_null_set_sh_desc()
174 struct device *jrdev = ctx->jrdev; in aead_set_sh_desc() local
175 struct caam_drv_private *ctrlpriv = dev_get_drvdata(jrdev->parent); in aead_set_sh_desc()
243 dma_sync_single_for_device(jrdev, ctx->sh_desc_enc_dma, in aead_set_sh_desc()
275 dma_sync_single_for_device(jrdev, ctx->sh_desc_dec_dma, in aead_set_sh_desc()
309 dma_sync_single_for_device(jrdev, ctx->sh_desc_enc_dma, in aead_set_sh_desc()
330 struct device *jrdev = ctx->jrdev; in gcm_set_sh_desc() local
354 dma_sync_single_for_device(jrdev, ctx->sh_desc_enc_dma, in gcm_set_sh_desc()
371 dma_sync_single_for_device(jrdev, ctx->sh_desc_dec_dma, in gcm_set_sh_desc()
390 struct device *jrdev = ctx->jrdev; in rfc4106_set_sh_desc() local
415 dma_sync_single_for_device(jrdev, ctx->sh_desc_enc_dma, in rfc4106_set_sh_desc()
433 dma_sync_single_for_device(jrdev, ctx->sh_desc_dec_dma, in rfc4106_set_sh_desc()
453 struct device *jrdev = ctx->jrdev; in rfc4543_set_sh_desc() local
478 dma_sync_single_for_device(jrdev, ctx->sh_desc_enc_dma, in rfc4543_set_sh_desc()
496 dma_sync_single_for_device(jrdev, ctx->sh_desc_dec_dma, in rfc4543_set_sh_desc()
517 struct device *jrdev = ctx->jrdev; in aead_setkey() local
518 struct caam_drv_private *ctrlpriv = dev_get_drvdata(jrdev->parent); in aead_setkey()
548 dma_sync_single_for_device(jrdev, ctx->key_dma, in aead_setkey()
554 ret = gen_split_key(ctx->jrdev, ctx->key, &ctx->adata, keys.authkey, in aead_setkey()
563 dma_sync_single_for_device(jrdev, ctx->key_dma, ctx->adata.keylen_pad + in aead_setkey()
585 struct device *jrdev = ctx->jrdev; in gcm_setkey() local
593 dma_sync_single_for_device(jrdev, ctx->key_dma, keylen, ctx->dir); in gcm_setkey()
603 struct device *jrdev = ctx->jrdev; in rfc4106_setkey() local
620 dma_sync_single_for_device(jrdev, ctx->key_dma, ctx->cdata.keylen, in rfc4106_setkey()
629 struct device *jrdev = ctx->jrdev; in rfc4543_setkey() local
646 dma_sync_single_for_device(jrdev, ctx->key_dma, ctx->cdata.keylen, in rfc4543_setkey()
657 struct device *jrdev = ctx->jrdev; in ablkcipher_setkey() local
696 dma_sync_single_for_device(jrdev, ctx->sh_desc_enc_dma, in ablkcipher_setkey()
703 dma_sync_single_for_device(jrdev, ctx->sh_desc_dec_dma, in ablkcipher_setkey()
710 dma_sync_single_for_device(jrdev, ctx->sh_desc_givenc_dma, in ablkcipher_setkey()
720 struct device *jrdev = ctx->jrdev; in xts_ablkcipher_setkey() local
726 dev_err(jrdev, "key size mismatch\n"); in xts_ablkcipher_setkey()
737 dma_sync_single_for_device(jrdev, ctx->sh_desc_enc_dma, in xts_ablkcipher_setkey()
743 dma_sync_single_for_device(jrdev, ctx->sh_desc_dec_dma, in xts_ablkcipher_setkey()
834 static void aead_encrypt_done(struct device *jrdev, u32 *desc, u32 err, in aead_encrypt_done() argument
841 dev_err(jrdev, "%s %d: err 0x%x\n", __func__, __LINE__, err); in aead_encrypt_done()
847 caam_jr_strstatus(jrdev, err); in aead_encrypt_done()
849 aead_unmap(jrdev, edesc, req); in aead_encrypt_done()
856 static void aead_decrypt_done(struct device *jrdev, u32 *desc, u32 err, in aead_decrypt_done() argument
863 dev_err(jrdev, "%s %d: err 0x%x\n", __func__, __LINE__, err); in aead_decrypt_done()
869 caam_jr_strstatus(jrdev, err); in aead_decrypt_done()
871 aead_unmap(jrdev, edesc, req); in aead_decrypt_done()
884 static void ablkcipher_encrypt_done(struct device *jrdev, u32 *desc, u32 err, in ablkcipher_encrypt_done() argument
893 dev_err(jrdev, "%s %d: err 0x%x\n", __func__, __LINE__, err); in ablkcipher_encrypt_done()
899 caam_jr_strstatus(jrdev, err); in ablkcipher_encrypt_done()
910 ablkcipher_unmap(jrdev, edesc, req); in ablkcipher_encrypt_done()
936 static void ablkcipher_decrypt_done(struct device *jrdev, u32 *desc, u32 err, in ablkcipher_decrypt_done() argument
945 dev_err(jrdev, "%s %d: err 0x%x\n", __func__, __LINE__, err); in ablkcipher_decrypt_done()
950 caam_jr_strstatus(jrdev, err); in ablkcipher_decrypt_done()
961 ablkcipher_unmap(jrdev, edesc, req); in ablkcipher_decrypt_done()
1065 struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctx->jrdev->parent); in init_authenc_job()
1201 struct device *jrdev = ctx->jrdev; in aead_edesc_alloc() local
1213 dev_err(jrdev, "Insufficient bytes (%d) in src S/G\n", in aead_edesc_alloc()
1223 dev_err(jrdev, "Insufficient bytes (%d) in dst S/G\n", in aead_edesc_alloc()
1233 dev_err(jrdev, "Insufficient bytes (%d) in src S/G\n", in aead_edesc_alloc()
1241 mapped_src_nents = dma_map_sg(jrdev, req->src, src_nents, in aead_edesc_alloc()
1244 dev_err(jrdev, "unable to map source\n"); in aead_edesc_alloc()
1250 mapped_src_nents = dma_map_sg(jrdev, req->src, in aead_edesc_alloc()
1253 dev_err(jrdev, "unable to map source\n"); in aead_edesc_alloc()
1260 mapped_dst_nents = dma_map_sg(jrdev, req->dst, dst_nents, in aead_edesc_alloc()
1263 dev_err(jrdev, "unable to map destination\n"); in aead_edesc_alloc()
1264 dma_unmap_sg(jrdev, req->src, src_nents, DMA_TO_DEVICE); in aead_edesc_alloc()
1277 caam_unmap(jrdev, req->src, req->dst, src_nents, dst_nents, 0, in aead_edesc_alloc()
1302 edesc->sec4_sg_dma = dma_map_single(jrdev, edesc->sec4_sg, in aead_edesc_alloc()
1304 if (dma_mapping_error(jrdev, edesc->sec4_sg_dma)) { in aead_edesc_alloc()
1305 dev_err(jrdev, "unable to map S/G table\n"); in aead_edesc_alloc()
1306 aead_unmap(jrdev, edesc, req); in aead_edesc_alloc()
1321 struct device *jrdev = ctx->jrdev; in gcm_encrypt() local
1340 ret = caam_jr_enqueue(jrdev, desc, aead_encrypt_done, req); in gcm_encrypt()
1344 aead_unmap(jrdev, edesc, req); in gcm_encrypt()
1364 struct device *jrdev = ctx->jrdev; in aead_encrypt() local
1384 ret = caam_jr_enqueue(jrdev, desc, aead_encrypt_done, req); in aead_encrypt()
1388 aead_unmap(jrdev, edesc, req); in aead_encrypt()
1400 struct device *jrdev = ctx->jrdev; in gcm_decrypt() local
1419 ret = caam_jr_enqueue(jrdev, desc, aead_decrypt_done, req); in gcm_decrypt()
1423 aead_unmap(jrdev, edesc, req); in gcm_decrypt()
1443 struct device *jrdev = ctx->jrdev; in aead_decrypt() local
1467 ret = caam_jr_enqueue(jrdev, desc, aead_decrypt_done, req); in aead_decrypt()
1471 aead_unmap(jrdev, edesc, req); in aead_decrypt()
1486 struct device *jrdev = ctx->jrdev; in ablkcipher_edesc_alloc() local
1498 dev_err(jrdev, "Insufficient bytes (%d) in src S/G\n", in ablkcipher_edesc_alloc()
1506 dev_err(jrdev, "Insufficient bytes (%d) in dst S/G\n", in ablkcipher_edesc_alloc()
1513 mapped_src_nents = dma_map_sg(jrdev, req->src, src_nents, in ablkcipher_edesc_alloc()
1516 dev_err(jrdev, "unable to map source\n"); in ablkcipher_edesc_alloc()
1520 mapped_src_nents = dma_map_sg(jrdev, req->src, src_nents, in ablkcipher_edesc_alloc()
1523 dev_err(jrdev, "unable to map source\n"); in ablkcipher_edesc_alloc()
1527 mapped_dst_nents = dma_map_sg(jrdev, req->dst, dst_nents, in ablkcipher_edesc_alloc()
1530 dev_err(jrdev, "unable to map destination\n"); in ablkcipher_edesc_alloc()
1531 dma_unmap_sg(jrdev, req->src, src_nents, DMA_TO_DEVICE); in ablkcipher_edesc_alloc()
1547 dev_err(jrdev, "could not allocate extended descriptor\n"); in ablkcipher_edesc_alloc()
1548 caam_unmap(jrdev, req->src, req->dst, src_nents, dst_nents, 0, in ablkcipher_edesc_alloc()
1564 iv_dma = dma_map_single(jrdev, iv, ivsize, DMA_TO_DEVICE); in ablkcipher_edesc_alloc()
1565 if (dma_mapping_error(jrdev, iv_dma)) { in ablkcipher_edesc_alloc()
1566 dev_err(jrdev, "unable to map IV\n"); in ablkcipher_edesc_alloc()
1567 caam_unmap(jrdev, req->src, req->dst, src_nents, dst_nents, 0, in ablkcipher_edesc_alloc()
1581 edesc->sec4_sg_dma = dma_map_single(jrdev, edesc->sec4_sg, in ablkcipher_edesc_alloc()
1583 if (dma_mapping_error(jrdev, edesc->sec4_sg_dma)) { in ablkcipher_edesc_alloc()
1584 dev_err(jrdev, "unable to map S/G table\n"); in ablkcipher_edesc_alloc()
1585 caam_unmap(jrdev, req->src, req->dst, src_nents, dst_nents, in ablkcipher_edesc_alloc()
1607 struct device *jrdev = ctx->jrdev; in ablkcipher_encrypt() local
1624 ret = caam_jr_enqueue(jrdev, desc, ablkcipher_encrypt_done, req); in ablkcipher_encrypt()
1629 ablkcipher_unmap(jrdev, edesc, req); in ablkcipher_encrypt()
1642 struct device *jrdev = ctx->jrdev; in ablkcipher_decrypt() local
1667 ret = caam_jr_enqueue(jrdev, desc, ablkcipher_decrypt_done, req); in ablkcipher_decrypt()
1671 ablkcipher_unmap(jrdev, edesc, req); in ablkcipher_decrypt()
1689 struct device *jrdev = ctx->jrdev; in ablkcipher_giv_edesc_alloc() local
1701 dev_err(jrdev, "Insufficient bytes (%d) in src S/G\n", in ablkcipher_giv_edesc_alloc()
1707 mapped_src_nents = dma_map_sg(jrdev, req->src, src_nents, in ablkcipher_giv_edesc_alloc()
1710 dev_err(jrdev, "unable to map source\n"); in ablkcipher_giv_edesc_alloc()
1717 mapped_src_nents = dma_map_sg(jrdev, req->src, src_nents, in ablkcipher_giv_edesc_alloc()
1720 dev_err(jrdev, "unable to map source\n"); in ablkcipher_giv_edesc_alloc()
1726 dev_err(jrdev, "Insufficient bytes (%d) in dst S/G\n", in ablkcipher_giv_edesc_alloc()
1731 mapped_dst_nents = dma_map_sg(jrdev, req->dst, dst_nents, in ablkcipher_giv_edesc_alloc()
1734 dev_err(jrdev, "unable to map destination\n"); in ablkcipher_giv_edesc_alloc()
1735 dma_unmap_sg(jrdev, req->src, src_nents, DMA_TO_DEVICE); in ablkcipher_giv_edesc_alloc()
1751 dev_err(jrdev, "could not allocate extended descriptor\n"); in ablkcipher_giv_edesc_alloc()
1752 caam_unmap(jrdev, req->src, req->dst, src_nents, dst_nents, 0, in ablkcipher_giv_edesc_alloc()
1766 iv_dma = dma_map_single(jrdev, iv, ivsize, DMA_FROM_DEVICE); in ablkcipher_giv_edesc_alloc()
1767 if (dma_mapping_error(jrdev, iv_dma)) { in ablkcipher_giv_edesc_alloc()
1768 dev_err(jrdev, "unable to map IV\n"); in ablkcipher_giv_edesc_alloc()
1769 caam_unmap(jrdev, req->src, req->dst, src_nents, dst_nents, 0, in ablkcipher_giv_edesc_alloc()
1783 edesc->sec4_sg_dma = dma_map_single(jrdev, edesc->sec4_sg, in ablkcipher_giv_edesc_alloc()
1785 if (dma_mapping_error(jrdev, edesc->sec4_sg_dma)) { in ablkcipher_giv_edesc_alloc()
1786 dev_err(jrdev, "unable to map S/G table\n"); in ablkcipher_giv_edesc_alloc()
1787 caam_unmap(jrdev, req->src, req->dst, src_nents, dst_nents, in ablkcipher_giv_edesc_alloc()
1810 struct device *jrdev = ctx->jrdev; in ablkcipher_givencrypt() local
1829 ret = caam_jr_enqueue(jrdev, desc, ablkcipher_encrypt_done, req); in ablkcipher_givencrypt()
1834 ablkcipher_unmap(jrdev, edesc, req); in ablkcipher_givencrypt()
3254 ctx->jrdev = caam_jr_alloc(); in caam_init_common()
3255 if (IS_ERR(ctx->jrdev)) { in caam_init_common()
3257 return PTR_ERR(ctx->jrdev); in caam_init_common()
3260 priv = dev_get_drvdata(ctx->jrdev->parent); in caam_init_common()
3266 dma_addr = dma_map_single_attrs(ctx->jrdev, ctx->sh_desc_enc, in caam_init_common()
3270 if (dma_mapping_error(ctx->jrdev, dma_addr)) { in caam_init_common()
3271 dev_err(ctx->jrdev, "unable to map key, shared descriptors\n"); in caam_init_common()
3272 caam_jr_free(ctx->jrdev); in caam_init_common()
3313 dma_unmap_single_attrs(ctx->jrdev, ctx->sh_desc_enc_dma, in caam_exit_common()
3316 caam_jr_free(ctx->jrdev); in caam_exit_common()