diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-07-29 11:14:21 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-08-25 04:28:07 -0400 |
commit | fa71f32b5de2be1644ee671ddbe211d79be7847f (patch) | |
tree | 2e7e01d5bfe3bde23e1de3275f393b34bcbb793d /include/uapi/linux/uhid.h | |
parent | 5942b849b124c54002346e699f50db3714e300ed (diff) |
HID: uhid: add ABI compatible UHID_GET_REPORT replacing UHID_FEATURE
The old hdev->hid_get_raw_report() was broken by design. It was never
clear what kind of HW request it should trigger. Benjamin fixed that with
the core HID cleanup, though we never really adjusted uhid.
Unfortunately, our old UHID_FEATURE command was modelled around the broken
hid_get_raw_report(). We converted it silently to the new GET_REPORT and
nothing broke. Make this explicit by renaming UHID_FEATURE to
UHID_GET_REPORT and UHID_FEATURE_ANSWER to UHID_GET_REPORT_REPLY.
Note that this is 100% ABI compatible to UHID_FEATURE. This is just a
rename. But we have to keep the old definitions around to not break API.
>From now on, UHID_GET_REPORT must trigger a GET_REPORT request on the
user-space hardware layer. All the ambiguity due to the weird "feature"
name should be gone now.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/uapi/linux/uhid.h')
-rw-r--r-- | include/uapi/linux/uhid.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h index 1e3b09c191cd..0a08f2bbe642 100644 --- a/include/uapi/linux/uhid.h +++ b/include/uapi/linux/uhid.h | |||
@@ -33,8 +33,10 @@ enum uhid_event_type { | |||
33 | UHID_OUTPUT, | 33 | UHID_OUTPUT, |
34 | UHID_OUTPUT_EV, /* obsolete! */ | 34 | UHID_OUTPUT_EV, /* obsolete! */ |
35 | UHID_INPUT, | 35 | UHID_INPUT, |
36 | UHID_FEATURE, | 36 | UHID_FEATURE, /* obsolete! use UHID_GET_REPORT */ |
37 | UHID_FEATURE_ANSWER, | 37 | UHID_GET_REPORT = UHID_FEATURE, |
38 | UHID_FEATURE_ANSWER, /* obsolete! use UHID_GET_REPORT_REPLY */ | ||
39 | UHID_GET_REPORT_REPLY = UHID_FEATURE_ANSWER, | ||
38 | UHID_CREATE2, | 40 | UHID_CREATE2, |
39 | UHID_INPUT2, | 41 | UHID_INPUT2, |
40 | }; | 42 | }; |
@@ -98,12 +100,20 @@ struct uhid_output_ev_req { | |||
98 | __s32 value; | 100 | __s32 value; |
99 | } __attribute__((__packed__)); | 101 | } __attribute__((__packed__)); |
100 | 102 | ||
103 | /* Obsolete! Kernel uses ABI compatible UHID_GET_REPORT. */ | ||
101 | struct uhid_feature_req { | 104 | struct uhid_feature_req { |
102 | __u32 id; | 105 | __u32 id; |
103 | __u8 rnum; | 106 | __u8 rnum; |
104 | __u8 rtype; | 107 | __u8 rtype; |
105 | } __attribute__((__packed__)); | 108 | } __attribute__((__packed__)); |
106 | 109 | ||
110 | struct uhid_get_report_req { | ||
111 | __u32 id; | ||
112 | __u8 rnum; | ||
113 | __u8 rtype; | ||
114 | } __attribute__((__packed__)); | ||
115 | |||
116 | /* Obsolete! Use ABI compatible UHID_GET_REPORT_REPLY. */ | ||
107 | struct uhid_feature_answer_req { | 117 | struct uhid_feature_answer_req { |
108 | __u32 id; | 118 | __u32 id; |
109 | __u16 err; | 119 | __u16 err; |
@@ -111,6 +121,13 @@ struct uhid_feature_answer_req { | |||
111 | __u8 data[UHID_DATA_MAX]; | 121 | __u8 data[UHID_DATA_MAX]; |
112 | } __attribute__((__packed__)); | 122 | } __attribute__((__packed__)); |
113 | 123 | ||
124 | struct uhid_get_report_reply_req { | ||
125 | __u32 id; | ||
126 | __u16 err; | ||
127 | __u16 size; | ||
128 | __u8 data[UHID_DATA_MAX]; | ||
129 | } __attribute__((__packed__)); | ||
130 | |||
114 | struct uhid_event { | 131 | struct uhid_event { |
115 | __u32 type; | 132 | __u32 type; |
116 | 133 | ||
@@ -120,7 +137,9 @@ struct uhid_event { | |||
120 | struct uhid_output_req output; | 137 | struct uhid_output_req output; |
121 | struct uhid_output_ev_req output_ev; | 138 | struct uhid_output_ev_req output_ev; |
122 | struct uhid_feature_req feature; | 139 | struct uhid_feature_req feature; |
140 | struct uhid_get_report_req get_report; | ||
123 | struct uhid_feature_answer_req feature_answer; | 141 | struct uhid_feature_answer_req feature_answer; |
142 | struct uhid_get_report_reply_req get_report_reply; | ||
124 | struct uhid_create2_req create2; | 143 | struct uhid_create2_req create2; |
125 | struct uhid_input2_req input2; | 144 | struct uhid_input2_req input2; |
126 | } u; | 145 | } u; |