Commit a09ac40e authored by Jiri Kosina's avatar Jiri Kosina

Merge branch 'for-5.6/hidraw' into for-linus

- support for uniq ioctl()
parents 9e635c28 2f48865d
...@@ -451,6 +451,15 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd, ...@@ -451,6 +451,15 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,
-EFAULT : len; -EFAULT : len;
break; break;
} }
if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWUNIQ(0))) {
int len = strlen(hid->uniq) + 1;
if (len > _IOC_SIZE(cmd))
len = _IOC_SIZE(cmd);
ret = copy_to_user(user_arg, hid->uniq, len) ?
-EFAULT : len;
break;
}
} }
ret = -ENOTTY; ret = -ENOTTY;
......
...@@ -39,6 +39,7 @@ struct hidraw_devinfo { ...@@ -39,6 +39,7 @@ struct hidraw_devinfo {
/* The first byte of SFEATURE and GFEATURE is the report number */ /* The first byte of SFEATURE and GFEATURE is the report number */
#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len) #define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len) #define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
#define HIDIOCGRAWUNIQ(len) _IOC(_IOC_READ, 'H', 0x08, len)
#define HIDRAW_FIRST_MINOR 0 #define HIDRAW_FIRST_MINOR 0
#define HIDRAW_MAX_DEVICES 64 #define HIDRAW_MAX_DEVICES 64
......
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