diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-07-24 13:43:43 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-07-24 18:38:58 +0200 |
commit | ffb3e747f8b50ca18701530d1729a4ee3aa4ae69 (patch) | |
tree | efa9b3552566ce2891c1c105cd9fd5f4c3baa269 /cryptodev_main.c | |
parent | 4b45720ea1dffc3514c81439c7f93928d05c5521 (diff) | |
download | cryptodev-linux-ffb3e747f8b50ca18701530d1729a4ee3aa4ae69.tar.gz cryptodev-linux-ffb3e747f8b50ca18701530d1729a4ee3aa4ae69.tar.xz cryptodev-linux-ffb3e747f8b50ca18701530d1729a4ee3aa4ae69.zip |
Added a support for reading session data directly from userspace.
Diffstat (limited to 'cryptodev_main.c')
-rw-r--r-- | cryptodev_main.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/cryptodev_main.c b/cryptodev_main.c index 0316a74..89b9a02 100644 --- a/cryptodev_main.c +++ b/cryptodev_main.c @@ -65,8 +65,6 @@ module_param(enable_stats, int, 0644); MODULE_PARM_DESC(enable_stats, "collect statictics about cryptodev usage"); #endif -#define DEFAULT_PREALLOC_PAGES 16 - /* ====== CryptoAPI ====== */ struct fcrypt { struct list_head list; @@ -495,7 +493,7 @@ __crypto_run_std(struct csession *ses_ptr, struct crypt_op *cop) #ifndef DISABLE_ZCOPY -static void release_user_pages(struct page **pg, int pagecount) +void release_user_pages(struct page **pg, int pagecount) { while (pagecount--) { if (!PageReserved(pg[pagecount])) @@ -504,16 +502,11 @@ static 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) - /* offset of buf in it's first page */ #define PAGEOFFSET(buf) ((unsigned long)buf & ~PAGE_MASK) /* fetch the pages addr resides in into pg and initialise sg with them */ -static int __get_userbuf(uint8_t *addr, uint32_t len, int write, +int __get_userbuf(uint8_t *addr, uint32_t len, int write, int pgcount, struct page **pg, struct scatterlist *sg) { int ret, pglen, i = 0; |