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
This commit is contained in:
John Baldwin 2020-05-25 23:49:46 +00:00
parent d79ff54b5c
commit b04748bef2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=361492
3 changed files with 18 additions and 18 deletions

View File

@ -295,12 +295,12 @@ cryptocteon_process(device_t dev, struct cryptop *crp, int hint)
* 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, int hint)
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, int hint)
/*
* 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, int hint)
}
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:

View File

@ -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);

View File

@ -110,12 +110,12 @@ nlm_crypto_form_srcdst_segs(struct xlp_sec_command *cmd,
}
}
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 *cmd,
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 *cmd,
}
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;
}