1 From 0328ac267564089d9cedfb568f936d30a6debd21 Mon Sep 17 00:00:00 2001
2 From: Uri Simchoni <uri@jdland.co.il>
3 Date: Thu, 8 Apr 2010 19:25:37 +0300
4 Subject: [PATCH] crypto: mv_cesa - Invoke the user callback from a softirq
7 Invoke the user callback from a softirq context
9 Signed-off-by: Uri Simchoni <uri@jdland.co.il>
10 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
12 drivers/crypto/mv_cesa.c | 2 ++
13 1 files changed, 2 insertions(+), 0 deletions(-)
15 diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
16 index b21ef63..3e60ba9 100644
17 --- a/drivers/crypto/mv_cesa.c
18 +++ b/drivers/crypto/mv_cesa.c
19 @@ -275,7 +275,9 @@ static void dequeue_complete_req(void)
20 sg_miter_stop(&cpg->p.dst_sg_it);
21 mv_crypto_algo_completion();
22 cpg->eng_st = ENGINE_IDLE;
24 req->base.complete(&req->base, 0);
31 From 6bc6fcd609080461682c5cc0a1e3bf4345d6419d Mon Sep 17 00:00:00 2001
32 From: Uri Simchoni <uri@jdland.co.il>
33 Date: Thu, 8 Apr 2010 19:25:56 +0300
34 Subject: [PATCH] crypto: mv_cesa - Remove compiler warning in mv_cesa driver
36 Remove compiler warning
38 Signed-off-by: Uri Simchoni <uri@jdland.co.il>
39 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
41 drivers/crypto/mv_cesa.c | 1 +
42 1 files changed, 1 insertions(+), 0 deletions(-)
44 diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
45 index 3e60ba9..37d9f06 100644
46 --- a/drivers/crypto/mv_cesa.c
47 +++ b/drivers/crypto/mv_cesa.c
48 @@ -178,6 +178,7 @@ static void mv_process_current_q(int first_block)
49 op.config = CFG_OP_CRYPT_ONLY | CFG_ENCM_AES | CFG_ENC_MODE_ECB;
53 op.config = CFG_OP_CRYPT_ONLY | CFG_ENCM_AES | CFG_ENC_MODE_CBC;
54 op.enc_iv = ENC_IV_POINT(SRAM_DATA_IV) |
55 ENC_IV_BUF_POINT(SRAM_DATA_IV_BUF);
58 X-Git-Url: http://git.kernelconcepts.de/?p=mv-sheeva.git;a=blobdiff_plain;f=drivers%2Fcrypto%2Fmv_cesa.c;h=018a95ce0c9b0d6e6a13bff1522630799bc445b3;hp=37d9f0688e7575a3e366f6bb9eda5adc5db807b5;hb=f565e67ec1b8f4a95d21550f9b879fe86b4132e0;hpb=6bc6fcd609080461682c5cc0a1e3bf4345d6419d
60 diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
61 index 37d9f06..018a95c 100644
62 --- a/drivers/crypto/mv_cesa.c
63 +++ b/drivers/crypto/mv_cesa.c
64 @@ -242,6 +242,8 @@ static void dequeue_complete_req(void)
65 struct ablkcipher_request *req = cpg->cur_req;
68 + int need_copy_len = cpg->p.crypt_len;
69 + int sram_offset = 0;
71 cpg->p.total_req_bytes += cpg->p.crypt_len;
73 @@ -257,14 +259,16 @@ static void dequeue_complete_req(void)
74 buf = cpg->p.dst_sg_it.addr;
75 buf += cpg->p.dst_start;
77 - dst_copy = min(cpg->p.crypt_len, cpg->p.sg_dst_left);
79 - memcpy(buf, cpg->sram + SRAM_DATA_OUT_START, dst_copy);
80 + dst_copy = min(need_copy_len, cpg->p.sg_dst_left);
83 + cpg->sram + SRAM_DATA_OUT_START + sram_offset,
85 + sram_offset += dst_copy;
86 cpg->p.sg_dst_left -= dst_copy;
87 - cpg->p.crypt_len -= dst_copy;
88 + need_copy_len -= dst_copy;
89 cpg->p.dst_start += dst_copy;
90 - } while (cpg->p.crypt_len > 0);
91 + } while (need_copy_len > 0);
93 BUG_ON(cpg->eng_st != ENGINE_W_DEQUEUE);
94 if (cpg->p.total_req_bytes < req->nbytes) {
95 From 15d4dd3594221f11a7730fcf2d5f9942b96cdd7e Mon Sep 17 00:00:00 2001
96 From: Uri Simchoni <uri@jdland.co.il>
97 Date: Thu, 8 Apr 2010 19:27:02 +0300
98 Subject: [PATCH] crypto: mv_cesa - Fix situations where the src sglist spans
99 more data than the request asks for
101 Fix for situations where the source scatterlist spans more data than the
104 Signed-off-by: Uri Simchoni <uri@jdland.co.il>
105 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
107 drivers/crypto/mv_cesa.c | 66 ++++++++++++++++++++++++++++++---------------
108 1 files changed, 44 insertions(+), 22 deletions(-)
110 diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
111 index 018a95c..096f9ff 100644
112 --- a/drivers/crypto/mv_cesa.c
113 +++ b/drivers/crypto/mv_cesa.c
114 @@ -143,27 +143,45 @@ static int mv_setkey_aes(struct crypto_ablkcipher *cipher, const u8 *key,
118 -static void setup_data_in(struct ablkcipher_request *req)
119 +static void copy_src_to_buf(struct req_progress *p, char *dbuf, int len)
124 - if (!cpg->p.sg_src_left) {
125 - ret = sg_miter_next(&cpg->p.src_sg_it);
127 - cpg->p.sg_src_left = cpg->p.src_sg_it.length;
128 - cpg->p.src_start = 0;
133 - cpg->p.crypt_len = min(cpg->p.sg_src_left, cpg->max_req_size);
135 - buf = cpg->p.src_sg_it.addr;
136 - buf += cpg->p.src_start;
138 + if (!p->sg_src_left) {
139 + ret = sg_miter_next(&p->src_sg_it);
141 + p->sg_src_left = p->src_sg_it.length;
145 - memcpy(cpg->sram + SRAM_DATA_IN_START, buf, cpg->p.crypt_len);
146 + sbuf = p->src_sg_it.addr + p->src_start;
148 + if (p->sg_src_left <= len - copied) {
149 + memcpy(dbuf + copied, sbuf, p->sg_src_left);
150 + copied += p->sg_src_left;
151 + p->sg_src_left = 0;
155 + int copy_len = len - copied;
156 + memcpy(dbuf + copied, sbuf, copy_len);
157 + p->src_start += copy_len;
158 + p->sg_src_left -= copy_len;
164 - cpg->p.sg_src_left -= cpg->p.crypt_len;
165 - cpg->p.src_start += cpg->p.crypt_len;
166 +static void setup_data_in(struct ablkcipher_request *req)
168 + struct req_progress *p = &cpg->p;
170 + min((int)req->nbytes - p->total_req_bytes, cpg->max_req_size);
171 + copy_src_to_buf(p, cpg->sram + SRAM_DATA_IN_START,
175 static void mv_process_current_q(int first_block)
176 @@ -289,12 +307,16 @@ static void dequeue_complete_req(void)
177 static int count_sgs(struct scatterlist *sl, unsigned int total_bytes)
182 - total_bytes -= sl[i].length;
185 - } while (total_bytes > 0);
189 + cur_len = sl[i].length;
191 + if (total_bytes > cur_len)
192 + total_bytes -= cur_len;
201 From 3b61a90502481045f56c1c41a2af35ee48ca8b80 Mon Sep 17 00:00:00 2001
202 From: Uri Simchoni <uri@jdland.co.il>
203 Date: Thu, 8 Apr 2010 19:27:33 +0300
204 Subject: [PATCH] crypto: mv_cesa - Enqueue generic async requests
206 Enqueue generic async requests rather than ablkcipher requests
207 in the driver's queue
209 Signed-off-by: Uri Simchoni <uri@jdland.co.il>
210 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
212 drivers/crypto/mv_cesa.c | 43 ++++++++++++++++++++++++-------------------
213 1 files changed, 24 insertions(+), 19 deletions(-)
215 diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
216 index 096f9ff..8891e2e 100644
217 --- a/drivers/crypto/mv_cesa.c
218 +++ b/drivers/crypto/mv_cesa.c
219 @@ -39,6 +39,7 @@ enum engine_status {
220 * @sg_src_left: bytes left in src to process (scatter list)
221 * @src_start: offset to add to src start position (scatter list)
222 * @crypt_len: length of current crypt process
223 + * @hw_nbytes: total bytes to process in hw for this request
224 * @sg_dst_left: bytes left dst to process in this scatter list
225 * @dst_start: offset to add to dst start position (scatter list)
226 * @total_req_bytes: total number of bytes processed (request).
227 @@ -55,6 +56,7 @@ struct req_progress {
235 @@ -71,7 +73,7 @@ struct crypto_priv {
237 struct crypto_queue queue;
238 enum engine_status eng_st;
239 - struct ablkcipher_request *cur_req;
240 + struct crypto_async_request *cur_req;
241 struct req_progress p;
244 @@ -175,18 +177,18 @@ static void copy_src_to_buf(struct req_progress *p, char *dbuf, int len)
248 -static void setup_data_in(struct ablkcipher_request *req)
249 +static void setup_data_in(void)
251 struct req_progress *p = &cpg->p;
253 - min((int)req->nbytes - p->total_req_bytes, cpg->max_req_size);
254 + min(p->hw_nbytes - p->total_req_bytes, cpg->max_req_size);
255 copy_src_to_buf(p, cpg->sram + SRAM_DATA_IN_START,
259 static void mv_process_current_q(int first_block)
261 - struct ablkcipher_request *req = cpg->cur_req;
262 + struct ablkcipher_request *req = ablkcipher_request_cast(cpg->cur_req);
263 struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
264 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req);
265 struct sec_accel_config op;
266 @@ -229,7 +231,7 @@ static void mv_process_current_q(int first_block)
267 ENC_P_DST(SRAM_DATA_OUT_START);
268 op.enc_key_p = SRAM_DATA_KEY_P;
270 - setup_data_in(req);
272 op.enc_len = cpg->p.crypt_len;
273 memcpy(cpg->sram + SRAM_CONFIG, &op,
274 sizeof(struct sec_accel_config));
275 @@ -246,7 +248,7 @@ static void mv_process_current_q(int first_block)
277 static void mv_crypto_algo_completion(void)
279 - struct ablkcipher_request *req = cpg->cur_req;
280 + struct ablkcipher_request *req = ablkcipher_request_cast(cpg->cur_req);
281 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req);
283 if (req_ctx->op != COP_AES_CBC)
284 @@ -257,7 +259,7 @@ static void mv_crypto_algo_completion(void)
286 static void dequeue_complete_req(void)
288 - struct ablkcipher_request *req = cpg->cur_req;
289 + struct crypto_async_request *req = cpg->cur_req;
292 int need_copy_len = cpg->p.crypt_len;
293 @@ -289,7 +291,7 @@ static void dequeue_complete_req(void)
294 } while (need_copy_len > 0);
296 BUG_ON(cpg->eng_st != ENGINE_W_DEQUEUE);
297 - if (cpg->p.total_req_bytes < req->nbytes) {
298 + if (cpg->p.total_req_bytes < cpg->p.hw_nbytes) {
299 /* process next scatter list entry */
300 cpg->eng_st = ENGINE_BUSY;
301 mv_process_current_q(0);
302 @@ -299,7 +301,7 @@ static void dequeue_complete_req(void)
303 mv_crypto_algo_completion();
304 cpg->eng_st = ENGINE_IDLE;
306 - req->base.complete(&req->base, 0);
307 + req->complete(req, 0);
311 @@ -323,16 +325,19 @@ static int count_sgs(struct scatterlist *sl, unsigned int total_bytes)
313 static void mv_enqueue_new_req(struct ablkcipher_request *req)
315 + struct req_progress *p = &cpg->p;
318 - cpg->cur_req = req;
319 - memset(&cpg->p, 0, sizeof(struct req_progress));
320 + cpg->cur_req = &req->base;
321 + memset(p, 0, sizeof(struct req_progress));
322 + p->hw_nbytes = req->nbytes;
324 num_sgs = count_sgs(req->src, req->nbytes);
325 - sg_miter_start(&cpg->p.src_sg_it, req->src, num_sgs, SG_MITER_FROM_SG);
326 + sg_miter_start(&p->src_sg_it, req->src, num_sgs, SG_MITER_FROM_SG);
328 num_sgs = count_sgs(req->dst, req->nbytes);
329 - sg_miter_start(&cpg->p.dst_sg_it, req->dst, num_sgs, SG_MITER_TO_SG);
330 + sg_miter_start(&p->dst_sg_it, req->dst, num_sgs, SG_MITER_TO_SG);
332 mv_process_current_q(1);
335 @@ -378,13 +383,13 @@ static int queue_manag(void *data)
339 -static int mv_handle_req(struct ablkcipher_request *req)
340 +static int mv_handle_req(struct crypto_async_request *req)
345 spin_lock_irqsave(&cpg->lock, flags);
346 - ret = ablkcipher_enqueue_request(&cpg->queue, req);
347 + ret = crypto_enqueue_request(&cpg->queue, req);
348 spin_unlock_irqrestore(&cpg->lock, flags);
349 wake_up_process(cpg->queue_th);
351 @@ -397,7 +402,7 @@ static int mv_enc_aes_ecb(struct ablkcipher_request *req)
352 req_ctx->op = COP_AES_ECB;
353 req_ctx->decrypt = 0;
355 - return mv_handle_req(req);
356 + return mv_handle_req(&req->base);
359 static int mv_dec_aes_ecb(struct ablkcipher_request *req)
360 @@ -409,7 +414,7 @@ static int mv_dec_aes_ecb(struct ablkcipher_request *req)
361 req_ctx->decrypt = 1;
363 compute_aes_dec_key(ctx);
364 - return mv_handle_req(req);
365 + return mv_handle_req(&req->base);
368 static int mv_enc_aes_cbc(struct ablkcipher_request *req)
369 @@ -419,7 +424,7 @@ static int mv_enc_aes_cbc(struct ablkcipher_request *req)
370 req_ctx->op = COP_AES_CBC;
371 req_ctx->decrypt = 0;
373 - return mv_handle_req(req);
374 + return mv_handle_req(&req->base);
377 static int mv_dec_aes_cbc(struct ablkcipher_request *req)
378 @@ -431,7 +436,7 @@ static int mv_dec_aes_cbc(struct ablkcipher_request *req)
379 req_ctx->decrypt = 1;
381 compute_aes_dec_key(ctx);
382 - return mv_handle_req(req);
383 + return mv_handle_req(&req->base);
386 static int mv_cra_init(struct crypto_tfm *tfm)
389 From 7a5f691ef03f4c01d2703b5ec4ddd4c17e645dec Mon Sep 17 00:00:00 2001
390 From: Uri Simchoni <uri@jdland.co.il>
391 Date: Thu, 8 Apr 2010 19:29:16 +0300
392 Subject: [PATCH] crypto: mv_cesa - Rename a variable to a more suitable name
394 Rename a variable to a more suitable name
396 Signed-off-by: Uri Simchoni <uri@jdland.co.il>
397 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
399 drivers/crypto/mv_cesa.c | 10 +++++-----
400 1 files changed, 5 insertions(+), 5 deletions(-)
402 diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
403 index 8891e2e..4262932 100644
404 --- a/drivers/crypto/mv_cesa.c
405 +++ b/drivers/crypto/mv_cesa.c
406 @@ -42,7 +42,7 @@ enum engine_status {
407 * @hw_nbytes: total bytes to process in hw for this request
408 * @sg_dst_left: bytes left dst to process in this scatter list
409 * @dst_start: offset to add to dst start position (scatter list)
410 - * @total_req_bytes: total number of bytes processed (request).
411 + * @hw_processed_bytes: number of bytes processed by hw (request).
413 * sg helper are used to iterate over the scatterlist. Since the size of the
414 * SRAM may be less than the scatter size, this struct struct is used to keep
415 @@ -60,7 +60,7 @@ struct req_progress {
419 - int total_req_bytes;
420 + int hw_processed_bytes;
424 @@ -181,7 +181,7 @@ static void setup_data_in(void)
426 struct req_progress *p = &cpg->p;
428 - min(p->hw_nbytes - p->total_req_bytes, cpg->max_req_size);
429 + min(p->hw_nbytes - p->hw_processed_bytes, cpg->max_req_size);
430 copy_src_to_buf(p, cpg->sram + SRAM_DATA_IN_START,
433 @@ -265,7 +265,7 @@ static void dequeue_complete_req(void)
434 int need_copy_len = cpg->p.crypt_len;
437 - cpg->p.total_req_bytes += cpg->p.crypt_len;
438 + cpg->p.hw_processed_bytes += cpg->p.crypt_len;
442 @@ -291,7 +291,7 @@ static void dequeue_complete_req(void)
443 } while (need_copy_len > 0);
445 BUG_ON(cpg->eng_st != ENGINE_W_DEQUEUE);
446 - if (cpg->p.total_req_bytes < cpg->p.hw_nbytes) {
447 + if (cpg->p.hw_processed_bytes < cpg->p.hw_nbytes) {
448 /* process next scatter list entry */
449 cpg->eng_st = ENGINE_BUSY;
450 mv_process_current_q(0);
453 From a58094ac5f95d6969e5c52ff096d2fd2864542af Mon Sep 17 00:00:00 2001
454 From: Uri Simchoni <uri@jdland.co.il>
455 Date: Thu, 8 Apr 2010 19:30:19 +0300
456 Subject: [PATCH] crypto: mv_cesa - Execute some code via function pointers
457 rathr than direct calls
459 Execute some code via function pointers rathr than direct calls
460 (to allow customization in the hashing request)
462 Signed-off-by: Uri Simchoni <uri@jdland.co.il>
463 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
465 drivers/crypto/mv_cesa.c | 13 +++++++++----
466 1 files changed, 9 insertions(+), 4 deletions(-)
468 diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
469 index 4262932..2b4f07a 100644
470 --- a/drivers/crypto/mv_cesa.c
471 +++ b/drivers/crypto/mv_cesa.c
472 @@ -51,6 +51,8 @@ enum engine_status {
473 struct req_progress {
474 struct sg_mapping_iter src_sg_it;
475 struct sg_mapping_iter dst_sg_it;
476 + void (*complete) (void);
477 + void (*process) (int is_first);
481 @@ -251,6 +253,9 @@ static void mv_crypto_algo_completion(void)
482 struct ablkcipher_request *req = ablkcipher_request_cast(cpg->cur_req);
483 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req);
485 + sg_miter_stop(&cpg->p.src_sg_it);
486 + sg_miter_stop(&cpg->p.dst_sg_it);
488 if (req_ctx->op != COP_AES_CBC)
491 @@ -294,11 +299,9 @@ static void dequeue_complete_req(void)
492 if (cpg->p.hw_processed_bytes < cpg->p.hw_nbytes) {
493 /* process next scatter list entry */
494 cpg->eng_st = ENGINE_BUSY;
495 - mv_process_current_q(0);
498 - sg_miter_stop(&cpg->p.src_sg_it);
499 - sg_miter_stop(&cpg->p.dst_sg_it);
500 - mv_crypto_algo_completion();
502 cpg->eng_st = ENGINE_IDLE;
504 req->complete(req, 0);
505 @@ -331,6 +334,8 @@ static void mv_enqueue_new_req(struct ablkcipher_request *req)
506 cpg->cur_req = &req->base;
507 memset(p, 0, sizeof(struct req_progress));
508 p->hw_nbytes = req->nbytes;
509 + p->complete = mv_crypto_algo_completion;
510 + p->process = mv_process_current_q;
512 num_sgs = count_sgs(req->src, req->nbytes);
513 sg_miter_start(&p->src_sg_it, req->src, num_sgs, SG_MITER_FROM_SG);
516 X-Git-Url: http://git.kernelconcepts.de/?p=mv-sheeva.git;a=blobdiff_plain;f=drivers%2Fcrypto%2Fmv_cesa.c;h=49a22060fb51a46afff004ddade3dacf378aecd8;hp=2b4f07aa89e8ba7422de65eea027e06daa5f7797;hb=f0d03deaad05d9cc99cd2ee0475c9ecd726c19ae;hpb=a58094ac5f95d6969e5c52ff096d2fd2864542af
518 diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
519 index 2b4f07a..49a2206 100644
520 --- a/drivers/crypto/mv_cesa.c
521 +++ b/drivers/crypto/mv_cesa.c
522 @@ -40,6 +40,7 @@ enum engine_status {
523 * @src_start: offset to add to src start position (scatter list)
524 * @crypt_len: length of current crypt process
525 * @hw_nbytes: total bytes to process in hw for this request
526 + * @copy_back: whether to copy data back (crypt) or not (hash)
527 * @sg_dst_left: bytes left dst to process in this scatter list
528 * @dst_start: offset to add to dst start position (scatter list)
529 * @hw_processed_bytes: number of bytes processed by hw (request).
530 @@ -60,6 +61,7 @@ struct req_progress {
537 int hw_processed_bytes;
538 @@ -267,33 +269,35 @@ static void dequeue_complete_req(void)
539 struct crypto_async_request *req = cpg->cur_req;
542 - int need_copy_len = cpg->p.crypt_len;
543 - int sram_offset = 0;
545 cpg->p.hw_processed_bytes += cpg->p.crypt_len;
548 + if (cpg->p.copy_back) {
549 + int need_copy_len = cpg->p.crypt_len;
550 + int sram_offset = 0;
554 + if (!cpg->p.sg_dst_left) {
555 + ret = sg_miter_next(&cpg->p.dst_sg_it);
557 + cpg->p.sg_dst_left = cpg->p.dst_sg_it.length;
558 + cpg->p.dst_start = 0;
561 - if (!cpg->p.sg_dst_left) {
562 - ret = sg_miter_next(&cpg->p.dst_sg_it);
564 - cpg->p.sg_dst_left = cpg->p.dst_sg_it.length;
565 - cpg->p.dst_start = 0;
567 + buf = cpg->p.dst_sg_it.addr;
568 + buf += cpg->p.dst_start;
570 - buf = cpg->p.dst_sg_it.addr;
571 - buf += cpg->p.dst_start;
572 + dst_copy = min(need_copy_len, cpg->p.sg_dst_left);
574 - dst_copy = min(need_copy_len, cpg->p.sg_dst_left);
576 + cpg->sram + SRAM_DATA_OUT_START + sram_offset,
578 + sram_offset += dst_copy;
579 + cpg->p.sg_dst_left -= dst_copy;
580 + need_copy_len -= dst_copy;
581 + cpg->p.dst_start += dst_copy;
582 + } while (need_copy_len > 0);
586 - cpg->sram + SRAM_DATA_OUT_START + sram_offset,
588 - sram_offset += dst_copy;
589 - cpg->p.sg_dst_left -= dst_copy;
590 - need_copy_len -= dst_copy;
591 - cpg->p.dst_start += dst_copy;
592 - } while (need_copy_len > 0);
594 BUG_ON(cpg->eng_st != ENGINE_W_DEQUEUE);
595 if (cpg->p.hw_processed_bytes < cpg->p.hw_nbytes) {
596 @@ -336,6 +340,7 @@ static void mv_enqueue_new_req(struct ablkcipher_request *req)
597 p->hw_nbytes = req->nbytes;
598 p->complete = mv_crypto_algo_completion;
599 p->process = mv_process_current_q;
602 num_sgs = count_sgs(req->src, req->nbytes);
603 sg_miter_start(&p->src_sg_it, req->src, num_sgs, SG_MITER_FROM_SG);
604 From 0c5c6c4bae8fe9ae3d86b44c332eb1267df1ec99 Mon Sep 17 00:00:00 2001
605 From: Uri Simchoni <uri@jdland.co.il>
606 Date: Thu, 8 Apr 2010 19:33:26 +0300
607 Subject: [PATCH] crypto: mv_cesa - Support processing of data from previous
610 Support processing of data from previous requests (as in hashing
611 update/final requests).
613 Signed-off-by: Uri Simchoni <uri@jdland.co.il>
614 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
616 drivers/crypto/mv_cesa.c | 8 +++++---
617 1 files changed, 5 insertions(+), 3 deletions(-)
619 diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
620 index 49a2206..d0fb10e 100644
621 --- a/drivers/crypto/mv_cesa.c
622 +++ b/drivers/crypto/mv_cesa.c
623 @@ -184,10 +184,11 @@ static void copy_src_to_buf(struct req_progress *p, char *dbuf, int len)
624 static void setup_data_in(void)
626 struct req_progress *p = &cpg->p;
629 min(p->hw_nbytes - p->hw_processed_bytes, cpg->max_req_size);
630 - copy_src_to_buf(p, cpg->sram + SRAM_DATA_IN_START,
632 + copy_src_to_buf(p, cpg->sram + SRAM_DATA_IN_START + p->crypt_len,
633 + data_in_sram - p->crypt_len);
634 + p->crypt_len = data_in_sram;
637 static void mv_process_current_q(int first_block)
638 @@ -298,6 +299,7 @@ static void dequeue_complete_req(void)
639 } while (need_copy_len > 0);
642 + cpg->p.crypt_len = 0;
644 BUG_ON(cpg->eng_st != ENGINE_W_DEQUEUE);
645 if (cpg->p.hw_processed_bytes < cpg->p.hw_nbytes) {