Commit a87191ad authored by Adam Kropelin's avatar Adam Kropelin Committed by Vojtech Pavlik

input: Add 64-bit compatible ioctls for hiddev.

parent 56b3ffec
...@@ -642,7 +642,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -642,7 +642,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
goto inval; goto inval;
if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) { if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) {
if (uref_multi->num_values >= HID_MAX_USAGES || if (uref_multi->num_values >= HID_MAX_MULTI_USAGES ||
uref->usage_index >= field->maxusage || uref->usage_index >= field->maxusage ||
(uref->usage_index + uref_multi->num_values) >= field->maxusage) (uref->usage_index + uref_multi->num_values) >= field->maxusage)
goto inval; goto inval;
......
...@@ -114,6 +114,8 @@ ...@@ -114,6 +114,8 @@
#include <linux/filter.h> #include <linux/filter.h>
#include <linux/msdos_fs.h> #include <linux/msdos_fs.h>
#include <linux/hiddev.h>
#undef INCLUDES #undef INCLUDES
#endif #endif
......
...@@ -720,3 +720,20 @@ COMPATIBLE_IOCTL(SIOCSIWRETRY) ...@@ -720,3 +720,20 @@ COMPATIBLE_IOCTL(SIOCSIWRETRY)
COMPATIBLE_IOCTL(SIOCGIWRETRY) COMPATIBLE_IOCTL(SIOCGIWRETRY)
COMPATIBLE_IOCTL(SIOCSIWPOWER) COMPATIBLE_IOCTL(SIOCSIWPOWER)
COMPATIBLE_IOCTL(SIOCGIWPOWER) COMPATIBLE_IOCTL(SIOCGIWPOWER)
/* hiddev */
COMPATIBLE_IOCTL(HIDIOCGVERSION)
COMPATIBLE_IOCTL(HIDIOCAPPLICATION)
COMPATIBLE_IOCTL(HIDIOCGDEVINFO)
COMPATIBLE_IOCTL(HIDIOCGSTRING)
COMPATIBLE_IOCTL(HIDIOCINITREPORT)
COMPATIBLE_IOCTL(HIDIOCGREPORT)
COMPATIBLE_IOCTL(HIDIOCSREPORT)
COMPATIBLE_IOCTL(HIDIOCGREPORTINFO)
COMPATIBLE_IOCTL(HIDIOCGFIELDINFO)
COMPATIBLE_IOCTL(HIDIOCGUSAGE)
COMPATIBLE_IOCTL(HIDIOCSUSAGE)
COMPATIBLE_IOCTL(HIDIOCGUCODE)
COMPATIBLE_IOCTL(HIDIOCGFLAG)
COMPATIBLE_IOCTL(HIDIOCSFLAG)
COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINDEX)
COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINFO)
...@@ -128,10 +128,11 @@ struct hiddev_usage_ref { ...@@ -128,10 +128,11 @@ struct hiddev_usage_ref {
/* hiddev_usage_ref_multi is used for sending multiple bytes to a control. /* hiddev_usage_ref_multi is used for sending multiple bytes to a control.
* It really manifests itself as setting the value of consecutive usages */ * It really manifests itself as setting the value of consecutive usages */
#define HID_MAX_MULTI_USAGES 1024
struct hiddev_usage_ref_multi { struct hiddev_usage_ref_multi {
struct hiddev_usage_ref uref; struct hiddev_usage_ref uref;
__u32 num_values; __u32 num_values;
__s32 values[HID_MAX_USAGES]; __s32 values[HID_MAX_MULTI_USAGES];
}; };
/* FIELD_INDEX_NONE is returned in read() data from the kernel when flags /* FIELD_INDEX_NONE is returned in read() data from the kernel when flags
...@@ -213,6 +214,11 @@ struct hiddev_usage_ref_multi { ...@@ -213,6 +214,11 @@ struct hiddev_usage_ref_multi {
*/ */
#ifdef CONFIG_USB_HIDDEV #ifdef CONFIG_USB_HIDDEV
struct hid_device;
struct hid_usage;
struct hid_field;
struct hid_report;
int hiddev_connect(struct hid_device *); int hiddev_connect(struct hid_device *);
void hiddev_disconnect(struct hid_device *); void hiddev_disconnect(struct hid_device *);
void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment