Lines Matching refs:req
133 struct ahash_request *req;
166 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req);
212 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req);
225 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req);
255 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req);
257 ctx->bufcnt = sg_copy_to_buffer(hdev->req->src, sg_nents(ctx->sg),
258 ctx->buffer, hdev->req->nbytes);
260 ctx->total = hdev->req->nbytes;
270 static int img_hash_finish(struct ahash_request *req)
272 struct img_hash_request_ctx *ctx = ahash_request_ctx(req);
274 if (!req->result)
277 memcpy(req->result, ctx->digest, ctx->digsize);
282 static void img_hash_copy_hash(struct ahash_request *req)
284 struct img_hash_request_ctx *ctx = ahash_request_ctx(req);
292 static void img_hash_finish_req(struct ahash_request *req, int err)
294 struct img_hash_request_ctx *ctx = ahash_request_ctx(req);
298 img_hash_copy_hash(req);
300 err = img_hash_finish(req);
309 if (req->base.complete)
310 req->base.complete(&req->base, err);
315 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req);
365 if (!hdev->req)
368 ctx = ahash_request_ctx(hdev->req);
435 struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req);
445 struct ahash_request *req = hdev->req;
446 struct img_hash_request_ctx *ctx = ahash_request_ctx(req);
451 if (req->nbytes >= IMG_HASH_DMA_THRESHOLD) {
453 req->nbytes);
457 req->nbytes);
472 nbits = (u64)hdev->req->nbytes << 3;
486 static int img_hash_init(struct ahash_request *req)
488 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
489 struct img_hash_request_ctx *rctx = ahash_request_ctx(req);
493 rctx->fallback_req.base.flags = req->base.flags
500 struct ahash_request *req)
509 if (req)
510 res = ahash_enqueue_request(&hdev->queue, req);
530 req = ahash_request_cast(async_req);
531 hdev->req = req;
533 ctx = ahash_request_ctx(req);
535 dev_info(hdev->dev, "processing req, op: %lu, bytes: %d\n",
536 ctx->op, req->nbytes);
545 img_hash_finish_req(req, err);
550 static int img_hash_update(struct ahash_request *req)
552 struct img_hash_request_ctx *rctx = ahash_request_ctx(req);
553 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
557 rctx->fallback_req.base.flags = req->base.flags
559 rctx->fallback_req.nbytes = req->nbytes;
560 rctx->fallback_req.src = req->src;
565 static int img_hash_final(struct ahash_request *req)
567 struct img_hash_request_ctx *rctx = ahash_request_ctx(req);
568 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
572 rctx->fallback_req.base.flags = req->base.flags
574 rctx->fallback_req.result = req->result;
579 static int img_hash_finup(struct ahash_request *req)
581 struct img_hash_request_ctx *rctx = ahash_request_ctx(req);
582 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
586 rctx->fallback_req.base.flags = req->base.flags
588 rctx->fallback_req.nbytes = req->nbytes;
589 rctx->fallback_req.src = req->src;
590 rctx->fallback_req.result = req->result;
595 static int img_hash_import(struct ahash_request *req, const void *in)
597 struct img_hash_request_ctx *rctx = ahash_request_ctx(req);
598 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
602 rctx->fallback_req.base.flags = req->base.flags
608 static int img_hash_export(struct ahash_request *req, void *out)
610 struct img_hash_request_ctx *rctx = ahash_request_ctx(req);
611 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
615 rctx->fallback_req.base.flags = req->base.flags
621 static int img_hash_digest(struct ahash_request *req)
623 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
625 struct img_hash_request_ctx *ctx = ahash_request_ctx(req);
667 ctx->total = req->nbytes;
668 ctx->sg = req->src;
669 ctx->sgfirst = req->src;
672 err = img_hash_handle_queue(tctx->hdev, req);
931 img_hash_finish_req(hdev->req, err);