summaryrefslogtreecommitdiffstats
path: root/crypto/userspace/cryptodev_int.h
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-07-26 21:07:19 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-07-26 21:07:19 +0200
commit7cc28b8bafe112037edae18ea0e590e7c9d074fa (patch)
tree5836f1f9cdd22d731e986ea4f8ed73649bf7b6e4 /crypto/userspace/cryptodev_int.h
parentda3eeeff5744e8ea4bcdb819db3afad6437f5231 (diff)
parenta04fd1aa4f807e2f97632a46070306e1389264ed (diff)
downloadkernel-crypto-7cc28b8bafe112037edae18ea0e590e7c9d074fa.tar.gz
kernel-crypto-7cc28b8bafe112037edae18ea0e590e7c9d074fa.tar.xz
kernel-crypto-7cc28b8bafe112037edae18ea0e590e7c9d074fa.zip
Merge branch 'standalone-rename' into userspace-crypto
Conflicts: crypto/userspace/Makefile crypto/userspace/ncr-data.c crypto/userspace/ncr-key-storage.c crypto/userspace/ncr-key-wrap.c crypto/userspace/ncr-key.c crypto/userspace/ncr-limits.c crypto/userspace/ncr-pk.c crypto/userspace/ncr-sessions.c crypto/userspace/ncr.c
Diffstat (limited to 'crypto/userspace/cryptodev_int.h')
-rw-r--r--crypto/userspace/cryptodev_int.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/crypto/userspace/cryptodev_int.h b/crypto/userspace/cryptodev_int.h
index 59144d0aab0..4b63225d09e 100644
--- a/crypto/userspace/cryptodev_int.h
+++ b/crypto/userspace/cryptodev_int.h
@@ -24,6 +24,18 @@
extern int cryptodev_verbosity;
+/* For zero copy */
+int __get_userbuf(uint8_t *addr, uint32_t len, int write,
+ int pgcount, struct page **pg, struct scatterlist *sg);
+void release_user_pages(struct page **pg, int pagecount);
+
+/* last page - first page + 1 */
+#define PAGECOUNT(buf, buflen) \
+ ((((unsigned long)(buf + buflen - 1) & PAGE_MASK) >> PAGE_SHIFT) - \
+ (((unsigned long) buf & PAGE_MASK) >> PAGE_SHIFT) + 1)
+
+#define DEFAULT_PREALLOC_PAGES 32
+
struct cipher_data
{
int init; /* 0 uninitialized */
@@ -39,8 +51,8 @@ struct cipher_data
int cryptodev_cipher_init(struct cipher_data* out, const char* alg_name, uint8_t * key, size_t keylen);
void cryptodev_cipher_deinit(struct cipher_data* cdata);
-ssize_t cryptodev_cipher_decrypt( struct cipher_data* cdata, struct scatterlist *sg1, struct scatterlist *sg2, size_t len);
-ssize_t cryptodev_cipher_encrypt( struct cipher_data* cdata, struct scatterlist *sg1, struct scatterlist *sg2, size_t len);
+ssize_t cryptodev_cipher_decrypt( struct cipher_data* cdata, const struct scatterlist *sg1, struct scatterlist *sg2, size_t len);
+ssize_t cryptodev_cipher_encrypt( struct cipher_data* cdata, const struct scatterlist *sg1, struct scatterlist *sg2, size_t len);
void cryptodev_cipher_set_iv(struct cipher_data* cdata, void* iv, size_t iv_size);
int _cryptodev_cipher_decrypt(struct cipher_data* cdata, const void* ciphertext,