diff options
author | pjd <pjd@FreeBSD.org> | 2006-06-04 22:15:13 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-06-04 22:15:13 +0000 |
commit | f055dbf32be7adc2e1a1c946748849d8bc8817cb (patch) | |
tree | eb23ce333a8decabbd11461c164ab6b666abb472 /sys/opencrypto/cryptodev.h | |
parent | 60fac157ecabb2906c29d54573d37a633a91fb32 (diff) | |
download | FreeBSD-src-f055dbf32be7adc2e1a1c946748849d8bc8817cb.zip FreeBSD-src-f055dbf32be7adc2e1a1c946748849d8bc8817cb.tar.gz |
- Replace COPYDATA() and COPYBACK() macros with crypto_copydata() and
crypto_copyback() functions.
- Add crypto_apply() function.
This will allow for more code simplification.
Diffstat (limited to 'sys/opencrypto/cryptodev.h')
-rw-r--r-- | sys/opencrypto/cryptodev.h | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h index f106ef5..9c06187 100644 --- a/sys/opencrypto/cryptodev.h +++ b/sys/opencrypto/cryptodev.h @@ -413,32 +413,12 @@ extern void cuio_copyback(struct uio* uio, int off, int len, caddr_t cp); extern struct iovec *cuio_getptr(struct uio *uio, int loc, int *off); extern int cuio_apply(struct uio *uio, int off, int len, int (*f)(void *, void *, u_int), void *arg); -struct mbuf; -#define COPYBACK(type, buf, off, size, in) do { \ - switch (type) { \ - case CRYPTO_BUF_CONTIG: \ - bcopy(in, (u_char *)(buf) + (off), size); \ - break; \ - case CRYPTO_BUF_MBUF: \ - m_copyback((struct mbuf *)(buf), off, size, in); \ - break; \ - case CRYPTO_BUF_IOV: \ - cuio_copyback((struct uio *)(buf), off, size, in); \ - break; \ - } \ -} while (0) -#define COPYDATA(type, buf, off, size, out) do { \ - switch (type) { \ - case CRYPTO_BUF_CONTIG: \ - bcopy((u_char *)(buf) + (off), out, size); \ - break; \ - case CRYPTO_BUF_MBUF: \ - m_copydata((struct mbuf *)(buf), off, size, out); \ - break; \ - case CRYPTO_BUF_IOV: \ - cuio_copydata((struct uio *)(buf), off, size, out); \ - break; \ - } \ -} while (0) + +extern void crypto_copyback(int flags, caddr_t buf, int off, int size, + caddr_t in); +extern void crypto_copydata(int flags, caddr_t buf, int off, int size, + caddr_t out); +extern int crypto_apply(int flags, caddr_t buf, int off, int len, + int (*f)(void *, void *, u_int), void *arg); #endif /* _KERNEL */ #endif /* _CRYPTO_CRYPTO_H_ */ |