HID_MAX_USAGES undefined
Vojtech,
Recently you added code to include/linux/hiddev.h that looks like this:
/* hiddev_usage_ref_multi is used for sending multiple bytes to a control.
* It really manifests itself as setting the value of consecutive usages */
struct hiddev_usage_ref_multi {
struct hiddev_usage_ref uref;
__u32 num_values;
__s32 values[HID_MAX_USAGES];
};However, the only place that I could see where HID_MAX_USAGES is defined is in drivers/usb/input/hid.h.
Worse, the size of hiddev_usage_ref_multi (which depends on HID_MAX_USAGES) determines values that userland needs to know:
#define HIDIOCGUSAGES _IOWR('H', 0x13, struct hiddev_usage_ref_multi)
#define HIDIOCSUSAGES _IOW('H', 0x14, struct hiddev_usage_ref_multi)
Could you move the HID_MAX_USAGES definition to include/linux/hiddev.h please?
I found this because I have a local hack to let me use various HID ioctls from a 32-bit process running under a ppc64 kernel. I have included the patch I am using below. It isn't complete, though, because there are some HID ioctl command values which are a whole range of commands:
#define HIDIOCGNAME(len) _IOC(_IOC_READ, 'H', 0x06, len)
#define HIDIOCGPHYS(len) _IOC(_IOC_READ, 'H', 0x12, len)
This might be a clever trick but it makes life hard for those of us trying to support 32-bit processes on 64-bit kernels. For now I have just left them out, since I don't need to use them. (The HID application that I have is a little program that sets the backlight brightness on my Apple LCD monitor.)
Regards,
Paul.
arch/ppc64/kernel/ioctl32.c +2 -0
@@ -24,6 +24,8 @@#include "compat_ioctl.c" #include <linux/ncp_fs.h> #include <linux/syscalls.h> +#define HID_MAX_USAGES 1024/* XXX completely bogus... */ +#include <linux/hiddev.h> #include <asm/ppc32.h> #define CODE
include/linux/compat_ioctl.h +17 -0
@@ -691,3 +691,20 @@ COMPATIBLE_IOCTL(SIOCGIWRETRY) COMPATIBLE_IOCTL(SIOCSIWPOWER) COMPATIBLE_IOCTL(SIOCGIWPOWER) +/* Big H for USB HID devices */ +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)
include/linux/hiddev.h +4 -0
@@ -213,6 +213,10 @@*/ #ifdef CONFIG_USB_HIDDEV +struct hid_device ; +struct hid_usage ; +struct hid_field ; +struct hid_report ;int hiddev_connect (struct hid_device *);void hiddev_disconnect (struct hid_device *); void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,