diff options
author | Giovanni Cabiddu <giovanni.cabiddu@intel.com> | 2016-10-21 08:19:47 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-10-24 23:08:30 -0400 |
commit | 2ebda74fd6c9d3fc3b9f0234fc519795e23025a5 (patch) | |
tree | fa44f5f8efdcf0a69b9a91673753a36067ecc9f5 /crypto/crypto_user.c | |
parent | c8d283ff8b0b6b2061dfc137afd6c56608a34bcb (diff) |
crypto: acomp - add asynchronous compression api
Add acomp, an asynchronous compression api that uses scatterlist
buffers.
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/crypto_user.c')
-rw-r--r-- | crypto/crypto_user.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c index 1c5705481c69..a90404a0c5ff 100644 --- a/crypto/crypto_user.c +++ b/crypto/crypto_user.c | |||
@@ -112,6 +112,21 @@ nla_put_failure: | |||
112 | return -EMSGSIZE; | 112 | return -EMSGSIZE; |
113 | } | 113 | } |
114 | 114 | ||
115 | static int crypto_report_acomp(struct sk_buff *skb, struct crypto_alg *alg) | ||
116 | { | ||
117 | struct crypto_report_acomp racomp; | ||
118 | |||
119 | strncpy(racomp.type, "acomp", sizeof(racomp.type)); | ||
120 | |||
121 | if (nla_put(skb, CRYPTOCFGA_REPORT_ACOMP, | ||
122 | sizeof(struct crypto_report_acomp), &racomp)) | ||
123 | goto nla_put_failure; | ||
124 | return 0; | ||
125 | |||
126 | nla_put_failure: | ||
127 | return -EMSGSIZE; | ||
128 | } | ||
129 | |||
115 | static int crypto_report_akcipher(struct sk_buff *skb, struct crypto_alg *alg) | 130 | static int crypto_report_akcipher(struct sk_buff *skb, struct crypto_alg *alg) |
116 | { | 131 | { |
117 | struct crypto_report_akcipher rakcipher; | 132 | struct crypto_report_akcipher rakcipher; |
@@ -186,7 +201,11 @@ static int crypto_report_one(struct crypto_alg *alg, | |||
186 | goto nla_put_failure; | 201 | goto nla_put_failure; |
187 | 202 | ||
188 | break; | 203 | break; |
204 | case CRYPTO_ALG_TYPE_ACOMPRESS: | ||
205 | if (crypto_report_acomp(skb, alg)) | ||
206 | goto nla_put_failure; | ||
189 | 207 | ||
208 | break; | ||
190 | case CRYPTO_ALG_TYPE_AKCIPHER: | 209 | case CRYPTO_ALG_TYPE_AKCIPHER: |
191 | if (crypto_report_akcipher(skb, alg)) | 210 | if (crypto_report_akcipher(skb, alg)) |
192 | goto nla_put_failure; | 211 | goto nla_put_failure; |