History

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.

David Herrmann committed 11 years ago

Commit fbae10d1 parent 052876f2 files · +58 −60Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/uinput.h+13−16
@@ -72,13 +72,12 @@ struct uinput_setup { · 71 unmodified lines
7272 /**
7373 * UI_DEV_SETUP - Set device parameters for setup
7474 *
75− * This ioctl sets parameters for the input device to be created. It must be
76− * issued *before* calling UI_DEV_CREATE or it will fail. This ioctl supersedes
77− * the old "struct uinput_user_dev" method, which wrote this data via write().
78− * To actually set the absolute axes, you also need to call the ioctl
79− * UI_ABS_SETUP *before* calling this ioctl.
75+ * This ioctl sets parameters for the input device to be created. It
76+ * supersedes the old "struct uinput_user_dev" method, which wrote this data
77+ * via write(). To actually set the absolute axes UI_ABS_SETUP should be
78+ * used.
8079 *
81− * This ioctl takes a "struct uinput_setup" object as argument. The fields of
80+ * The ioctl takes a "struct uinput_setup" object as argument. The fields of
8281 * this object are as follows:
8382 * id: See the description of "struct input_id". This field is
8483 * copied unchanged into the new device.
@@ -87,9 +86,9 @@ struct uinput_setup { · 2 unmodified lines
8786 * See below for a description of FF with uinput.
8887 *
8988 * This ioctl can be called multiple times and will overwrite previous values.
90− * If this ioctl fails with -EINVAL, you're recommended to use the old
91− * "uinput_user_dev" method via write() as fallback, in case you run on an old
92− * kernel that does not support this ioctl.
89+ * If this ioctl fails with -EINVAL, it is recommended to use the old
90+ * "uinput_user_dev" method via write() as a fallback, in case you run on an
91+ * old kernel that does not support this ioctl.
9392 *
9493 * This ioctl may fail with -EINVAL if it is not supported or if you passed
9594 * incorrect values, -ENOMEM if the kernel runs out of memory or -EFAULT if the
@@ -109,12 +108,10 @@ struct uinput_abs_setup { · 13 unmodified lines
109108 * UI_ABS_SETUP - Set absolute axis information for the device to setup
110109 *
111110 * This ioctl sets one absolute axis information for the input device to be
112− * created. It must be issued *before* calling UI_DEV_SETUP and UI_DEV_CREATE
113− * for every absolute axis the device exports.
114− * This ioctl supersedes the old "struct uinput_user_dev" method, which wrote
111+ * created. It supersedes the old "struct uinput_user_dev" method, which wrote
115112 * part of this data and the content of UI_DEV_SETUP via write().
116113 *
117− * This ioctl takes a "struct uinput_abs_setup" object as argument. The fields
114+ * The ioctl takes a "struct uinput_abs_setup" object as argument. The fields
118115 * of this object are as follows:
119116 * code: The corresponding input code associated with this axis
120117 * (ABS_X, ABS_Y, etc...)
@@ -124,9 +121,9 @@ struct uinput_abs_setup { · 3 unmodified lines
124121 * UI_SET_ABSBIT, this ioctl will enable it.
125122 *
126123 * This ioctl can be called multiple times and will overwrite previous values.
127− * If this ioctl fails with -EINVAL, you're recommended to use the old
128− * "uinput_user_dev" method via write() as fallback, in case you run on an old
129− * kernel that does not support this ioctl.
124+ * If this ioctl fails with -EINVAL, it is recommended to use the old
125+ * "uinput_user_dev" method via write() as a fallback, in case you run on an
126+ * old kernel that does not support this ioctl.
130127 *
131128 * This ioctl may fail with -EINVAL if it is not supported or if you passed
132129 * incorrect values, -ENOMEM if the kernel runs out of memory or -EFAULT if the

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t