aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/evdev
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2018-04-30 10:34:16 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2018-04-30 10:34:16 +0000
commit4b58fa12407d078957b2d335216ba54a13cf4233 (patch)
treeaffe0d124a3b9ee6d46292bcd49384d1ff744f2a /sys/dev/evdev
parent3ee5c55415a7b08c6c4c403cc6b96e30d768e1c9 (diff)
Notes
Diffstat (limited to 'sys/dev/evdev')
-rw-r--r--sys/dev/evdev/uinput.c9
-rw-r--r--sys/dev/evdev/uinput.h7
2 files changed, 16 insertions, 0 deletions
diff --git a/sys/dev/evdev/uinput.c b/sys/dev/evdev/uinput.c
index 3ed2e13b20535..4b62e22a284bb 100644
--- a/sys/dev/evdev/uinput.c
+++ b/sys/dev/evdev/uinput.c
@@ -604,6 +604,15 @@ uinput_ioctl_sub(struct uinput_cdev_state *state, u_long cmd, caddr_t data)
evdev_set_phys(state->ucs_evdev, buf);
return (0);
+ case UI_SET_BSDUNIQ:
+ if (state->ucs_state == UINPUT_RUNNING)
+ return (EINVAL);
+ ret = copyinstr(*(void **)data, buf, sizeof(buf), NULL);
+ if (ret != 0)
+ return (ret);
+ evdev_set_serial(state->ucs_evdev, buf);
+ return (0);
+
case UI_SET_SWBIT:
if (state->ucs_state == UINPUT_RUNNING ||
intdata > SW_MAX || intdata < 0)
diff --git a/sys/dev/evdev/uinput.h b/sys/dev/evdev/uinput.h
index dd4b0a82c1d3c..d15b8945f4602 100644
--- a/sys/dev/evdev/uinput.h
+++ b/sys/dev/evdev/uinput.h
@@ -90,6 +90,13 @@ struct uinput_abs_setup {
#define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase)
#define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase)
+/*
+ * FreeBSD specific. Set unique identifier of input device.
+ * Name and magic are chosen to reduce chances of clashing
+ * with possible future Linux extensions.
+ */
+#define UI_SET_BSDUNIQ _IO(UINPUT_IOCTL_BASE, 109)
+
#define EV_UINPUT 0x0101
#define UI_FF_UPLOAD 1
#define UI_FF_ERASE 2