Searched refs:qat_req (Results 1 - 2 of 2) sorted by relevance

/linux-4.4.14/drivers/crypto/qat/qat_common/
H A Dqat_asym_algs.c246 struct qat_rsa_request *qat_req = qat_rsa_enc() local
248 struct icp_qat_fw_pke_request *msg = &qat_req->req; qat_rsa_enc()
265 qat_req->ctx = ctx; qat_rsa_enc()
271 qat_req->in.enc.e = ctx->dma_e; qat_rsa_enc()
272 qat_req->in.enc.n = ctx->dma_n; qat_rsa_enc()
283 qat_req->src_align = NULL; qat_rsa_enc()
284 qat_req->in.enc.m = dma_map_single(dev, sg_virt(req->src), qat_rsa_enc()
286 if (unlikely(dma_mapping_error(dev, qat_req->in.enc.m))) qat_rsa_enc()
292 qat_req->src_align = dma_zalloc_coherent(dev, ctx->key_sz, qat_rsa_enc()
293 &qat_req->in.enc.m, qat_rsa_enc()
295 if (unlikely(!qat_req->src_align)) qat_rsa_enc()
298 scatterwalk_map_and_copy(qat_req->src_align + shift, req->src, qat_rsa_enc()
302 qat_req->dst_align = NULL; qat_rsa_enc()
303 qat_req->out.enc.c = dma_map_single(dev, sg_virt(req->dst), qat_rsa_enc()
307 if (unlikely(dma_mapping_error(dev, qat_req->out.enc.c))) qat_rsa_enc()
311 qat_req->dst_align = dma_zalloc_coherent(dev, ctx->key_sz, qat_rsa_enc()
312 &qat_req->out.enc.c, qat_rsa_enc()
314 if (unlikely(!qat_req->dst_align)) qat_rsa_enc()
318 qat_req->in.in_tab[3] = 0; qat_rsa_enc()
319 qat_req->out.out_tab[1] = 0; qat_rsa_enc()
320 qat_req->phy_in = dma_map_single(dev, &qat_req->in.enc.m, qat_rsa_enc()
323 if (unlikely(dma_mapping_error(dev, qat_req->phy_in))) qat_rsa_enc()
326 qat_req->phy_out = dma_map_single(dev, &qat_req->out.enc.c, qat_rsa_enc()
329 if (unlikely(dma_mapping_error(dev, qat_req->phy_out))) qat_rsa_enc()
332 msg->pke_mid.src_data_addr = qat_req->phy_in; qat_rsa_enc()
333 msg->pke_mid.dest_data_addr = qat_req->phy_out; qat_rsa_enc()
344 if (qat_req->src_align) qat_rsa_enc()
345 dma_free_coherent(dev, ctx->key_sz, qat_req->src_align, qat_rsa_enc()
346 qat_req->in.enc.m); qat_rsa_enc()
348 if (!dma_mapping_error(dev, qat_req->in.enc.m)) qat_rsa_enc()
349 dma_unmap_single(dev, qat_req->in.enc.m, ctx->key_sz, qat_rsa_enc()
352 if (qat_req->dst_align) qat_rsa_enc()
353 dma_free_coherent(dev, ctx->key_sz, qat_req->dst_align, qat_rsa_enc()
354 qat_req->out.enc.c); qat_rsa_enc()
356 if (!dma_mapping_error(dev, qat_req->out.enc.c)) qat_rsa_enc()
357 dma_unmap_single(dev, qat_req->out.enc.c, ctx->key_sz, qat_rsa_enc()
360 if (!dma_mapping_error(dev, qat_req->phy_in)) qat_rsa_enc()
361 dma_unmap_single(dev, qat_req->phy_in, qat_rsa_enc()
364 if (!dma_mapping_error(dev, qat_req->phy_out)) qat_rsa_enc()
365 dma_unmap_single(dev, qat_req->phy_out, qat_rsa_enc()
377 struct qat_rsa_request *qat_req = qat_rsa_dec() local
379 struct icp_qat_fw_pke_request *msg = &qat_req->req; qat_rsa_dec()
396 qat_req->ctx = ctx; qat_rsa_dec()
402 qat_req->in.dec.d = ctx->dma_d; qat_rsa_dec()
403 qat_req->in.dec.n = ctx->dma_n; qat_rsa_dec()
414 qat_req->src_align = NULL; qat_rsa_dec()
415 qat_req->in.dec.c = dma_map_single(dev, sg_virt(req->src), qat_rsa_dec()
417 if (unlikely(dma_mapping_error(dev, qat_req->in.dec.c))) qat_rsa_dec()
423 qat_req->src_align = dma_zalloc_coherent(dev, ctx->key_sz, qat_rsa_dec()
424 &qat_req->in.dec.c, qat_rsa_dec()
426 if (unlikely(!qat_req->src_align)) qat_rsa_dec()
429 scatterwalk_map_and_copy(qat_req->src_align + shift, req->src, qat_rsa_dec()
433 qat_req->dst_align = NULL; qat_rsa_dec()
434 qat_req->out.dec.m = dma_map_single(dev, sg_virt(req->dst), qat_rsa_dec()
438 if (unlikely(dma_mapping_error(dev, qat_req->out.dec.m))) qat_rsa_dec()
442 qat_req->dst_align = dma_zalloc_coherent(dev, ctx->key_sz, qat_rsa_dec()
443 &qat_req->out.dec.m, qat_rsa_dec()
445 if (unlikely(!qat_req->dst_align)) qat_rsa_dec()
450 qat_req->in.in_tab[3] = 0; qat_rsa_dec()
451 qat_req->out.out_tab[1] = 0; qat_rsa_dec()
452 qat_req->phy_in = dma_map_single(dev, &qat_req->in.dec.c, qat_rsa_dec()
455 if (unlikely(dma_mapping_error(dev, qat_req->phy_in))) qat_rsa_dec()
458 qat_req->phy_out = dma_map_single(dev, &qat_req->out.dec.m, qat_rsa_dec()
461 if (unlikely(dma_mapping_error(dev, qat_req->phy_out))) qat_rsa_dec()
464 msg->pke_mid.src_data_addr = qat_req->phy_in; qat_rsa_dec()
465 msg->pke_mid.dest_data_addr = qat_req->phy_out; qat_rsa_dec()
476 if (qat_req->src_align) qat_rsa_dec()
477 dma_free_coherent(dev, ctx->key_sz, qat_req->src_align, qat_rsa_dec()
478 qat_req->in.dec.c); qat_rsa_dec()
480 if (!dma_mapping_error(dev, qat_req->in.dec.c)) qat_rsa_dec()
481 dma_unmap_single(dev, qat_req->in.dec.c, ctx->key_sz, qat_rsa_dec()
484 if (qat_req->dst_align) qat_rsa_dec()
485 dma_free_coherent(dev, ctx->key_sz, qat_req->dst_align, qat_rsa_dec()
486 qat_req->out.dec.m); qat_rsa_dec()
488 if (!dma_mapping_error(dev, qat_req->out.dec.m)) qat_rsa_dec()
489 dma_unmap_single(dev, qat_req->out.dec.m, ctx->key_sz, qat_rsa_dec()
492 if (!dma_mapping_error(dev, qat_req->phy_in)) qat_rsa_dec()
493 dma_unmap_single(dev, qat_req->phy_in, qat_rsa_dec()
496 if (!dma_mapping_error(dev, qat_req->phy_out)) qat_rsa_dec()
497 dma_unmap_single(dev, qat_req->phy_out, qat_rsa_dec()
H A Dqat_algs.c631 struct qat_crypto_request *qat_req) qat_alg_free_bufl()
634 struct qat_alg_buf_list *bl = qat_req->buf.bl; qat_alg_free_bufl()
635 struct qat_alg_buf_list *blout = qat_req->buf.blout; qat_alg_free_bufl()
636 dma_addr_t blp = qat_req->buf.blp; qat_alg_free_bufl()
637 dma_addr_t blpout = qat_req->buf.bloutp; qat_alg_free_bufl()
638 size_t sz = qat_req->buf.sz; qat_alg_free_bufl()
639 size_t sz_out = qat_req->buf.sz_out; qat_alg_free_bufl()
665 struct qat_crypto_request *qat_req) qat_alg_sgl_to_bufl()
705 qat_req->buf.bl = bufl;
706 qat_req->buf.blp = blp;
707 qat_req->buf.sz = sz;
740 qat_req->buf.blout = buflout;
741 qat_req->buf.bloutp = bloutp;
742 qat_req->buf.sz_out = sz_out;
745 qat_req->buf.bloutp = qat_req->buf.blp;
746 qat_req->buf.sz_out = 0;
776 struct qat_crypto_request *qat_req) qat_aead_alg_callback()
778 struct qat_alg_aead_ctx *ctx = qat_req->aead_ctx; qat_aead_alg_callback()
780 struct aead_request *areq = qat_req->aead_req; qat_aead_alg_callback()
784 qat_alg_free_bufl(inst, qat_req); qat_aead_alg_callback()
791 struct qat_crypto_request *qat_req) qat_ablkcipher_alg_callback()
793 struct qat_alg_ablkcipher_ctx *ctx = qat_req->ablkcipher_ctx; qat_ablkcipher_alg_callback()
795 struct ablkcipher_request *areq = qat_req->ablkcipher_req; qat_ablkcipher_alg_callback()
799 qat_alg_free_bufl(inst, qat_req); qat_ablkcipher_alg_callback()
808 struct qat_crypto_request *qat_req = qat_alg_callback() local
811 qat_req->cb(qat_resp, qat_req); qat_alg_callback()
819 struct qat_crypto_request *qat_req = aead_request_ctx(areq); qat_alg_aead_dec() local
826 ret = qat_alg_sgl_to_bufl(ctx->inst, areq->src, areq->dst, qat_req); qat_alg_aead_dec()
830 msg = &qat_req->req; qat_alg_aead_dec()
832 qat_req->aead_ctx = ctx; qat_alg_aead_dec()
833 qat_req->aead_req = areq; qat_alg_aead_dec()
834 qat_req->cb = qat_aead_alg_callback; qat_alg_aead_dec()
835 qat_req->req.comn_mid.opaque_data = (uint64_t)(__force long)qat_req; qat_alg_aead_dec()
836 qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp; qat_alg_aead_dec()
837 qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp; qat_alg_aead_dec()
838 cipher_param = (void *)&qat_req->req.serv_specif_rqpars; qat_alg_aead_dec()
850 qat_alg_free_bufl(ctx->inst, qat_req); qat_alg_aead_dec()
861 struct qat_crypto_request *qat_req = aead_request_ctx(areq); qat_alg_aead_enc() local
868 ret = qat_alg_sgl_to_bufl(ctx->inst, areq->src, areq->dst, qat_req); qat_alg_aead_enc()
872 msg = &qat_req->req; qat_alg_aead_enc()
874 qat_req->aead_ctx = ctx; qat_alg_aead_enc()
875 qat_req->aead_req = areq; qat_alg_aead_enc()
876 qat_req->cb = qat_aead_alg_callback; qat_alg_aead_enc()
877 qat_req->req.comn_mid.opaque_data = (uint64_t)(__force long)qat_req; qat_alg_aead_enc()
878 qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp; qat_alg_aead_enc()
879 qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp; qat_alg_aead_enc()
880 cipher_param = (void *)&qat_req->req.serv_specif_rqpars; qat_alg_aead_enc()
895 qat_alg_free_bufl(ctx->inst, qat_req); qat_alg_aead_enc()
988 struct qat_crypto_request *qat_req = ablkcipher_request_ctx(req); qat_alg_ablkcipher_encrypt() local
993 ret = qat_alg_sgl_to_bufl(ctx->inst, req->src, req->dst, qat_req); qat_alg_ablkcipher_encrypt()
997 msg = &qat_req->req; qat_alg_ablkcipher_encrypt()
999 qat_req->ablkcipher_ctx = ctx; qat_alg_ablkcipher_encrypt()
1000 qat_req->ablkcipher_req = req; qat_alg_ablkcipher_encrypt()
1001 qat_req->cb = qat_ablkcipher_alg_callback; qat_alg_ablkcipher_encrypt()
1002 qat_req->req.comn_mid.opaque_data = (uint64_t)(__force long)qat_req; qat_alg_ablkcipher_encrypt()
1003 qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp; qat_alg_ablkcipher_encrypt()
1004 qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp; qat_alg_ablkcipher_encrypt()
1005 cipher_param = (void *)&qat_req->req.serv_specif_rqpars; qat_alg_ablkcipher_encrypt()
1014 qat_alg_free_bufl(ctx->inst, qat_req); qat_alg_ablkcipher_encrypt()
1025 struct qat_crypto_request *qat_req = ablkcipher_request_ctx(req); qat_alg_ablkcipher_decrypt() local
1030 ret = qat_alg_sgl_to_bufl(ctx->inst, req->src, req->dst, qat_req); qat_alg_ablkcipher_decrypt()
1034 msg = &qat_req->req; qat_alg_ablkcipher_decrypt()
1036 qat_req->ablkcipher_ctx = ctx; qat_alg_ablkcipher_decrypt()
1037 qat_req->ablkcipher_req = req; qat_alg_ablkcipher_decrypt()
1038 qat_req->cb = qat_ablkcipher_alg_callback; qat_alg_ablkcipher_decrypt()
1039 qat_req->req.comn_mid.opaque_data = (uint64_t)(__force long)qat_req; qat_alg_ablkcipher_decrypt()
1040 qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp; qat_alg_ablkcipher_decrypt()
1041 qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp; qat_alg_ablkcipher_decrypt()
1042 cipher_param = (void *)&qat_req->req.serv_specif_rqpars; qat_alg_ablkcipher_decrypt()
1051 qat_alg_free_bufl(ctx->inst, qat_req); qat_alg_ablkcipher_decrypt()
630 qat_alg_free_bufl(struct qat_crypto_instance *inst, struct qat_crypto_request *qat_req) qat_alg_free_bufl() argument
662 qat_alg_sgl_to_bufl(struct qat_crypto_instance *inst, struct scatterlist *sgl, struct scatterlist *sglout, struct qat_crypto_request *qat_req) qat_alg_sgl_to_bufl() argument
775 qat_aead_alg_callback(struct icp_qat_fw_la_resp *qat_resp, struct qat_crypto_request *qat_req) qat_aead_alg_callback() argument
790 qat_ablkcipher_alg_callback(struct icp_qat_fw_la_resp *qat_resp, struct qat_crypto_request *qat_req) qat_ablkcipher_alg_callback() argument

Completed in 79 milliseconds