Lines Matching refs:req
89 struct hpre_sqe req;
231 struct hpre_sqe *msg = &hpre_req->req;
255 struct hpre_asym_request *req,
260 struct hpre_sqe *sqe = &req->req;
268 if (req->src)
269 dma_free_coherent(dev, ctx->key_sz, req->src, tmp);
278 if (req->dst) {
280 scatterwalk_map_and_copy(req->dst, dst, 0,
282 dma_free_coherent(dev, ctx->key_sz, req->dst, tmp);
291 struct hpre_asym_request *req;
299 req = ctx->req_list[id];
300 hpre_rm_req_from_ctx(req);
301 *kreq = req;
349 static bool hpre_is_bd_timeout(struct hpre_asym_request *req,
356 time_use_us = (reply_time.tv_sec - req->req_time.tv_sec) *
358 (reply_time.tv_nsec - req->req_time.tv_nsec) /
370 struct hpre_asym_request *req;
375 ret = hpre_alg_res_post_hf(ctx, resp, (void **)&req);
376 areq = req->areq.dh;
380 if (overtime_thrhld && hpre_is_bd_timeout(req, overtime_thrhld))
383 hpre_hw_data_clr_all(ctx, req, areq->dst, areq->src);
391 struct hpre_asym_request *req;
396 ret = hpre_alg_res_post_hf(ctx, resp, (void **)&req);
399 if (overtime_thrhld && hpre_is_bd_timeout(req, overtime_thrhld))
402 areq = req->areq.rsa;
404 hpre_hw_data_clr_all(ctx, req, areq->dst, areq->src);
414 struct hpre_asym_request *req = ctx->req_list[le16_to_cpu(sqe->tag)];
417 if (unlikely(!req)) {
422 req->cb(ctx, resp);
439 static int hpre_msg_request_set(struct hpre_ctx *ctx, void *req, bool is_rsa)
447 struct akcipher_request *akreq = req;
458 msg = &h_req->req;
461 struct kpp_request *kreq = req;
472 msg = &h_req->req;
514 static int hpre_dh_compute_value(struct kpp_request *req)
516 struct crypto_kpp *tfm = crypto_kpp_reqtfm(req);
518 void *tmp = kpp_request_ctx(req);
520 struct hpre_sqe *msg = &hpre_req->req;
523 ret = hpre_msg_request_set(ctx, req, false);
527 if (req->src) {
528 ret = hpre_hw_data_init(hpre_req, req->src, req->src_len, 1, 1);
535 ret = hpre_hw_data_init(hpre_req, req->dst, req->dst_len, 0, 1);
539 if (ctx->crt_g2_mode && !req->src)
551 hpre_hw_data_clr_all(ctx, hpre_req, req->dst, req->src);
716 static int hpre_rsa_enc(struct akcipher_request *req)
718 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
720 void *tmp = akcipher_request_ctx(req);
722 struct hpre_sqe *msg = &hpre_req->req;
728 akcipher_request_set_tfm(req, ctx->rsa.soft_tfm);
729 ret = crypto_akcipher_encrypt(req);
730 akcipher_request_set_tfm(req, tfm);
737 ret = hpre_msg_request_set(ctx, req, true);
744 ret = hpre_hw_data_init(hpre_req, req->src, req->src_len, 1, 0);
748 ret = hpre_hw_data_init(hpre_req, req->dst, req->dst_len, 0, 0);
759 hpre_hw_data_clr_all(ctx, hpre_req, req->dst, req->src);
764 static int hpre_rsa_dec(struct akcipher_request *req)
766 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
768 void *tmp = akcipher_request_ctx(req);
770 struct hpre_sqe *msg = &hpre_req->req;
776 akcipher_request_set_tfm(req, ctx->rsa.soft_tfm);
777 ret = crypto_akcipher_decrypt(req);
778 akcipher_request_set_tfm(req, tfm);
785 ret = hpre_msg_request_set(ctx, req, true);
799 ret = hpre_hw_data_init(hpre_req, req->src, req->src_len, 1, 0);
803 ret = hpre_hw_data_init(hpre_req, req->dst, req->dst_len, 0, 0);
814 hpre_hw_data_clr_all(ctx, hpre_req, req->dst, req->src);