From: Haren Myneni <haren@linux.vnet.ibm.com>
To: herbert@gondor.apana.org.au, mpe@ellerman.id.au, ddstreet@ieee.org
Cc: linuxppc-dev@lists.ozlabs.org, linux-crypto@vger.kernel.org,
benh@kernel.crashing.org, mikey@neuling.org, suka@us.ibm.com,
hbabu@us.ibm.com
Subject: [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function
Date: Sat, 01 Apr 2017 09:59:01 -0700 [thread overview]
Message-ID: <1491065941.29552.26.camel@hbabu-laptop> (raw)
[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
next reply other threads:[~2017-04-01 16:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-01 16:59 Haren Myneni [this message]
2017-04-04 11:11 ` [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function Michael Ellerman
2017-04-05 3:32 ` Haren Myneni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1491065941.29552.26.camel@hbabu-laptop \
--to=haren@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=ddstreet@ieee.org \
--cc=hbabu@us.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
--cc=suka@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox