aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2007-10-14 06:03:58 -0400
committerJiri Kosina <jkosina@suse.cz>2007-10-14 07:40:02 -0400
commitbb6c8d8fa9b5587eea18078ce0bcf6bb2905789f (patch)
treed96a2c81885001a887469b400b2ae920b2f194f2
parent446943593e6e2cb7133cb6c969afd4626c96a916 (diff)
HID: hiddev: Add 32bit ioctl compatibilty
The hiddev driver currently lacks 32bit ioctl compatibility, so if you're running with a 64bit kernel and 32bit userspace, it won't work. I'm pretty sure that the only thing missing is a compat_ioctl implementation as all structs have fixed size fields. With this change I can use revoco to configure my MX Revolution mouse. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/usbhid/hiddev.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index e793127f971e..9837adcb17e9 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -34,6 +34,7 @@
34#include <linux/usb.h> 34#include <linux/usb.h>
35#include <linux/hid.h> 35#include <linux/hid.h>
36#include <linux/hiddev.h> 36#include <linux/hiddev.h>
37#include <linux/compat.h>
37#include "usbhid.h" 38#include "usbhid.h"
38 39
39#ifdef CONFIG_USB_DYNAMIC_MINORS 40#ifdef CONFIG_USB_DYNAMIC_MINORS
@@ -738,6 +739,14 @@ inval:
738 return -EINVAL; 739 return -EINVAL;
739} 740}
740 741
742#ifdef CONFIG_COMPAT
743static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
744{
745 struct inode *inode = file->f_path.dentry->d_inode;
746 return hiddev_ioctl(inode, file, cmd, compat_ptr(arg));
747}
748#endif
749
741static const struct file_operations hiddev_fops = { 750static const struct file_operations hiddev_fops = {
742 .owner = THIS_MODULE, 751 .owner = THIS_MODULE,
743 .read = hiddev_read, 752 .read = hiddev_read,
@@ -747,6 +756,9 @@ static const struct file_operations hiddev_fops = {
747 .release = hiddev_release, 756 .release = hiddev_release,
748 .ioctl = hiddev_ioctl, 757 .ioctl = hiddev_ioctl,
749 .fasync = hiddev_fasync, 758 .fasync = hiddev_fasync,
759#ifdef CONFIG_COMPAT
760 .compat_ioctl = hiddev_compat_ioctl,
761#endif
750}; 762};
751 763
752static struct usb_class_driver hiddev_class = { 764static struct usb_class_driver hiddev_class = {