Module Name: src
Committed By: knakahara
Date: Fri Jun 2 09:46:57 UTC 2017
Modified Files:
src/sys/opencrypto: cryptodev.c cryptodev_internal.h ocryptodev.c
Log Message:
rename crypto_mtx to cryptodev_mtx
It is used by cryptodev.c and ocryptodev.c only.
To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/opencrypto/cryptodev.c
cvs rdiff -u -r1.2 -r1.3 src/sys/opencrypto/cryptodev_internal.h
cvs rdiff -u -r1.7 -r1.8 src/sys/opencrypto/ocryptodev.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/opencrypto/cryptodev.c
diff -u src/sys/opencrypto/cryptodev.c:1.91 src/sys/opencrypto/cryptodev.c:1.92
--- src/sys/opencrypto/cryptodev.c:1.91 Thu May 25 05:24:57 2017
+++ src/sys/opencrypto/cryptodev.c Fri Jun 2 09:46:57 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: cryptodev.c,v 1.91 2017/05/25 05:24:57 knakahara Exp $ */
+/* $NetBSD: cryptodev.c,v 1.92 2017/06/02 09:46:57 knakahara Exp $ */
/* $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $ */
/* $OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $ */
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.91 2017/05/25 05:24:57 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.92 2017/06/02 09:46:57 knakahara Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -98,7 +98,7 @@ __KERNEL_RCSID(0, "$NetBSD: cryptodev.c,
#include "ioconf.h"
-kmutex_t crypto_mtx;
+kmutex_t cryptodev_mtx;
struct csession {
TAILQ_ENTRY(csession) next;
@@ -247,16 +247,16 @@ cryptof_ioctl(struct file *fp, u_long cm
struct fcrypt *criofcr;
int criofd;
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
getnanotime(&fcr->atime);
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
switch (cmd) {
case CRIOGET: /* XXX deprecated, remove after 5.0 */
if ((error = fd_allocfile(&criofp, &criofd)) != 0)
return error;
criofcr = pool_get(&fcrpl, PR_WAITOK);
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
TAILQ_INIT(&criofcr->csessions);
TAILQ_INIT(&criofcr->crp_ret_mq);
TAILQ_INIT(&criofcr->crp_ret_mkq);
@@ -269,7 +269,7 @@ cryptof_ioctl(struct file *fp, u_long cm
criofcr->sesn = 1;
criofcr->requestid = 1;
crypto_refcount++;
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
(void)fd_clone(criofp, criofd, (FREAD|FWRITE),
&cryptofops, criofcr);
*(u_int32_t *)data = criofd;
@@ -289,9 +289,9 @@ cryptof_ioctl(struct file *fp, u_long cm
goto mbail;
}
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
fcr->mtime = fcr->atime;
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
error = cryptodev_msession(fcr, snop, sgop->count);
if (error) {
goto mbail;
@@ -303,22 +303,22 @@ mbail:
kmem_free(snop, sgop->count * sizeof(struct session_n_op));
break;
case CIOCFSESSION:
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
fcr->mtime = fcr->atime;
ses = *(u_int32_t *)data;
cse = csefind(fcr, ses);
if (cse == NULL) {
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
return EINVAL;
}
csedelete(fcr, cse);
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
error = csefree(cse);
break;
case CIOCNFSESSION:
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
fcr->mtime = fcr->atime;
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
sfop = (struct crypt_sfop *)data;
sesid = kmem_alloc((sfop->count * sizeof(u_int32_t)),
KM_SLEEP);
@@ -330,11 +330,11 @@ mbail:
kmem_free(sesid, (sfop->count * sizeof(u_int32_t)));
break;
case CIOCCRYPT:
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
fcr->mtime = fcr->atime;
cop = (struct crypt_op *)data;
cse = csefind(fcr, cop->ses);
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
if (cse == NULL) {
DPRINTF("csefind failed\n");
return EINVAL;
@@ -343,9 +343,9 @@ mbail:
DPRINTF("cryptodev_op error = %d\n", error);
break;
case CIOCNCRYPTM:
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
fcr->mtime = fcr->atime;
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
mop = (struct crypt_mop *)data;
cnop = kmem_alloc((mop->count * sizeof(struct crypt_n_op)),
KM_SLEEP);
@@ -365,9 +365,9 @@ mbail:
DPRINTF("cryptodev_key error = %d\n", error);
break;
case CIOCNFKEYM:
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
fcr->mtime = fcr->atime;
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
mkop = (struct crypt_mkop *)data;
knop = kmem_alloc((mkop->count * sizeof(struct crypt_n_kop)),
KM_SLEEP);
@@ -385,9 +385,9 @@ mbail:
error = crypto_getfeat((int *)data);
break;
case CIOCNCRYPTRETM:
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
fcr->mtime = fcr->atime;
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
crypt_ret = (struct cryptret *)data;
count = crypt_ret->count;
crypt_res = kmem_alloc((count * sizeof(struct crypt_result)),
@@ -632,7 +632,7 @@ cryptodev_op(struct csession *cse, struc
* XXX splcrypto() but needed to only if CRYPTO_F_CBIMM,
* XXX disabled on NetBSD since 1.6O due to a race condition.
* XXX But crypto_dispatch went to splcrypto() itself! (And
- * XXX now takes the crypto_mtx mutex itself). We do, however,
+ * XXX now takes the cryptodev_mtx mutex itself). We do, however,
* XXX need to hold the mutex across the call to cv_wait().
* XXX (should we arrange for crypto_dispatch to return to
* XXX us with it held? it seems quite ugly to do so.)
@@ -641,7 +641,7 @@ cryptodev_op(struct csession *cse, struc
eagain:
#endif
error = crypto_dispatch(crp);
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
/*
* Don't touch crp before returned by any error or recieved
@@ -651,7 +651,7 @@ eagain:
switch (error) {
#ifdef notyet /* don't loop forever -- but EAGAIN not possible here yet */
case EAGAIN:
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
goto eagain;
break;
#endif
@@ -659,7 +659,7 @@ eagain:
break;
default:
DPRINTF("not waiting, error.\n");
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
cv_destroy(&crp->crp_cv);
goto bail;
}
@@ -667,9 +667,9 @@ eagain:
while (!(crp->crp_flags & CRYPTO_F_DQRETQ)) {
DPRINTF("cse->sid[%d]: sleeping on cv %p for crp %p\n",
(uint32_t)cse->sid, &crp->crp_cv, crp);
- cv_wait(&crp->crp_cv, &crypto_mtx); /* XXX cv_wait_sig? */
+ cv_wait(&crp->crp_cv, &cryptodev_mtx); /* XXX cv_wait_sig? */
}
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
cv_destroy(&crp->crp_cv);
if (crp->crp_etype != 0) {
@@ -729,19 +729,19 @@ cryptodev_cb(void *op)
struct csession *cse = (struct csession *)crp->crp_opaque;
int error = 0;
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
cse->error = crp->crp_etype;
if (crp->crp_etype == EAGAIN) {
/* always drop mutex to call dispatch routine */
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
error = crypto_dispatch(crp);
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
}
if (error != 0 || (crp->crp_flags & CRYPTO_F_DONE)) {
crp->crp_flags |= CRYPTO_F_DQRETQ;
cv_signal(&crp->crp_cv);
}
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
return 0;
}
@@ -752,12 +752,12 @@ cryptodev_mcb(void *op)
struct csession *cse = (struct csession *)crp->crp_opaque;
int error=0;
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
cse->error = crp->crp_etype;
if (crp->crp_etype == EAGAIN) {
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
error = crypto_dispatch(crp);
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
}
if (error != 0 || (crp->crp_flags & CRYPTO_F_DONE)) {
cv_signal(&crp->crp_cv);
@@ -765,7 +765,7 @@ cryptodev_mcb(void *op)
TAILQ_INSERT_TAIL(&crp->fcrp->crp_ret_mq, crp, crp_next);
selnotify(&crp->fcrp->sinfo, 0, 0);
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
return 0;
}
@@ -774,10 +774,10 @@ cryptodevkey_cb(void *op)
{
struct cryptkop *krp = op;
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
krp->krp_flags |= CRYPTO_F_DQRETQ;
cv_signal(&krp->krp_cv);
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
return 0;
}
@@ -786,11 +786,11 @@ cryptodevkey_mcb(void *op)
{
struct cryptkop *krp = op;
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
cv_signal(&krp->krp_cv);
TAILQ_INSERT_TAIL(&krp->fcrp->crp_ret_mkq, krp, krp_next);
selnotify(&krp->fcrp->sinfo, 0, 0);
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
return 0;
}
@@ -889,11 +889,11 @@ cryptodev_key(struct crypt_kop *kop)
goto fail;
}
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
while (!(krp->krp_flags & CRYPTO_F_DQRETQ)) {
- cv_wait(&krp->krp_cv, &crypto_mtx); /* XXX cv_wait_sig? */
+ cv_wait(&krp->krp_cv, &cryptodev_mtx); /* XXX cv_wait_sig? */
}
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
if (krp->krp_status != 0) {
DPRINTF("krp->krp_status 0x%08x\n", krp->krp_status);
@@ -939,17 +939,17 @@ cryptof_close(struct file *fp)
struct fcrypt *fcr = fp->f_fcrypt;
struct csession *cse;
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
while ((cse = TAILQ_FIRST(&fcr->csessions))) {
TAILQ_REMOVE(&fcr->csessions, cse, next);
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
(void)csefree(cse);
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
}
seldestroy(&fcr->sinfo);
fp->f_fcrypt = NULL;
crypto_refcount--;
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
pool_put(&fcrpl, fcr);
return 0;
@@ -961,13 +961,13 @@ struct csession *cryptodev_csefind(struc
return csefind(fcr, ses);
}
-/* csefind: call with crypto_mtx held. */
+/* csefind: call with cryptodev_mtx held. */
static struct csession *
csefind(struct fcrypt *fcr, u_int ses)
{
struct csession *cse, *cnext, *ret = NULL;
- KASSERT(mutex_owned(&crypto_mtx));
+ KASSERT(mutex_owned(&cryptodev_mtx));
TAILQ_FOREACH_SAFE(cse, &fcr->csessions, next, cnext)
if (cse->ses == ses)
ret = cse;
@@ -975,14 +975,14 @@ csefind(struct fcrypt *fcr, u_int ses)
return ret;
}
-/* csedelete: call with crypto_mtx held. */
+/* csedelete: call with cryptodev_mtx held. */
static int
csedelete(struct fcrypt *fcr, struct csession *cse_del)
{
struct csession *cse, *cnext;
int ret = 0;
- KASSERT(mutex_owned(&crypto_mtx));
+ KASSERT(mutex_owned(&cryptodev_mtx));
TAILQ_FOREACH_SAFE(cse, &fcr->csessions, next, cnext) {
if (cse == cse_del) {
TAILQ_REMOVE(&fcr->csessions, cse, next);
@@ -995,12 +995,12 @@ csedelete(struct fcrypt *fcr, struct cse
static struct csession *
cseadd(struct fcrypt *fcr, struct csession *cse)
{
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
/* don't let session ID wrap! */
if (fcr->sesn + 1 == 0) return NULL;
TAILQ_INSERT_TAIL(&fcr->csessions, cse, next);
cse->ses = fcr->sesn++;
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
return cse;
}
@@ -1035,7 +1035,7 @@ csecreate(struct fcrypt *fcr, u_int64_t
}
}
-/* csefree: call with crypto_mtx held. */
+/* csefree: call with cryptodev_mtx held. */
static int
csefree(struct csession *cse)
{
@@ -1067,7 +1067,7 @@ cryptoopen(dev_t dev, int flag, int mode
fcr = pool_get(&fcrpl, PR_WAITOK);
getnanotime(&fcr->btime);
fcr->atime = fcr->mtime = fcr->btime;
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
TAILQ_INIT(&fcr->csessions);
TAILQ_INIT(&fcr->crp_ret_mq);
TAILQ_INIT(&fcr->crp_ret_mkq);
@@ -1079,7 +1079,7 @@ cryptoopen(dev_t dev, int flag, int mode
fcr->sesn = 1;
fcr->requestid = 1;
crypto_refcount++;
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
return fd_clone(fp, fd, flag, &cryptofops, fcr);
}
@@ -1130,15 +1130,15 @@ cryptodev_mop(struct fcrypt *fcr,
int iov_len;
for (req = 0; req < count; req++) {
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
cse = csefind(fcr, cnop[req].ses);
if (cse == NULL) {
DPRINTF("csefind failed\n");
cnop[req].status = EINVAL;
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
continue;
}
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
if (cnop[req].len > 256*1024-4) {
DPRINTF("length failed\n");
@@ -1330,12 +1330,12 @@ cryptodev_mop(struct fcrypt *fcr,
eagain:
#endif
cnop[req].status = crypto_dispatch(crp);
- mutex_enter(&crypto_mtx); /* XXX why mutex? */
+ mutex_enter(&cryptodev_mtx); /* XXX why mutex? */
switch (cnop[req].status) {
#ifdef notyet /* don't loop forever -- but EAGAIN not possible here yet */
case EAGAIN:
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
goto eagain;
break;
#endif
@@ -1343,12 +1343,12 @@ eagain:
break;
default:
DPRINTF("not waiting, error.\n");
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
cv_destroy(&crp->crp_cv);
goto bail;
}
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
cv_destroy(&crp->crp_cv);
bail:
if (cnop[req].status) {
@@ -1763,17 +1763,17 @@ cryptodev_msessionfin(struct fcrypt *fcr
struct csession *cse;
int req, error = 0;
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
for(req = 0; req < count; req++) {
cse = csefind(fcr, sesid[req]);
if (cse == NULL)
continue;
csedelete(fcr, cse);
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
error = csefree(cse);
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
}
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
return error;
}
@@ -1805,7 +1805,7 @@ cryptodev_getmstatus(struct fcrypt *fcr,
* if 3 then 2 symmetric and 1 asymmetric and so on */
/* pull off a list of requests while protected from changes */
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
while (req < count) {
crp = TAILQ_FIRST(&fcr->crp_ret_mq);
if (crp) {
@@ -1833,7 +1833,7 @@ cryptodev_getmstatus(struct fcrypt *fcr,
}
}
}
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
/* now do all the work outside the mutex */
for(req=0; req < count ;) {
@@ -1937,7 +1937,7 @@ cryptodev_getstatus (struct fcrypt *fcr,
struct csession *cse;
int i, size, req = 0;
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
/* Here we dont know for which request the user is requesting the
* response so checking in both the queues */
TAILQ_FOREACH_SAFE(crp, &fcr->crp_ret_mq, crp_next, cnext) {
@@ -1973,7 +1973,7 @@ cryptodev_getstatus (struct fcrypt *fcr,
bail:
TAILQ_REMOVE(&fcr->crp_ret_mq, crp, crp_next);
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
crypto_freereq(crp);
return 0;
}
@@ -2007,7 +2007,7 @@ bail:
}
fail:
TAILQ_REMOVE(&fcr->crp_ret_mkq, krp, krp_next);
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
/* not sure what to do for this */
/* kop[req].crk_status = krp->krp_status; */
for (i = 0; i < CRK_MAXPARAM; i++) {
@@ -2024,7 +2024,7 @@ fail:
return 0;
}
}
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
return EINPROGRESS;
}
@@ -2035,14 +2035,14 @@ cryptof_stat(struct file *fp, struct sta
(void)memset(st, 0, sizeof(*st));
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
st->st_dev = makedev(cdevsw_lookup_major(&crypto_cdevsw), fcr->sesn);
st->st_atimespec = fcr->atime;
st->st_mtimespec = fcr->mtime;
st->st_ctimespec = st->st_birthtimespec = fcr->btime;
st->st_uid = kauth_cred_geteuid(fp->f_cred);
st->st_gid = kauth_cred_getegid(fp->f_cred);
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
return 0;
}
@@ -2058,7 +2058,7 @@ cryptof_poll(struct file *fp, int events
return 0;
}
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
if (TAILQ_EMPTY(&fcr->crp_ret_mq) && TAILQ_EMPTY(&fcr->crp_ret_mkq)) {
/* no completed requests pending, save the poll for later */
selrecord(curlwp, &fcr->sinfo);
@@ -2066,7 +2066,7 @@ cryptof_poll(struct file *fp, int events
/* let the app(s) know that there are completed requests */
revents = events & (POLLIN | POLLRDNORM);
}
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
return revents;
}
@@ -2079,7 +2079,7 @@ cryptoattach(int num)
{
crypto_init();
- mutex_init(&crypto_mtx, MUTEX_DEFAULT, IPL_NONE);
+ mutex_init(&cryptodev_mtx, MUTEX_DEFAULT, IPL_NONE);
pool_init(&fcrpl, sizeof(struct fcrypt), 0, 0, 0, "fcrpl",
NULL, IPL_NET); /* XXX IPL_NET ("splcrypto") */
@@ -2115,7 +2115,7 @@ crypto_detach(device_t self, int num)
pool_destroy(&fcrpl);
pool_destroy(&csepl);
- mutex_destroy(&crypto_mtx);
+ mutex_destroy(&cryptodev_mtx);
return 0;
}
Index: src/sys/opencrypto/cryptodev_internal.h
diff -u src/sys/opencrypto/cryptodev_internal.h:1.2 src/sys/opencrypto/cryptodev_internal.h:1.3
--- src/sys/opencrypto/cryptodev_internal.h:1.2 Mon Apr 24 03:29:37 2017
+++ src/sys/opencrypto/cryptodev_internal.h Fri Jun 2 09:46:57 2017
@@ -1,8 +1,8 @@
-/* $NetBSD: cryptodev_internal.h,v 1.2 2017/04/24 03:29:37 knakahara Exp $ */
+/* $NetBSD: cryptodev_internal.h,v 1.3 2017/06/02 09:46:57 knakahara Exp $ */
/* exported to compat code, not for consumers */
-extern kmutex_t crypto_mtx;
+extern kmutex_t cryptodev_mtx;
struct csession;
int cryptodev_op(struct csession *, struct crypt_op *, struct lwp *);
Index: src/sys/opencrypto/ocryptodev.c
diff -u src/sys/opencrypto/ocryptodev.c:1.7 src/sys/opencrypto/ocryptodev.c:1.8
--- src/sys/opencrypto/ocryptodev.c:1.7 Wed May 17 06:33:04 2017
+++ src/sys/opencrypto/ocryptodev.c Fri Jun 2 09:46:57 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ocryptodev.c,v 1.7 2017/05/17 06:33:04 knakahara Exp $ */
+/* $NetBSD: ocryptodev.c,v 1.8 2017/06/02 09:46:57 knakahara Exp $ */
/* $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $ */
/* $OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $ */
@@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ocryptodev.c,v 1.7 2017/05/17 06:33:04 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ocryptodev.c,v 1.8 2017/06/02 09:46:57 knakahara Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -146,10 +146,10 @@ mbail:
kmem_free(osnop, osgop->count * sizeof(struct osession_n_op));
break;
case OCIOCCRYPT:
- mutex_enter(&crypto_mtx);
+ mutex_enter(&cryptodev_mtx);
ocop = (struct ocrypt_op *)data;
cse = cryptodev_csefind(fcr, ocop->ses);
- mutex_exit(&crypto_mtx);
+ mutex_exit(&cryptodev_mtx);
if (cse == NULL) {
DPRINTF("csefind failed\n");
return EINVAL;