Lines Matching refs:rctx
29 struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); in qce_ablkcipher_done() local
47 dma_unmap_sg(qce->dev, rctx->src_sg, rctx->src_nents, dir_src); in qce_ablkcipher_done()
48 dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); in qce_ablkcipher_done()
50 sg_free_table(&rctx->dst_tbl); in qce_ablkcipher_done()
63 struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); in qce_ablkcipher_async_req_handle() local
73 rctx->iv = req->info; in qce_ablkcipher_async_req_handle()
74 rctx->ivsize = crypto_ablkcipher_ivsize(ablkcipher); in qce_ablkcipher_async_req_handle()
75 rctx->cryptlen = req->nbytes; in qce_ablkcipher_async_req_handle()
81 rctx->src_nents = sg_nents_for_len(req->src, req->nbytes); in qce_ablkcipher_async_req_handle()
83 rctx->dst_nents = sg_nents_for_len(req->dst, req->nbytes); in qce_ablkcipher_async_req_handle()
85 rctx->dst_nents = rctx->src_nents; in qce_ablkcipher_async_req_handle()
86 if (rctx->src_nents < 0) { in qce_ablkcipher_async_req_handle()
88 return rctx->src_nents; in qce_ablkcipher_async_req_handle()
90 if (rctx->dst_nents < 0) { in qce_ablkcipher_async_req_handle()
92 return -rctx->dst_nents; in qce_ablkcipher_async_req_handle()
95 rctx->dst_nents += 1; in qce_ablkcipher_async_req_handle()
100 ret = sg_alloc_table(&rctx->dst_tbl, rctx->dst_nents, gfp); in qce_ablkcipher_async_req_handle()
104 sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ); in qce_ablkcipher_async_req_handle()
106 sg = qce_sgtable_add(&rctx->dst_tbl, req->dst); in qce_ablkcipher_async_req_handle()
112 sg = qce_sgtable_add(&rctx->dst_tbl, &rctx->result_sg); in qce_ablkcipher_async_req_handle()
119 rctx->dst_sg = rctx->dst_tbl.sgl; in qce_ablkcipher_async_req_handle()
121 ret = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); in qce_ablkcipher_async_req_handle()
126 ret = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src); in qce_ablkcipher_async_req_handle()
129 rctx->src_sg = req->src; in qce_ablkcipher_async_req_handle()
131 rctx->src_sg = rctx->dst_sg; in qce_ablkcipher_async_req_handle()
134 ret = qce_dma_prep_sgs(&qce->dma, rctx->src_sg, rctx->src_nents, in qce_ablkcipher_async_req_handle()
135 rctx->dst_sg, rctx->dst_nents, in qce_ablkcipher_async_req_handle()
152 dma_unmap_sg(qce->dev, req->src, rctx->src_nents, dir_src); in qce_ablkcipher_async_req_handle()
154 dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); in qce_ablkcipher_async_req_handle()
156 sg_free_table(&rctx->dst_tbl); in qce_ablkcipher_async_req_handle()
206 struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); in qce_ablkcipher_crypt() local
210 rctx->flags = tmpl->alg_flags; in qce_ablkcipher_crypt()
211 rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; in qce_ablkcipher_crypt()
213 if (IS_AES(rctx->flags) && ctx->enc_keylen != AES_KEYSIZE_128 && in qce_ablkcipher_crypt()