[PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function

nx842_powernv_function is points to nx842_icswx_function and
will be point to VAS function which will be added later for
P9 NX support.

Signed-off-by: Haren Myneni <ha...@us.ibm.com>
---
 drivers/crypto/nx/nx-842-powernv.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/nx/nx-842-powernv.c 
b/drivers/crypto/nx/nx-842-powernv.c
index 3abb045..125f1dc 100644
--- a/drivers/crypto/nx/nx-842-powernv.c
+++ b/drivers/crypto/nx/nx-842-powernv.c
@@ -47,14 +47,22 @@ struct nx842_workmem {
 
 struct nx842_coproc {
        unsigned int chip_id;
-       unsigned int ct;
-       unsigned int ci;
+       union {
+               struct {
+                       unsigned int ct;
+                       unsigned int ci;
+               } icswx;
+       };
        struct list_head list;
 };
 
 /* no cpu hotplug on powernv, so this list never changes after init */
 static LIST_HEAD(nx842_coprocs);
-static unsigned int nx842_ct;
+static unsigned int nx842_ct;  /* use with icswx function */
+
+static int (*nx842_powernv_function)(const unsigned char *in,
+                               unsigned int inlen, unsigned char *out,
+                               unsigned int *outlenp, void *workmem, int fc);
 
 /**
  * setup_indirect_dde - Setup an indirect DDE
@@ -355,7 +363,7 @@ static int wait_for_csb(struct nx842_workmem *wmem,
 }
 
 /**
- * nx842_powernv_function - compress/decompress data using the 842 algorithm
+ * nx842_icswx_function - compress/decompress data using the 842 algorithm
  *
  * (De)compression provided by the NX842 coprocessor on IBM PowerNV systems.
  * This compresses or decompresses the provided input buffer into the provided
@@ -385,7 +393,7 @@ static int wait_for_csb(struct nx842_workmem *wmem,
  *   -ETIMEDOUT        hardware did not complete operation in reasonable time
  *   -EINTR    operation was aborted
  */
-static int nx842_powernv_function(const unsigned char *in, unsigned int inlen,
+static int nx842_icswx_function(const unsigned char *in, unsigned int inlen,
                                  unsigned char *out, unsigned int *outlenp,
                                  void *workmem, int fc)
 {
@@ -554,8 +562,8 @@ static int __init nx842_powernv_probe(struct device_node 
*dn)
                return -ENOMEM;
 
        coproc->chip_id = chip_id;
-       coproc->ct = ct;
-       coproc->ci = ci;
+       coproc->icswx.ct = ct;
+       coproc->icswx.ci = ci;
        INIT_LIST_HEAD(&coproc->list);
        list_add(&coproc->list, &nx842_coprocs);
 
@@ -625,6 +633,8 @@ static __init int nx842_powernv_init(void)
        if (!nx842_ct)
                return -ENODEV;
 
+       nx842_powernv_function = nx842_icswx_function;
+
        ret = crypto_register_alg(&nx842_powernv_alg);
        if (ret) {
                struct nx842_coproc *coproc, *n;
-- 
1.8.3.1



Reply via email to