diff options
-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 |