Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bb6c8d8fa9b5587eea18078ce0bcf6bb2905789f
Commit:     bb6c8d8fa9b5587eea18078ce0bcf6bb2905789f
Parent:     446943593e6e2cb7133cb6c969afd4626c96a916
Author:     Philip Langdale <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 14 12:03:58 2007 +0200
Committer:  Jiri Kosina <[EMAIL PROTECTED]>
CommitDate: Sun Oct 14 13:40:02 2007 +0200

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Jiri Kosina <[EMAIL PROTECTED]>
---
 drivers/hid/usbhid/hiddev.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index e793127..9837adc 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -34,6 +34,7 @@
 #include <linux/usb.h>
 #include <linux/hid.h>
 #include <linux/hiddev.h>
+#include <linux/compat.h>
 #include "usbhid.h"
 
 #ifdef CONFIG_USB_DYNAMIC_MINORS
@@ -738,6 +739,14 @@ inval:
        return -EINVAL;
 }
 
+#ifdef CONFIG_COMPAT
+static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned 
long arg)
+{
+       struct inode *inode = file->f_path.dentry->d_inode;
+       return hiddev_ioctl(inode, file, cmd, compat_ptr(arg));
+}
+#endif
+
 static const struct file_operations hiddev_fops = {
        .owner =        THIS_MODULE,
        .read =         hiddev_read,
@@ -747,6 +756,9 @@ static const struct file_operations hiddev_fops = {
        .release =      hiddev_release,
        .ioctl =        hiddev_ioctl,
        .fasync =       hiddev_fasync,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = hiddev_compat_ioctl,
+#endif
 };
 
 static struct usb_class_driver hiddev_class = {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to