diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-08-17 20:37:06 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-08-24 22:51:00 +0200 |
commit | 22482a34969ead83c1ead01cff483998ef5960d4 (patch) | |
tree | 98ffb864570cf04ba2660adcd13c2c999894a95b | |
parent | 9c0650117290c30b94e1c3513b67808fb5f7a143 (diff) | |
download | cryptodev-linux-22482a34969ead83c1ead01cff483998ef5960d4.tar.gz cryptodev-linux-22482a34969ead83c1ead01cff483998ef5960d4.tar.xz cryptodev-linux-22482a34969ead83c1ead01cff483998ef5960d4.zip |
Add compat_ioctl infrastructure
-rw-r--r-- | cryptodev_main.c | 5 | ||||
-rw-r--r-- | ncr-int.h | 2 | ||||
-rw-r--r-- | ncr.c | 15 |
3 files changed, 18 insertions, 4 deletions
diff --git a/cryptodev_main.c b/cryptodev_main.c index 0a20888..9c484f5 100644 --- a/cryptodev_main.c +++ b/cryptodev_main.c @@ -150,10 +150,7 @@ cryptodev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (unlikely(!ncr)) BUG(); - switch (cmd) { - default: - return -EINVAL; - } + return ncr_compat_ioctl(ncr, cmd, arg); } #endif /* CONFIG_COMPAT */ @@ -105,6 +105,8 @@ void* ncr_init_lists(void); void ncr_deinit_lists(struct ncr_lists *lst); int ncr_ioctl(struct ncr_lists *lst, unsigned int cmd, unsigned long arg); +long ncr_compat_ioctl(struct ncr_lists *lst, unsigned int cmd, + unsigned long arg); /* key derivation */ int ncr_key_derive(struct ncr_lists *lst, void __user* arg); @@ -22,6 +22,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include <linux/compat.h> #include <linux/crypto.h> #include <linux/ioctl.h> #include <linux/mm.h> @@ -163,3 +164,17 @@ ncr_ioctl(struct ncr_lists *lst, unsigned int cmd, unsigned long arg_) return -EINVAL; } } + +#ifdef CONFIG_COMPAT +long +ncr_compat_ioctl(struct ncr_lists *lst, unsigned int cmd, unsigned long arg_) +{ + if (unlikely(!lst)) + BUG(); + + switch (cmd) { + default: + return -EINVAL; + } +} +#endif |