Lines Matching refs:rctx
21 struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); in qce_ablkcipher_done() local
39 dma_unmap_sg(qce->dev, rctx->src_sg, rctx->src_nents, dir_src); in qce_ablkcipher_done()
40 dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); in qce_ablkcipher_done()
42 sg_free_table(&rctx->dst_tbl); in qce_ablkcipher_done()
55 struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); in qce_ablkcipher_async_req_handle() local
65 rctx->iv = req->info; in qce_ablkcipher_async_req_handle()
66 rctx->ivsize = crypto_ablkcipher_ivsize(ablkcipher); in qce_ablkcipher_async_req_handle()
67 rctx->cryptlen = req->nbytes; in qce_ablkcipher_async_req_handle()
73 rctx->src_nents = sg_nents_for_len(req->src, req->nbytes); in qce_ablkcipher_async_req_handle()
75 rctx->dst_nents = sg_nents_for_len(req->dst, req->nbytes); in qce_ablkcipher_async_req_handle()
77 rctx->dst_nents = rctx->src_nents; in qce_ablkcipher_async_req_handle()
78 if (rctx->src_nents < 0) { in qce_ablkcipher_async_req_handle()
80 return rctx->src_nents; in qce_ablkcipher_async_req_handle()
82 if (rctx->dst_nents < 0) { in qce_ablkcipher_async_req_handle()
84 return -rctx->dst_nents; in qce_ablkcipher_async_req_handle()
87 rctx->dst_nents += 1; in qce_ablkcipher_async_req_handle()
92 ret = sg_alloc_table(&rctx->dst_tbl, rctx->dst_nents, gfp); in qce_ablkcipher_async_req_handle()
96 sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ); in qce_ablkcipher_async_req_handle()
98 sg = qce_sgtable_add(&rctx->dst_tbl, req->dst); in qce_ablkcipher_async_req_handle()
104 sg = qce_sgtable_add(&rctx->dst_tbl, &rctx->result_sg); in qce_ablkcipher_async_req_handle()
111 rctx->dst_sg = rctx->dst_tbl.sgl; in qce_ablkcipher_async_req_handle()
113 ret = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); in qce_ablkcipher_async_req_handle()
118 ret = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src); in qce_ablkcipher_async_req_handle()
121 rctx->src_sg = req->src; in qce_ablkcipher_async_req_handle()
123 rctx->src_sg = rctx->dst_sg; in qce_ablkcipher_async_req_handle()
126 ret = qce_dma_prep_sgs(&qce->dma, rctx->src_sg, rctx->src_nents, in qce_ablkcipher_async_req_handle()
127 rctx->dst_sg, rctx->dst_nents, in qce_ablkcipher_async_req_handle()
144 dma_unmap_sg(qce->dev, req->src, rctx->src_nents, dir_src); in qce_ablkcipher_async_req_handle()
146 dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); in qce_ablkcipher_async_req_handle()
148 sg_free_table(&rctx->dst_tbl); in qce_ablkcipher_async_req_handle()
215 struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); in qce_ablkcipher_crypt() local
219 rctx->flags = tmpl->alg_flags; in qce_ablkcipher_crypt()
220 rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; in qce_ablkcipher_crypt()
222 if (IS_AES(rctx->flags) && ctx->enc_keylen != AES_KEYSIZE_128 && in qce_ablkcipher_crypt()