Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196709
b: refs/heads/master
c: f565e67
h: refs/heads/master
i:
  196707: 9f891d0
v: v3
  • Loading branch information
Uri Simchoni authored and Herbert Xu committed Apr 13, 2010
1 parent 664c729 commit 28eeb0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 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: 6bc6fcd609080461682c5cc0a1e3bf4345d6419d
refs/heads/master: f565e67ec1b8f4a95d21550f9b879fe86b4132e0
14 changes: 9 additions & 5 deletions trunk/drivers/crypto/mv_cesa.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ static void dequeue_complete_req(void)
struct ablkcipher_request *req = cpg->cur_req;
void *buf;
int ret;
int need_copy_len = cpg->p.crypt_len;
int sram_offset = 0;

cpg->p.total_req_bytes += cpg->p.crypt_len;
do {
Expand All @@ -257,14 +259,16 @@ static void dequeue_complete_req(void)
buf = cpg->p.dst_sg_it.addr;
buf += cpg->p.dst_start;

dst_copy = min(cpg->p.crypt_len, cpg->p.sg_dst_left);

memcpy(buf, cpg->sram + SRAM_DATA_OUT_START, dst_copy);
dst_copy = min(need_copy_len, cpg->p.sg_dst_left);

memcpy(buf,
cpg->sram + SRAM_DATA_OUT_START + sram_offset,
dst_copy);
sram_offset += dst_copy;
cpg->p.sg_dst_left -= dst_copy;
cpg->p.crypt_len -= dst_copy;
need_copy_len -= dst_copy;
cpg->p.dst_start += dst_copy;
} while (cpg->p.crypt_len > 0);
} while (need_copy_len > 0);

BUG_ON(cpg->eng_st != ENGINE_W_DEQUEUE);
if (cpg->p.total_req_bytes < req->nbytes) {
Expand Down

0 comments on commit 28eeb0d

Please sign in to comment.