Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196713
b: refs/heads/master
c: a58094a
h: refs/heads/master
i:
  196711: 5921782
v: v3
  • Loading branch information
Uri Simchoni authored and Herbert Xu committed Apr 13, 2010
1 parent 82042ad commit 14425e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a5f691ef03f4c01d2703b5ec4ddd4c17e645dec
refs/heads/master: a58094ac5f95d6969e5c52ff096d2fd2864542af
13 changes: 9 additions & 4 deletions trunk/drivers/crypto/mv_cesa.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ enum engine_status {
struct req_progress {
struct sg_mapping_iter src_sg_it;
struct sg_mapping_iter dst_sg_it;
void (*complete) (void);
void (*process) (int is_first);

/* src mostly */
int sg_src_left;
Expand Down Expand Up @@ -251,6 +253,9 @@ static void mv_crypto_algo_completion(void)
struct ablkcipher_request *req = ablkcipher_request_cast(cpg->cur_req);
struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req);

sg_miter_stop(&cpg->p.src_sg_it);
sg_miter_stop(&cpg->p.dst_sg_it);

if (req_ctx->op != COP_AES_CBC)
return ;

Expand Down Expand Up @@ -294,11 +299,9 @@ static void dequeue_complete_req(void)
if (cpg->p.hw_processed_bytes < cpg->p.hw_nbytes) {
/* process next scatter list entry */
cpg->eng_st = ENGINE_BUSY;
mv_process_current_q(0);
cpg->p.process(0);
} else {
sg_miter_stop(&cpg->p.src_sg_it);
sg_miter_stop(&cpg->p.dst_sg_it);
mv_crypto_algo_completion();
cpg->p.complete();
cpg->eng_st = ENGINE_IDLE;
local_bh_disable();
req->complete(req, 0);
Expand Down Expand Up @@ -331,6 +334,8 @@ static void mv_enqueue_new_req(struct ablkcipher_request *req)
cpg->cur_req = &req->base;
memset(p, 0, sizeof(struct req_progress));
p->hw_nbytes = req->nbytes;
p->complete = mv_crypto_algo_completion;
p->process = mv_process_current_q;

num_sgs = count_sgs(req->src, req->nbytes);
sg_miter_start(&p->src_sg_it, req->src, num_sgs, SG_MITER_FROM_SG);
Expand Down

0 comments on commit 14425e9

Please sign in to comment.