Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/opencrypto make the compatibility code conditional on CO...



details:   https://anonhg.NetBSD.org/src/rev/65ca3dad8ced
branches:  trunk
changeset: 762333:65ca3dad8ced
user:      drochner <drochner%NetBSD.org@localhost>
date:      Sat Feb 19 16:26:34 2011 +0000

description:
make the compatibility code conditional on COMPAT_50

diffstat:

 sys/opencrypto/cryptodev.c          |  13 ++++++++++---
 sys/opencrypto/cryptodev_internal.h |  10 ++++++++++
 sys/opencrypto/files.opencrypto     |   4 ++--
 sys/opencrypto/ocryptodev.c         |   5 +++--
 sys/opencrypto/ocryptodev.h         |  11 +----------
 5 files changed, 26 insertions(+), 17 deletions(-)

diffs (139 lines):

diff -r 83601512c9eb -r 65ca3dad8ced sys/opencrypto/cryptodev.c
--- a/sys/opencrypto/cryptodev.c        Sat Feb 19 14:28:07 2011 +0000
+++ b/sys/opencrypto/cryptodev.c        Sat Feb 19 16:26:34 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cryptodev.c,v 1.54 2011/02/18 19:56:01 drochner Exp $ */
+/*     $NetBSD: cryptodev.c,v 1.55 2011/02/19 16:26:34 drochner 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.54 2011/02/18 19:56:01 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.55 2011/02/19 16:26:34 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -87,8 +87,9 @@
 #include <sys/stat.h>
 
 #include "opt_ocf.h"
+#include "opt_compat_netbsd.h"
 #include <opencrypto/cryptodev.h>
-#include <opencrypto/ocryptodev.h>
+#include <opencrypto/cryptodev_internal.h>
 #include <opencrypto/xform.h>
 
 struct csession {
@@ -184,7 +185,9 @@
     int);
 static int     cryptodev_getstatus(struct fcrypt *, struct crypt_result *);
 
+#ifdef COMPAT_50
 extern int     ocryptof_ioctl(struct file *, u_long, void *);
+#endif
 
 /*
  * sysctl-able control variables for /dev/crypto now defined in crypto.c:
@@ -399,8 +402,12 @@
                error = cryptodev_getstatus(fcr, (struct crypt_result *)data); 
                break;
        default:
+#ifdef COMPAT_50
                /* Check for backward compatible commands */
                error = ocryptof_ioctl(fp, cmd, data);
+#else
+               return EINVAL;
+#endif
        }
        return error;
 }
diff -r 83601512c9eb -r 65ca3dad8ced sys/opencrypto/cryptodev_internal.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/opencrypto/cryptodev_internal.h       Sat Feb 19 16:26:34 2011 +0000
@@ -0,0 +1,10 @@
+/* $NetBSD: cryptodev_internal.h,v 1.1 2011/02/19 16:26:34 drochner Exp $ */
+
+/* exported to compat code, not for consumers */
+
+struct csession;
+int cryptodev_op(struct csession *, struct crypt_op *, struct lwp *);
+int cryptodev_mop(struct fcrypt *, struct crypt_n_op *, int, struct lwp *);
+int cryptodev_session(struct fcrypt *, struct session_op *);
+int cryptodev_msession(struct fcrypt *, struct session_n_op *, int);
+struct csession *cryptodev_csefind(struct fcrypt *fcr, u_int ses);
diff -r 83601512c9eb -r 65ca3dad8ced sys/opencrypto/files.opencrypto
--- a/sys/opencrypto/files.opencrypto   Sat Feb 19 14:28:07 2011 +0000
+++ b/sys/opencrypto/files.opencrypto   Sat Feb 19 16:26:34 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.opencrypto,v 1.20 2009/03/25 01:26:13 darran Exp $
+#      $NetBSD: files.opencrypto,v 1.21 2011/02/19 16:26:34 drochner Exp $
 #
 #
 
@@ -23,6 +23,6 @@
 # (and thus crypto hardware accelerators).
 defpseudo crypto: opencrypto
 file   opencrypto/cryptodev.c          crypto
-file   opencrypto/ocryptodev.c         crypto
+file   opencrypto/ocryptodev.c         crypto & compat_50
 
 defflag opt_ocf.h      CRYPTO_DEBUG CRYPTO_TIMING
diff -r 83601512c9eb -r 65ca3dad8ced sys/opencrypto/ocryptodev.c
--- a/sys/opencrypto/ocryptodev.c       Sat Feb 19 14:28:07 2011 +0000
+++ b/sys/opencrypto/ocryptodev.c       Sat Feb 19 16:26:34 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ocryptodev.c,v 1.2 2009/03/26 01:52:24 mrg Exp $ */
+/*     $NetBSD: ocryptodev.c,v 1.3 2011/02/19 16:26:34 drochner 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.2 2009/03/26 01:52:24 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ocryptodev.c,v 1.3 2011/02/19 16:26:34 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -92,6 +92,7 @@
 
 #include "opt_ocf.h"
 #include <opencrypto/cryptodev.h>
+#include <opencrypto/cryptodev_internal.h>
 #include <opencrypto/ocryptodev.h>
 #include <opencrypto/xform.h>
 
diff -r 83601512c9eb -r 65ca3dad8ced sys/opencrypto/ocryptodev.h
--- a/sys/opencrypto/ocryptodev.h       Sat Feb 19 14:28:07 2011 +0000
+++ b/sys/opencrypto/ocryptodev.h       Sat Feb 19 16:26:34 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ocryptodev.h,v 1.1 2009/03/25 01:26:13 darran Exp $ */
+/*     $NetBSD: ocryptodev.h,v 1.2 2011/02/19 16:26:34 drochner Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/cryptodev.h,v 1.2.2.6 2003/07/02 17:04:50 sam Exp $        */
 /*     $OpenBSD: cryptodev.h,v 1.33 2002/07/17 23:52:39 art Exp $      */
 
@@ -163,20 +163,11 @@
        struct ocrypt_n_op *    reqs;   /* where to get them */
 };
 
-struct csession;
-struct fcrypt;
-
 #define        OCIOCGSESSION   _IOWR('c', 101, struct osession_op)
 #define        OCIOCNGSESSION  _IOWR('c', 106, struct ocrypt_sgop)
 #define OCIOCCRYPT     _IOWR('c', 103, struct ocrypt_op)
 #define OCIOCNCRYPTM   _IOWR('c', 107, struct ocrypt_mop)
 
-int cryptodev_op(struct csession *, struct crypt_op *, struct lwp *);
-int cryptodev_mop(struct fcrypt *, struct crypt_n_op *, int, struct lwp *);
-int cryptodev_session(struct fcrypt *, struct session_op *);
-int cryptodev_msession(struct fcrypt *, struct session_n_op *, int);
-struct csession *cryptodev_csefind(struct fcrypt *fcr, u_int ses);
-
 int ocryptof_ioctl(struct file *, u_long, void *);
 
 #endif /* _CRYPTO_OCRYPTODEV_H_ */



Home | Main Index | Thread Index | Old Index