diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-07 21:17:29 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-07 21:17:29 -0400 |
| commit | 39520eea198a7fbba35f4c7cffb4323f78455716 (patch) | |
| tree | 12dd2f16ca1d6f7ed814e670103a09659d410252 /include/uapi | |
| parent | 28596c9722289b2f98fa83a2e4351eb0a031b953 (diff) | |
| parent | ee5db7e47faccd07a8a17f73afb30345f8331e61 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID updates from Jiri Kosina:
- quirk for devices that need to be pulled in much more aggresive way
than mandated, by Johan Hovold
- robustification of sanity checking of incoming reports in RMI driver,
by Benjamin Tissoires
- fixes, updates, and new HW support to SONY driver, by Frank Praznik
- port of uHID to the new transport layer layout, by David Herrmann
- robustification of Clear-Halt/reset in USB HID, by Alan Stern
- native support for hopefully any future HID compliant wacom tablet.
Those found on the various laptops (ISDv4/5) already are HID
compliant and they should work in the future without any modification
of the kernel. Written by Benjamin Tissoires.
- a lot more simple fixes and device ID additions all over the place
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (45 commits)
HID: uHID: fix excepted report type
HID: usbhid: add another mouse that needs QUIRK_ALWAYS_POLL
HID: wacom: implement the finger part of the HID generic handling
HID: wacom: implement generic HID handling for pen generic devices
HID: wacom: move allocation of inputs earlier
HID: wacom: split out input allocation and registration
HID: wacom: rename failN with some meaningful information
HID: sony: Update the DualShock 4 touchpad resolution
HID: wacom: fix timeout on probe for some wacoms
HID: sony: Set touchpad bits in the input_configured callback
HID: sony: Update file header and correct comments
HID: sony: Corrections for the DualShock 4 HID descriptor
HID: rmi: check sanity of the incoming report
HID: wacom: make the WL connection friendly for the desktop
HID: wacom - enable LED support for Wireless Intuos5/Pro
HID: wacom - remove report_id from wacom_get_report interface
HID: wacom - Clean up of sysfs
HID: wacom - Add default permission defines for sysfs attributes
HID: usbhid: fix PIXART optical mouse
HID: Add Holtek USB ID 04d9:a0c2 ETEKCITY Scroll
...
Diffstat (limited to 'include/uapi')
| -rw-r--r-- | include/uapi/linux/uhid.h | 120 |
1 files changed, 95 insertions, 25 deletions
diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h index 1e3b09c191cd..aaa86d6bd1dd 100644 --- a/include/uapi/linux/uhid.h +++ b/include/uapi/linux/uhid.h | |||
| @@ -24,35 +24,23 @@ | |||
| 24 | #include <linux/hid.h> | 24 | #include <linux/hid.h> |
| 25 | 25 | ||
| 26 | enum uhid_event_type { | 26 | enum uhid_event_type { |
| 27 | UHID_CREATE, | 27 | __UHID_LEGACY_CREATE, |
| 28 | UHID_DESTROY, | 28 | UHID_DESTROY, |
| 29 | UHID_START, | 29 | UHID_START, |
| 30 | UHID_STOP, | 30 | UHID_STOP, |
| 31 | UHID_OPEN, | 31 | UHID_OPEN, |
| 32 | UHID_CLOSE, | 32 | UHID_CLOSE, |
| 33 | UHID_OUTPUT, | 33 | UHID_OUTPUT, |
| 34 | UHID_OUTPUT_EV, /* obsolete! */ | 34 | __UHID_LEGACY_OUTPUT_EV, |
| 35 | UHID_INPUT, | 35 | __UHID_LEGACY_INPUT, |
| 36 | UHID_FEATURE, | 36 | UHID_GET_REPORT, |
| 37 | UHID_FEATURE_ANSWER, | 37 | UHID_GET_REPORT_REPLY, |
| 38 | UHID_CREATE2, | 38 | UHID_CREATE2, |
| 39 | UHID_INPUT2, | 39 | UHID_INPUT2, |
| 40 | UHID_SET_REPORT, | ||
| 41 | UHID_SET_REPORT_REPLY, | ||
| 40 | }; | 42 | }; |
| 41 | 43 | ||
| 42 | struct uhid_create_req { | ||
| 43 | __u8 name[128]; | ||
| 44 | __u8 phys[64]; | ||
| 45 | __u8 uniq[64]; | ||
| 46 | __u8 __user *rd_data; | ||
| 47 | __u16 rd_size; | ||
| 48 | |||
| 49 | __u16 bus; | ||
| 50 | __u32 vendor; | ||
| 51 | __u32 product; | ||
| 52 | __u32 version; | ||
| 53 | __u32 country; | ||
| 54 | } __attribute__((__packed__)); | ||
| 55 | |||
| 56 | struct uhid_create2_req { | 44 | struct uhid_create2_req { |
| 57 | __u8 name[128]; | 45 | __u8 name[128]; |
| 58 | __u8 phys[64]; | 46 | __u8 phys[64]; |
| @@ -66,6 +54,16 @@ struct uhid_create2_req { | |||
| 66 | __u8 rd_data[HID_MAX_DESCRIPTOR_SIZE]; | 54 | __u8 rd_data[HID_MAX_DESCRIPTOR_SIZE]; |
| 67 | } __attribute__((__packed__)); | 55 | } __attribute__((__packed__)); |
| 68 | 56 | ||
| 57 | enum uhid_dev_flag { | ||
| 58 | UHID_DEV_NUMBERED_FEATURE_REPORTS = (1ULL << 0), | ||
| 59 | UHID_DEV_NUMBERED_OUTPUT_REPORTS = (1ULL << 1), | ||
| 60 | UHID_DEV_NUMBERED_INPUT_REPORTS = (1ULL << 2), | ||
| 61 | }; | ||
| 62 | |||
| 63 | struct uhid_start_req { | ||
| 64 | __u64 dev_flags; | ||
| 65 | }; | ||
| 66 | |||
| 69 | #define UHID_DATA_MAX 4096 | 67 | #define UHID_DATA_MAX 4096 |
| 70 | 68 | ||
| 71 | enum uhid_report_type { | 69 | enum uhid_report_type { |
| @@ -74,36 +72,94 @@ enum uhid_report_type { | |||
| 74 | UHID_INPUT_REPORT, | 72 | UHID_INPUT_REPORT, |
| 75 | }; | 73 | }; |
| 76 | 74 | ||
| 77 | struct uhid_input_req { | 75 | struct uhid_input2_req { |
| 76 | __u16 size; | ||
| 77 | __u8 data[UHID_DATA_MAX]; | ||
| 78 | } __attribute__((__packed__)); | ||
| 79 | |||
| 80 | struct uhid_output_req { | ||
| 78 | __u8 data[UHID_DATA_MAX]; | 81 | __u8 data[UHID_DATA_MAX]; |
| 79 | __u16 size; | 82 | __u16 size; |
| 83 | __u8 rtype; | ||
| 80 | } __attribute__((__packed__)); | 84 | } __attribute__((__packed__)); |
| 81 | 85 | ||
| 82 | struct uhid_input2_req { | 86 | struct uhid_get_report_req { |
| 87 | __u32 id; | ||
| 88 | __u8 rnum; | ||
| 89 | __u8 rtype; | ||
| 90 | } __attribute__((__packed__)); | ||
| 91 | |||
| 92 | struct uhid_get_report_reply_req { | ||
| 93 | __u32 id; | ||
| 94 | __u16 err; | ||
| 83 | __u16 size; | 95 | __u16 size; |
| 84 | __u8 data[UHID_DATA_MAX]; | 96 | __u8 data[UHID_DATA_MAX]; |
| 85 | } __attribute__((__packed__)); | 97 | } __attribute__((__packed__)); |
| 86 | 98 | ||
| 87 | struct uhid_output_req { | 99 | struct uhid_set_report_req { |
| 100 | __u32 id; | ||
| 101 | __u8 rnum; | ||
| 102 | __u8 rtype; | ||
| 103 | __u16 size; | ||
| 104 | __u8 data[UHID_DATA_MAX]; | ||
| 105 | } __attribute__((__packed__)); | ||
| 106 | |||
| 107 | struct uhid_set_report_reply_req { | ||
| 108 | __u32 id; | ||
| 109 | __u16 err; | ||
| 110 | } __attribute__((__packed__)); | ||
| 111 | |||
| 112 | /* | ||
| 113 | * Compat Layer | ||
| 114 | * All these commands and requests are obsolete. You should avoid using them in | ||
| 115 | * new code. We support them for backwards-compatibility, but you might not get | ||
| 116 | * access to new feature in case you use them. | ||
| 117 | */ | ||
| 118 | |||
| 119 | enum uhid_legacy_event_type { | ||
| 120 | UHID_CREATE = __UHID_LEGACY_CREATE, | ||
| 121 | UHID_OUTPUT_EV = __UHID_LEGACY_OUTPUT_EV, | ||
| 122 | UHID_INPUT = __UHID_LEGACY_INPUT, | ||
| 123 | UHID_FEATURE = UHID_GET_REPORT, | ||
| 124 | UHID_FEATURE_ANSWER = UHID_GET_REPORT_REPLY, | ||
| 125 | }; | ||
| 126 | |||
| 127 | /* Obsolete! Use UHID_CREATE2. */ | ||
| 128 | struct uhid_create_req { | ||
| 129 | __u8 name[128]; | ||
| 130 | __u8 phys[64]; | ||
| 131 | __u8 uniq[64]; | ||
| 132 | __u8 __user *rd_data; | ||
| 133 | __u16 rd_size; | ||
| 134 | |||
| 135 | __u16 bus; | ||
| 136 | __u32 vendor; | ||
| 137 | __u32 product; | ||
| 138 | __u32 version; | ||
| 139 | __u32 country; | ||
| 140 | } __attribute__((__packed__)); | ||
| 141 | |||
| 142 | /* Obsolete! Use UHID_INPUT2. */ | ||
| 143 | struct uhid_input_req { | ||
| 88 | __u8 data[UHID_DATA_MAX]; | 144 | __u8 data[UHID_DATA_MAX]; |
| 89 | __u16 size; | 145 | __u16 size; |
| 90 | __u8 rtype; | ||
| 91 | } __attribute__((__packed__)); | 146 | } __attribute__((__packed__)); |
| 92 | 147 | ||
| 93 | /* Obsolete! Newer kernels will no longer send these events but instead convert | 148 | /* Obsolete! Kernel uses UHID_OUTPUT exclusively now. */ |
| 94 | * it into raw output reports via UHID_OUTPUT. */ | ||
| 95 | struct uhid_output_ev_req { | 149 | struct uhid_output_ev_req { |
| 96 | __u16 type; | 150 | __u16 type; |
| 97 | __u16 code; | 151 | __u16 code; |
| 98 | __s32 value; | 152 | __s32 value; |
| 99 | } __attribute__((__packed__)); | 153 | } __attribute__((__packed__)); |
| 100 | 154 | ||
| 155 | /* Obsolete! Kernel uses ABI compatible UHID_GET_REPORT. */ | ||
| 101 | struct uhid_feature_req { | 156 | struct uhid_feature_req { |
| 102 | __u32 id; | 157 | __u32 id; |
| 103 | __u8 rnum; | 158 | __u8 rnum; |
| 104 | __u8 rtype; | 159 | __u8 rtype; |
| 105 | } __attribute__((__packed__)); | 160 | } __attribute__((__packed__)); |
| 106 | 161 | ||
| 162 | /* Obsolete! Use ABI compatible UHID_GET_REPORT_REPLY. */ | ||
| 107 | struct uhid_feature_answer_req { | 163 | struct uhid_feature_answer_req { |
| 108 | __u32 id; | 164 | __u32 id; |
| 109 | __u16 err; | 165 | __u16 err; |
| @@ -111,6 +167,15 @@ struct uhid_feature_answer_req { | |||
| 111 | __u8 data[UHID_DATA_MAX]; | 167 | __u8 data[UHID_DATA_MAX]; |
| 112 | } __attribute__((__packed__)); | 168 | } __attribute__((__packed__)); |
| 113 | 169 | ||
| 170 | /* | ||
| 171 | * UHID Events | ||
| 172 | * All UHID events from and to the kernel are encoded as "struct uhid_event". | ||
| 173 | * The "type" field contains a UHID_* type identifier. All payload depends on | ||
| 174 | * that type and can be accessed via ev->u.XYZ accordingly. | ||
| 175 | * If user-space writes short events, they're extended with 0s by the kernel. If | ||
| 176 | * the kernel writes short events, user-space shall extend them with 0s. | ||
| 177 | */ | ||
| 178 | |||
| 114 | struct uhid_event { | 179 | struct uhid_event { |
| 115 | __u32 type; | 180 | __u32 type; |
| 116 | 181 | ||
| @@ -120,9 +185,14 @@ struct uhid_event { | |||
| 120 | struct uhid_output_req output; | 185 | struct uhid_output_req output; |
| 121 | struct uhid_output_ev_req output_ev; | 186 | struct uhid_output_ev_req output_ev; |
| 122 | struct uhid_feature_req feature; | 187 | struct uhid_feature_req feature; |
| 188 | struct uhid_get_report_req get_report; | ||
| 123 | struct uhid_feature_answer_req feature_answer; | 189 | struct uhid_feature_answer_req feature_answer; |
| 190 | struct uhid_get_report_reply_req get_report_reply; | ||
| 124 | struct uhid_create2_req create2; | 191 | struct uhid_create2_req create2; |
| 125 | struct uhid_input2_req input2; | 192 | struct uhid_input2_req input2; |
| 193 | struct uhid_set_report_req set_report; | ||
| 194 | struct uhid_set_report_reply_req set_report_reply; | ||
| 195 | struct uhid_start_req start; | ||
| 126 | } u; | 196 | } u; |
| 127 | } __attribute__((__packed__)); | 197 | } __attribute__((__packed__)); |
| 128 | 198 | ||
