diff options
Diffstat (limited to 'include/linux/hiddev.h')
-rw-r--r-- | include/linux/hiddev.h | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h index a416b904ba90..c760ae0eb6a1 100644 --- a/include/linux/hiddev.h +++ b/include/linux/hiddev.h | |||
@@ -182,26 +182,28 @@ struct hiddev_usage_ref_multi { | |||
182 | /* To traverse the input report descriptor info for a HID device, perform the | 182 | /* To traverse the input report descriptor info for a HID device, perform the |
183 | * following: | 183 | * following: |
184 | * | 184 | * |
185 | * rinfo.report_type = HID_REPORT_TYPE_INPUT; | 185 | * rinfo.report_type = HID_REPORT_TYPE_INPUT; |
186 | * rinfo.report_id = HID_REPORT_ID_FIRST; | 186 | * rinfo.report_id = HID_REPORT_ID_FIRST; |
187 | * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo); | 187 | * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo); |
188 | * | 188 | * |
189 | * while (ret >= 0) { | 189 | * while (ret >= 0) { |
190 | * for (i = 0; i < rinfo.num_fields; i++) { | 190 | * for (i = 0; i < rinfo.num_fields; i++) { |
191 | * finfo.report_type = rinfo.report_type; | 191 | * finfo.report_type = rinfo.report_type; |
192 | * finfo.report_id = rinfo.report_id; | 192 | * finfo.report_id = rinfo.report_id; |
193 | * finfo.field_index = i; | 193 | * finfo.field_index = i; |
194 | * ioctl(fd, HIDIOCGFIELDINFO, &finfo); | 194 | * ioctl(fd, HIDIOCGFIELDINFO, &finfo); |
195 | * for (j = 0; j < finfo.maxusage; j++) { | 195 | * for (j = 0; j < finfo.maxusage; j++) { |
196 | * uref.field_index = i; | 196 | * uref.report_type = rinfo.report_type; |
197 | * uref.usage_index = j; | 197 | * uref.report_id = rinfo.report_id; |
198 | * ioctl(fd, HIDIOCGUCODE, &uref); | 198 | * uref.field_index = i; |
199 | * ioctl(fd, HIDIOCGUSAGE, &uref); | 199 | * uref.usage_index = j; |
200 | * } | 200 | * ioctl(fd, HIDIOCGUCODE, &uref); |
201 | * } | 201 | * ioctl(fd, HIDIOCGUSAGE, &uref); |
202 | * rinfo.report_id |= HID_REPORT_ID_NEXT; | 202 | * } |
203 | * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo); | 203 | * } |
204 | * } | 204 | * rinfo.report_id |= HID_REPORT_ID_NEXT; |
205 | * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo); | ||
206 | * } | ||
205 | */ | 207 | */ |
206 | 208 | ||
207 | 209 | ||
@@ -217,7 +219,7 @@ struct hid_field; | |||
217 | struct hid_report; | 219 | struct hid_report; |
218 | 220 | ||
219 | #ifdef CONFIG_USB_HIDDEV | 221 | #ifdef CONFIG_USB_HIDDEV |
220 | int hiddev_connect(struct hid_device *); | 222 | int hiddev_connect(struct hid_device *hid, unsigned int force); |
221 | void hiddev_disconnect(struct hid_device *); | 223 | void hiddev_disconnect(struct hid_device *); |
222 | void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, | 224 | void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, |
223 | struct hid_usage *usage, __s32 value); | 225 | struct hid_usage *usage, __s32 value); |
@@ -225,7 +227,9 @@ void hiddev_report_event(struct hid_device *hid, struct hid_report *report); | |||
225 | int __init hiddev_init(void); | 227 | int __init hiddev_init(void); |
226 | void hiddev_exit(void); | 228 | void hiddev_exit(void); |
227 | #else | 229 | #else |
228 | static inline int hiddev_connect(struct hid_device *hid) { return -1; } | 230 | static inline int hiddev_connect(struct hid_device *hid, |
231 | unsigned int force) | ||
232 | { return -1; } | ||
229 | static inline void hiddev_disconnect(struct hid_device *hid) { } | 233 | static inline void hiddev_disconnect(struct hid_device *hid) { } |
230 | static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, | 234 | static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, |
231 | struct hid_usage *usage, __s32 value) { } | 235 | struct hid_usage *usage, __s32 value) { } |