Lines Matching refs:areq

74 int sun8i_ce_hash_init(struct ahash_request *areq)  in sun8i_ce_hash_init()  argument
76 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_init()
77 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_init()
83 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP; in sun8i_ce_hash_init()
88 int sun8i_ce_hash_export(struct ahash_request *areq, void *out) in sun8i_ce_hash_export() argument
90 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_export()
91 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_export()
95 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP; in sun8i_ce_hash_export()
100 int sun8i_ce_hash_import(struct ahash_request *areq, const void *in) in sun8i_ce_hash_import() argument
102 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_import()
103 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_import()
107 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP; in sun8i_ce_hash_import()
112 int sun8i_ce_hash_final(struct ahash_request *areq) in sun8i_ce_hash_final() argument
114 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_final()
115 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_final()
123 rctx->fallback_req.base.flags = areq->base.flags & in sun8i_ce_hash_final()
125 rctx->fallback_req.result = areq->result; in sun8i_ce_hash_final()
135 int sun8i_ce_hash_update(struct ahash_request *areq) in sun8i_ce_hash_update() argument
137 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_update()
138 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_update()
142 rctx->fallback_req.base.flags = areq->base.flags & in sun8i_ce_hash_update()
144 rctx->fallback_req.nbytes = areq->nbytes; in sun8i_ce_hash_update()
145 rctx->fallback_req.src = areq->src; in sun8i_ce_hash_update()
150 int sun8i_ce_hash_finup(struct ahash_request *areq) in sun8i_ce_hash_finup() argument
152 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_finup()
153 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_finup()
161 rctx->fallback_req.base.flags = areq->base.flags & in sun8i_ce_hash_finup()
164 rctx->fallback_req.nbytes = areq->nbytes; in sun8i_ce_hash_finup()
165 rctx->fallback_req.src = areq->src; in sun8i_ce_hash_finup()
166 rctx->fallback_req.result = areq->result; in sun8i_ce_hash_finup()
175 static int sun8i_ce_hash_digest_fb(struct ahash_request *areq) in sun8i_ce_hash_digest_fb() argument
177 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_digest_fb()
178 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_digest_fb()
186 rctx->fallback_req.base.flags = areq->base.flags & in sun8i_ce_hash_digest_fb()
189 rctx->fallback_req.nbytes = areq->nbytes; in sun8i_ce_hash_digest_fb()
190 rctx->fallback_req.src = areq->src; in sun8i_ce_hash_digest_fb()
191 rctx->fallback_req.result = areq->result; in sun8i_ce_hash_digest_fb()
200 static bool sun8i_ce_hash_need_fallback(struct ahash_request *areq) in sun8i_ce_hash_need_fallback() argument
202 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_need_fallback()
209 if (areq->nbytes == 0) { in sun8i_ce_hash_need_fallback()
214 if (sg_nents_for_len(areq->src, areq->nbytes) > MAX_SG - 1) { in sun8i_ce_hash_need_fallback()
218 sg = areq->src; in sun8i_ce_hash_need_fallback()
233 int sun8i_ce_hash_digest(struct ahash_request *areq) in sun8i_ce_hash_digest() argument
235 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_digest()
237 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_digest()
244 if (sun8i_ce_hash_need_fallback(areq)) in sun8i_ce_hash_digest()
245 return sun8i_ce_hash_digest_fb(areq); in sun8i_ce_hash_digest()
247 nr_sgs = sg_nents_for_len(areq->src, areq->nbytes); in sun8i_ce_hash_digest()
249 return sun8i_ce_hash_digest_fb(areq); in sun8i_ce_hash_digest()
251 for_each_sg(areq->src, sg, nr_sgs, i) { in sun8i_ce_hash_digest()
253 return sun8i_ce_hash_digest_fb(areq); in sun8i_ce_hash_digest()
263 return crypto_transfer_hash_request_to_engine(engine, areq); in sun8i_ce_hash_digest()
326 struct ahash_request *areq = container_of(breq, struct ahash_request, base); in sun8i_ce_hash_run() local
327 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_run()
329 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_run()
346 int ns = sg_nents_for_len(areq->src, areq->nbytes); in sun8i_ce_hash_run()
378 dev_dbg(ce->dev, "%s %s len=%d\n", __func__, crypto_tfm_alg_name(areq->base.tfm), areq->nbytes); in sun8i_ce_hash_run()
391 nr_sgs = dma_map_sg(ce->dev, areq->src, ns, DMA_TO_DEVICE); in sun8i_ce_hash_run()
398 len = areq->nbytes; in sun8i_ce_hash_run()
399 for_each_sg(areq->src, sg, nr_sgs, i) { in sun8i_ce_hash_run()
419 byte_count = areq->nbytes; in sun8i_ce_hash_run()
451 cet->t_dlen = cpu_to_le32((areq->nbytes + j * 4) * 8); in sun8i_ce_hash_run()
453 cet->t_dlen = cpu_to_le32(areq->nbytes / 4 + j); in sun8i_ce_hash_run()
455 chan->timeout = areq->nbytes; in sun8i_ce_hash_run()
457 err = sun8i_ce_run_task(ce, flow, crypto_tfm_alg_name(areq->base.tfm)); in sun8i_ce_hash_run()
460 dma_unmap_sg(ce->dev, areq->src, ns, DMA_TO_DEVICE); in sun8i_ce_hash_run()
464 memcpy(areq->result, result, algt->alg.hash.halg.digestsize); in sun8i_ce_hash_run()