aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/uapi/linux/uinput.h
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-10-25 10:34:13 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-12-18 17:48:51 -0800
commitfbae10db094046dba1d59e1c2ee5140835045f14 (patch)
treef9129de6b266dada624d4bbce5457ed87fb42630 /include/uapi/linux/uinput.h
parentInput: uinput - add new UINPUT_DEV_SETUP and UI_ABS_SETUP ioctl (diff)
downloadwireguard-linux-fbae10db094046dba1d59e1c2ee5140835045f14.tar.xz
wireguard-linux-fbae10db094046dba1d59e1c2ee5140835045f14.zip
Input: uinput - rework ABS validation
Rework the uinput ABS validation to check passed absinfo data immediately, but do ABS initialization as last step in UI_DEV_CREATE. The behavior observed by user-space is not changed, as ABS initialization was never checked for errors. With this in place, the order of device initialization and abs configuration is no longer fixed. Userspace can initialize the device and afterwards set absinfo just fine. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'include/uapi/linux/uinput.h')
-rw-r--r--include/uapi/linux/uinput.h29
1 files changed, 13 insertions, 16 deletions
diff --git a/include/uapi/linux/uinput.h b/include/uapi/linux/uinput.h
index 77b8cf73a178..dc652e224b67 100644
--- a/include/uapi/linux/uinput.h
+++ b/include/uapi/linux/uinput.h
@@ -72,13 +72,12 @@ struct uinput_setup {
/**
* UI_DEV_SETUP - Set device parameters for setup
*
- * This ioctl sets parameters for the input device to be created. It must be
- * issued *before* calling UI_DEV_CREATE or it will fail. This ioctl supersedes
- * the old "struct uinput_user_dev" method, which wrote this data via write().
- * To actually set the absolute axes, you also need to call the ioctl
- * UI_ABS_SETUP *before* calling this ioctl.
+ * This ioctl sets parameters for the input device to be created. It
+ * supersedes the old "struct uinput_user_dev" method, which wrote this data
+ * via write(). To actually set the absolute axes UI_ABS_SETUP should be
+ * used.
*
- * This ioctl takes a "struct uinput_setup" object as argument. The fields of
+ * The ioctl takes a "struct uinput_setup" object as argument. The fields of
* this object are as follows:
* id: See the description of "struct input_id". This field is
* copied unchanged into the new device.
@@ -87,9 +86,9 @@ struct uinput_setup {
* See below for a description of FF with uinput.
*
* This ioctl can be called multiple times and will overwrite previous values.
- * If this ioctl fails with -EINVAL, you're recommended to use the old
- * "uinput_user_dev" method via write() as fallback, in case you run on an old
- * kernel that does not support this ioctl.
+ * If this ioctl fails with -EINVAL, it is recommended to use the old
+ * "uinput_user_dev" method via write() as a fallback, in case you run on an
+ * old kernel that does not support this ioctl.
*
* This ioctl may fail with -EINVAL if it is not supported or if you passed
* incorrect values, -ENOMEM if the kernel runs out of memory or -EFAULT if the
@@ -109,12 +108,10 @@ struct uinput_abs_setup {
* UI_ABS_SETUP - Set absolute axis information for the device to setup
*
* This ioctl sets one absolute axis information for the input device to be
- * created. It must be issued *before* calling UI_DEV_SETUP and UI_DEV_CREATE
- * for every absolute axis the device exports.
- * This ioctl supersedes the old "struct uinput_user_dev" method, which wrote
+ * created. It supersedes the old "struct uinput_user_dev" method, which wrote
* part of this data and the content of UI_DEV_SETUP via write().
*
- * This ioctl takes a "struct uinput_abs_setup" object as argument. The fields
+ * The ioctl takes a "struct uinput_abs_setup" object as argument. The fields
* of this object are as follows:
* code: The corresponding input code associated with this axis
* (ABS_X, ABS_Y, etc...)
@@ -124,9 +121,9 @@ struct uinput_abs_setup {
* UI_SET_ABSBIT, this ioctl will enable it.
*
* This ioctl can be called multiple times and will overwrite previous values.
- * If this ioctl fails with -EINVAL, you're recommended to use the old
- * "uinput_user_dev" method via write() as fallback, in case you run on an old
- * kernel that does not support this ioctl.
+ * If this ioctl fails with -EINVAL, it is recommended to use the old
+ * "uinput_user_dev" method via write() as a fallback, in case you run on an
+ * old kernel that does not support this ioctl.
*
* This ioctl may fail with -EINVAL if it is not supported or if you passed
* incorrect values, -ENOMEM if the kernel runs out of memory or -EFAULT if the