diff options
-rw-r--r-- | drivers/crypto/nx/nx-842-powernv.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c index 3abb045cdba7..161987698bbc 100644 --- a/drivers/crypto/nx/nx-842-powernv.c +++ b/drivers/crypto/nx/nx-842-powernv.c | |||
@@ -54,7 +54,11 @@ struct nx842_coproc { | |||
54 | 54 | ||
55 | /* no cpu hotplug on powernv, so this list never changes after init */ | 55 | /* no cpu hotplug on powernv, so this list never changes after init */ |
56 | static LIST_HEAD(nx842_coprocs); | 56 | static LIST_HEAD(nx842_coprocs); |
57 | static unsigned int nx842_ct; | 57 | static unsigned int nx842_ct; /* used in icswx function */ |
58 | |||
59 | static int (*nx842_powernv_exec)(const unsigned char *in, | ||
60 | unsigned int inlen, unsigned char *out, | ||
61 | unsigned int *outlenp, void *workmem, int fc); | ||
58 | 62 | ||
59 | /** | 63 | /** |
60 | * setup_indirect_dde - Setup an indirect DDE | 64 | * setup_indirect_dde - Setup an indirect DDE |
@@ -355,7 +359,7 @@ static int wait_for_csb(struct nx842_workmem *wmem, | |||
355 | } | 359 | } |
356 | 360 | ||
357 | /** | 361 | /** |
358 | * nx842_powernv_function - compress/decompress data using the 842 algorithm | 362 | * nx842_exec_icswx - compress/decompress data using the 842 algorithm |
359 | * | 363 | * |
360 | * (De)compression provided by the NX842 coprocessor on IBM PowerNV systems. | 364 | * (De)compression provided by the NX842 coprocessor on IBM PowerNV systems. |
361 | * This compresses or decompresses the provided input buffer into the provided | 365 | * This compresses or decompresses the provided input buffer into the provided |
@@ -385,7 +389,7 @@ static int wait_for_csb(struct nx842_workmem *wmem, | |||
385 | * -ETIMEDOUT hardware did not complete operation in reasonable time | 389 | * -ETIMEDOUT hardware did not complete operation in reasonable time |
386 | * -EINTR operation was aborted | 390 | * -EINTR operation was aborted |
387 | */ | 391 | */ |
388 | static int nx842_powernv_function(const unsigned char *in, unsigned int inlen, | 392 | static int nx842_exec_icswx(const unsigned char *in, unsigned int inlen, |
389 | unsigned char *out, unsigned int *outlenp, | 393 | unsigned char *out, unsigned int *outlenp, |
390 | void *workmem, int fc) | 394 | void *workmem, int fc) |
391 | { | 395 | { |
@@ -489,13 +493,13 @@ static int nx842_powernv_function(const unsigned char *in, unsigned int inlen, | |||
489 | * @workmem: working memory buffer pointer, size determined by | 493 | * @workmem: working memory buffer pointer, size determined by |
490 | * nx842_powernv_driver.workmem_size | 494 | * nx842_powernv_driver.workmem_size |
491 | * | 495 | * |
492 | * Returns: see @nx842_powernv_function() | 496 | * Returns: see @nx842_powernv_exec() |
493 | */ | 497 | */ |
494 | static int nx842_powernv_compress(const unsigned char *in, unsigned int inlen, | 498 | static int nx842_powernv_compress(const unsigned char *in, unsigned int inlen, |
495 | unsigned char *out, unsigned int *outlenp, | 499 | unsigned char *out, unsigned int *outlenp, |
496 | void *wmem) | 500 | void *wmem) |
497 | { | 501 | { |
498 | return nx842_powernv_function(in, inlen, out, outlenp, | 502 | return nx842_powernv_exec(in, inlen, out, outlenp, |
499 | wmem, CCW_FC_842_COMP_CRC); | 503 | wmem, CCW_FC_842_COMP_CRC); |
500 | } | 504 | } |
501 | 505 | ||
@@ -517,13 +521,13 @@ static int nx842_powernv_compress(const unsigned char *in, unsigned int inlen, | |||
517 | * @workmem: working memory buffer pointer, size determined by | 521 | * @workmem: working memory buffer pointer, size determined by |
518 | * nx842_powernv_driver.workmem_size | 522 | * nx842_powernv_driver.workmem_size |
519 | * | 523 | * |
520 | * Returns: see @nx842_powernv_function() | 524 | * Returns: see @nx842_powernv_exec() |
521 | */ | 525 | */ |
522 | static int nx842_powernv_decompress(const unsigned char *in, unsigned int inlen, | 526 | static int nx842_powernv_decompress(const unsigned char *in, unsigned int inlen, |
523 | unsigned char *out, unsigned int *outlenp, | 527 | unsigned char *out, unsigned int *outlenp, |
524 | void *wmem) | 528 | void *wmem) |
525 | { | 529 | { |
526 | return nx842_powernv_function(in, inlen, out, outlenp, | 530 | return nx842_powernv_exec(in, inlen, out, outlenp, |
527 | wmem, CCW_FC_842_DECOMP_CRC); | 531 | wmem, CCW_FC_842_DECOMP_CRC); |
528 | } | 532 | } |
529 | 533 | ||
@@ -625,6 +629,8 @@ static __init int nx842_powernv_init(void) | |||
625 | if (!nx842_ct) | 629 | if (!nx842_ct) |
626 | return -ENODEV; | 630 | return -ENODEV; |
627 | 631 | ||
632 | nx842_powernv_exec = nx842_exec_icswx; | ||
633 | |||
628 | ret = crypto_register_alg(&nx842_powernv_alg); | 634 | ret = crypto_register_alg(&nx842_powernv_alg); |
629 | if (ret) { | 635 | if (ret) { |
630 | struct nx842_coproc *coproc, *n; | 636 | struct nx842_coproc *coproc, *n; |