Lines Matching refs:req
132 struct ahash_request *req; member
165 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); in img_hash_start()
211 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); in img_hash_dma_callback()
224 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); in img_hash_xmit_dma()
254 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); in img_hash_write_via_cpu()
256 ctx->bufcnt = sg_copy_to_buffer(hdev->req->src, sg_nents(ctx->sg), in img_hash_write_via_cpu()
257 ctx->buffer, hdev->req->nbytes); in img_hash_write_via_cpu()
259 ctx->total = hdev->req->nbytes; in img_hash_write_via_cpu()
269 static int img_hash_finish(struct ahash_request *req) in img_hash_finish() argument
271 struct img_hash_request_ctx *ctx = ahash_request_ctx(req); in img_hash_finish()
273 if (!req->result) in img_hash_finish()
276 memcpy(req->result, ctx->digest, ctx->digsize); in img_hash_finish()
281 static void img_hash_copy_hash(struct ahash_request *req) in img_hash_copy_hash() argument
283 struct img_hash_request_ctx *ctx = ahash_request_ctx(req); in img_hash_copy_hash()
291 static void img_hash_finish_req(struct ahash_request *req, int err) in img_hash_finish_req() argument
293 struct img_hash_request_ctx *ctx = ahash_request_ctx(req); in img_hash_finish_req()
297 img_hash_copy_hash(req); in img_hash_finish_req()
299 err = img_hash_finish(req); in img_hash_finish_req()
308 if (req->base.complete) in img_hash_finish_req()
309 req->base.complete(&req->base, err); in img_hash_finish_req()
314 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); in img_hash_write_via_dma()
359 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); in img_hash_dma_task()
430 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); in img_hash_write_via_dma_stop()
440 struct ahash_request *req = hdev->req; in img_hash_process_data() local
441 struct img_hash_request_ctx *ctx = ahash_request_ctx(req); in img_hash_process_data()
446 if (req->nbytes >= IMG_HASH_DMA_THRESHOLD) { in img_hash_process_data()
448 req->nbytes); in img_hash_process_data()
452 req->nbytes); in img_hash_process_data()
467 nbits = (u64)hdev->req->nbytes << 3; in img_hash_hw_init()
481 static int img_hash_init(struct ahash_request *req) in img_hash_init() argument
483 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in img_hash_init()
484 struct img_hash_request_ctx *rctx = ahash_request_ctx(req); in img_hash_init()
488 rctx->fallback_req.base.flags = req->base.flags in img_hash_init()
495 struct ahash_request *req) in img_hash_handle_queue() argument
504 if (req) in img_hash_handle_queue()
505 res = ahash_enqueue_request(&hdev->queue, req); in img_hash_handle_queue()
525 req = ahash_request_cast(async_req); in img_hash_handle_queue()
526 hdev->req = req; in img_hash_handle_queue()
528 ctx = ahash_request_ctx(req); in img_hash_handle_queue()
531 ctx->op, req->nbytes); in img_hash_handle_queue()
540 img_hash_finish_req(req, err); in img_hash_handle_queue()
545 static int img_hash_update(struct ahash_request *req) in img_hash_update() argument
547 struct img_hash_request_ctx *rctx = ahash_request_ctx(req); in img_hash_update()
548 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in img_hash_update()
552 rctx->fallback_req.base.flags = req->base.flags in img_hash_update()
554 rctx->fallback_req.nbytes = req->nbytes; in img_hash_update()
555 rctx->fallback_req.src = req->src; in img_hash_update()
560 static int img_hash_final(struct ahash_request *req) in img_hash_final() argument
562 struct img_hash_request_ctx *rctx = ahash_request_ctx(req); in img_hash_final()
563 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in img_hash_final()
567 rctx->fallback_req.base.flags = req->base.flags in img_hash_final()
569 rctx->fallback_req.result = req->result; in img_hash_final()
574 static int img_hash_finup(struct ahash_request *req) in img_hash_finup() argument
576 struct img_hash_request_ctx *rctx = ahash_request_ctx(req); in img_hash_finup()
577 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in img_hash_finup()
581 rctx->fallback_req.base.flags = req->base.flags in img_hash_finup()
583 rctx->fallback_req.nbytes = req->nbytes; in img_hash_finup()
584 rctx->fallback_req.src = req->src; in img_hash_finup()
585 rctx->fallback_req.result = req->result; in img_hash_finup()
590 static int img_hash_digest(struct ahash_request *req) in img_hash_digest() argument
592 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in img_hash_digest()
594 struct img_hash_request_ctx *ctx = ahash_request_ctx(req); in img_hash_digest()
636 ctx->total = req->nbytes; in img_hash_digest()
637 ctx->sg = req->src; in img_hash_digest()
638 ctx->sgfirst = req->src; in img_hash_digest()
641 err = img_hash_handle_queue(tctx->hdev, req); in img_hash_digest()
868 img_hash_finish_req(hdev->req, err); in img_hash_done_task()