svn commit: r361492 - in head/sys/mips: cavium/cryptocteon nlm/dev/sec
John Baldwin
jhb at FreeBSD.org
Mon May 25 23:49:47 UTC 2020
Author: jhb
Date: Mon May 25 23:49:46 2020
New Revision: 361492
URL: https://svnweb.freebsd.org/changeset/base/361492
Log:
Update cryptocteon(4) and nlmsec(4) for changes in r361481.
This does not add support for separate output buffers but updates the
drivers to cope with the changes.
Pointy hat to: jhb
Modified:
head/sys/mips/cavium/cryptocteon/cryptocteon.c
head/sys/mips/nlm/dev/sec/nlmsec.c
head/sys/mips/nlm/dev/sec/nlmseclib.c
Modified: head/sys/mips/cavium/cryptocteon/cryptocteon.c
==============================================================================
--- head/sys/mips/cavium/cryptocteon/cryptocteon.c Mon May 25 23:47:31 2020 (r361491)
+++ head/sys/mips/cavium/cryptocteon/cryptocteon.c Mon May 25 23:49:46 2020 (r361492)
@@ -295,12 +295,12 @@ cryptocteon_process(device_t dev, struct cryptop *crp,
* do some error checking outside of the loop for m and IOV processing
* this leaves us with valid m or uiop pointers for later
*/
- switch (crp->crp_buf_type) {
+ switch (crp->crp_buf.cb_type) {
case CRYPTO_BUF_MBUF:
{
unsigned frags;
- m = crp->crp_mbuf;
+ m = crp->crp_buf.cb_mbuf;
for (frags = 0; m != NULL; frags++)
m = m->m_next;
@@ -310,11 +310,11 @@ cryptocteon_process(device_t dev, struct cryptop *crp,
goto done;
}
- m = crp->crp_mbuf;
+ m = crp->crp_buf.cb_mbuf;
break;
}
case CRYPTO_BUF_UIO:
- uiop = crp->crp_uio;
+ uiop = crp->crp_buf.cb_uio;
if (uiop->uio_iovcnt > UIO_MAXIOV) {
printf("%s,%d: %d uio_iovcnt > UIO_MAXIOV", __FILE__, __LINE__,
uiop->uio_iovcnt);
@@ -337,7 +337,7 @@ cryptocteon_process(device_t dev, struct cryptop *crp,
/*
* setup the I/O vector to cover the buffer
*/
- switch (crp->crp_buf_type) {
+ switch (crp->crp_buf.cb_type) {
case CRYPTO_BUF_MBUF:
iovcnt = 0;
iovlen = 0;
@@ -360,9 +360,9 @@ cryptocteon_process(device_t dev, struct cryptop *crp,
}
break;
case CRYPTO_BUF_CONTIG:
- iovlen = crp->crp_ilen;
- od->octo_iov[0].iov_base = crp->crp_buf;
- od->octo_iov[0].iov_len = crp->crp_ilen;
+ iovlen = crp->crp_buf.cb_buf_len;
+ od->octo_iov[0].iov_base = crp->crp_buf.cb_buf;
+ od->octo_iov[0].iov_len = crp->crp_buf.cb_buf_len;
iovcnt = 1;
break;
default:
Modified: head/sys/mips/nlm/dev/sec/nlmsec.c
==============================================================================
--- head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 25 23:47:31 2020 (r361491)
+++ head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 25 23:49:46 2020 (r361492)
@@ -466,12 +466,12 @@ static int
xlp_get_nsegs(struct cryptop *crp, unsigned int *nsegs)
{
- switch (crp->crp_buf_type) {
+ switch (crp->crp_buf.cb_type) {
case CRYPTO_BUF_MBUF:
{
struct mbuf *m = NULL;
- m = crp->crp_mbuf;
+ m = crp->crp_buf.cb_mbuf;
while (m != NULL) {
*nsegs += NLM_CRYPTO_NUM_SEGS_REQD(m->m_len);
m = m->m_next;
@@ -484,8 +484,8 @@ xlp_get_nsegs(struct cryptop *crp, unsigned int *nsegs
struct iovec *iov = NULL;
int iol = 0;
- uio = (struct uio *)crp->crp_buf;
- iov = (struct iovec *)uio->uio_iov;
+ uio = crp->crp_buf.cb_uio;
+ iov = uio->uio_iov;
iol = uio->uio_iovcnt;
while (iol > 0) {
*nsegs += NLM_CRYPTO_NUM_SEGS_REQD(iov->iov_len);
@@ -495,7 +495,7 @@ xlp_get_nsegs(struct cryptop *crp, unsigned int *nsegs
break;
}
case CRYPTO_BUF_CONTIG:
- *nsegs = NLM_CRYPTO_NUM_SEGS_REQD(crp->crp_ilen);
+ *nsegs = NLM_CRYPTO_NUM_SEGS_REQD(crp->crp_buf.cb_buf_len);
break;
default:
return (EINVAL);
Modified: head/sys/mips/nlm/dev/sec/nlmseclib.c
==============================================================================
--- head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 25 23:47:31 2020 (r361491)
+++ head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 25 23:49:46 2020 (r361492)
@@ -110,12 +110,12 @@ nlm_crypto_form_srcdst_segs(struct xlp_sec_command *cm
}
}
- switch (crp->crp_buf_type) {
+ switch (crp->crp_buf.cb_type) {
case CRYPTO_BUF_MBUF:
{
struct mbuf *m = NULL;
- m = crp->crp_mbuf;
+ m = crp->crp_buf.cb_mbuf;
while (m != NULL) {
srcseg = nlm_crypto_fill_src_seg(cmd->paramp, srcseg,
mtod(m,caddr_t), m->m_len);
@@ -133,7 +133,7 @@ nlm_crypto_form_srcdst_segs(struct xlp_sec_command *cm
struct iovec *iov = NULL;
int iol = 0;
- uio = crp->crp_uio;
+ uio = crp->crp_buf.cb_uio;
iov = uio->uio_iov;
iol = uio->uio_iovcnt;
@@ -151,10 +151,10 @@ nlm_crypto_form_srcdst_segs(struct xlp_sec_command *cm
}
case CRYPTO_BUF_CONTIG:
srcseg = nlm_crypto_fill_src_seg(cmd->paramp, srcseg,
- ((caddr_t)crp->crp_buf), crp->crp_ilen);
+ crp->crp_buf.cb_buf, crp->crp_buf.cb_buf_len);
if (csp->csp_mode != CSP_MODE_DIGEST) {
dstseg = nlm_crypto_fill_dst_seg(cmd->paramp, dstseg,
- ((caddr_t)crp->crp_buf), crp->crp_ilen);
+ crp->crp_buf.cb_buf, crp->crp_buf.cb_buf_len);
}
break;
}
More information about the svn-src-all
mailing list