Add ioctl definitions

Added the HIDIOCSFEATURE and HIDIOCGFEATURE ioctl macros to hid.c so that it
will compile with older kernel headers. This of course doesn't make it _run_
with older kernels. Some distros ship older kernel headers than the running
kernel.
This commit is contained in:
Alan Ott 2011-08-08 21:16:09 -04:00
parent 781efae694
commit 8066251aa8

View File

@ -44,6 +44,15 @@
#include "hidapi.h"
/* Definitions from linux/hidraw.h. Since these are new, some distros
may not have header files which contain them. */
#ifndef HIDIOCSFEATURE
#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
#endif
#ifndef HIDIOCGFEATURE
#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
#endif
struct hid_device_ {
int device_handle;
int blocking;