Date: Mon, 30 Apr 2018 10:34:16 +0000 (UTC) From: Vladimir Kondratyev <wulf@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333111 - head/sys/dev/evdev Message-ID: <201804301034.w3UAYGUh011007@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: wulf Date: Mon Apr 30 10:34:16 2018 New Revision: 333111 URL: https://svnweb.freebsd.org/changeset/base/333111 Log: uinput: Add FreeBSD specific ioctl to set unique identifier of input device. Reviewed by: gonzo Differential Revision: https://reviews.freebsd.org/D13456 Modified: head/sys/dev/evdev/uinput.c head/sys/dev/evdev/uinput.h Modified: head/sys/dev/evdev/uinput.c ============================================================================== --- head/sys/dev/evdev/uinput.c Mon Apr 30 10:24:50 2018 (r333110) +++ head/sys/dev/evdev/uinput.c Mon Apr 30 10:34:16 2018 (r333111) @@ -604,6 +604,15 @@ uinput_ioctl_sub(struct uinput_cdev_state *state, u_lo 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) Modified: head/sys/dev/evdev/uinput.h ============================================================================== --- head/sys/dev/evdev/uinput.h Mon Apr 30 10:24:50 2018 (r333110) +++ head/sys/dev/evdev/uinput.h Mon Apr 30 10:34:16 2018 (r333111) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804301034.w3UAYGUh011007>