linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function
@ 2017-04-01 16:59 Haren Myneni
  2017-04-04 11:11 ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: Haren Myneni @ 2017-04-01 16:59 UTC (permalink / raw)
  To: herbert, mpe, ddstreet
  Cc: linuxppc-dev, linux-crypto, benh, mikey, suka, hbabu

[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 <haren@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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-05  3:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-01 16:59 [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function Haren Myneni
2017-04-04 11:11 ` Michael Ellerman
2017-04-05  3:32   ` Haren Myneni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).