diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-24 16:30:14 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-24 16:30:14 -0400 |
| commit | e8ff13b0bf88b5e696323a1eec877783d965b3c6 (patch) | |
| tree | aa55093da5ee435f0d2fa8ffede8973f426dbd67 /include/linux | |
| parent | 0cd5ff591ab6473355d5a6a47f7694def28e451d (diff) | |
| parent | c062c4d1de57789bf15f7641a24c429eeb8a1c6a (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID updates from Jiri Kosina:
"The list of changes worth pointing out explicitly:
- We are getting 'UHID', which is a new framework for implementing HID
transport drivers in userspace (this is different from HIDRAW, which
is transport-independent and provides report parsing facilities;
uhid is for the other (transport) part of the pipeline).
It's needed for (and currently being used by) Bluetooth-LowEnergy,
as its specification mandates things we don't want in the kernel.
Written by David Herrmann.
- there have been quite a few bugs in runtime suspend/resume paths
(probably never reported to actually happen in the wild, but still).
Alan Stern fixed those.
- a few other driver updates and fixes and random new device support."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (45 commits)
HID: add ASUS AIO keyboard model AK1D
HID: add support for Cypress barcode scanner 04B4:ED81
HID: Allow drivers to be their own listener
HID: usbhid: fix error paths in suspend
HID: usbhid: check for suspend or reset before restarting
HID: usbhid: replace HID_REPORTED_IDLE with HID_SUSPENDED
HID: usbhid: inline some simple routines
HID: usbhid: fix autosuspend calls
HID: usbhid: fix use-after-free bug
HID: hid-core: optimize in case of hidraw
HID: hidraw: fix list->buffer memleak
HID: uhid: Fix sending events with invalid data
HID: roccat: added sensor sysfs attribute for Savu
HID: Add driver for Holtek based keyboards with broken HID
HID: Add suport for the brightness control keys on HP keyboards
HID: magicmouse: Implement Multi-touch Protocol B (MT-B)
HID: magicmouse: Removing report_touches switch
HID: roccat: rename roccat_common functions to roccat_common2
HID: roccat: fix wrong hid_err usage on struct usb_device
HID: roccat: move functionality to roccat-common
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/Kbuild | 1 | ||||
| -rw-r--r-- | include/linux/hid.h | 1 | ||||
| -rw-r--r-- | include/linux/uhid.h | 104 |
3 files changed, 106 insertions, 0 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 8760be30b375..cb2a7d1ad47b 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -376,6 +376,7 @@ header-y += tty.h | |||
| 376 | header-y += types.h | 376 | header-y += types.h |
| 377 | header-y += udf_fs_i.h | 377 | header-y += udf_fs_i.h |
| 378 | header-y += udp.h | 378 | header-y += udp.h |
| 379 | header-y += uhid.h | ||
| 379 | header-y += uinput.h | 380 | header-y += uinput.h |
| 380 | header-y += uio.h | 381 | header-y += uio.h |
| 381 | header-y += ultrasound.h | 382 | header-y += ultrasound.h |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 449fa385703d..42970de1b40c 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -200,6 +200,7 @@ struct hid_item { | |||
| 200 | #define HID_UP_DIGITIZER 0x000d0000 | 200 | #define HID_UP_DIGITIZER 0x000d0000 |
| 201 | #define HID_UP_PID 0x000f0000 | 201 | #define HID_UP_PID 0x000f0000 |
| 202 | #define HID_UP_HPVENDOR 0xff7f0000 | 202 | #define HID_UP_HPVENDOR 0xff7f0000 |
| 203 | #define HID_UP_HPVENDOR2 0xff010000 | ||
| 203 | #define HID_UP_MSVENDOR 0xff000000 | 204 | #define HID_UP_MSVENDOR 0xff000000 |
| 204 | #define HID_UP_CUSTOM 0x00ff0000 | 205 | #define HID_UP_CUSTOM 0x00ff0000 |
| 205 | #define HID_UP_LOGIVENDOR 0xffbc0000 | 206 | #define HID_UP_LOGIVENDOR 0xffbc0000 |
diff --git a/include/linux/uhid.h b/include/linux/uhid.h new file mode 100644 index 000000000000..9c6974f16966 --- /dev/null +++ b/include/linux/uhid.h | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | #ifndef __UHID_H_ | ||
| 2 | #define __UHID_H_ | ||
| 3 | |||
| 4 | /* | ||
| 5 | * User-space I/O driver support for HID subsystem | ||
| 6 | * Copyright (c) 2012 David Herrmann | ||
| 7 | */ | ||
| 8 | |||
| 9 | /* | ||
| 10 | * This program is free software; you can redistribute it and/or modify it | ||
| 11 | * under the terms of the GNU General Public License as published by the Free | ||
| 12 | * Software Foundation; either version 2 of the License, or (at your option) | ||
| 13 | * any later version. | ||
| 14 | */ | ||
| 15 | |||
| 16 | /* | ||
| 17 | * Public header for user-space communication. We try to keep every structure | ||
| 18 | * aligned but to be safe we also use __attribute__((__packed__)). Therefore, | ||
| 19 | * the communication should be ABI compatible even between architectures. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <linux/input.h> | ||
| 23 | #include <linux/types.h> | ||
| 24 | |||
| 25 | enum uhid_event_type { | ||
| 26 | UHID_CREATE, | ||
| 27 | UHID_DESTROY, | ||
| 28 | UHID_START, | ||
| 29 | UHID_STOP, | ||
| 30 | UHID_OPEN, | ||
| 31 | UHID_CLOSE, | ||
| 32 | UHID_OUTPUT, | ||
| 33 | UHID_OUTPUT_EV, | ||
| 34 | UHID_INPUT, | ||
| 35 | UHID_FEATURE, | ||
| 36 | UHID_FEATURE_ANSWER, | ||
| 37 | }; | ||
| 38 | |||
| 39 | struct uhid_create_req { | ||
| 40 | __u8 name[128]; | ||
| 41 | __u8 phys[64]; | ||
| 42 | __u8 uniq[64]; | ||
| 43 | __u8 __user *rd_data; | ||
| 44 | __u16 rd_size; | ||
| 45 | |||
| 46 | __u16 bus; | ||
| 47 | __u32 vendor; | ||
| 48 | __u32 product; | ||
| 49 | __u32 version; | ||
| 50 | __u32 country; | ||
| 51 | } __attribute__((__packed__)); | ||
| 52 | |||
| 53 | #define UHID_DATA_MAX 4096 | ||
| 54 | |||
| 55 | enum uhid_report_type { | ||
| 56 | UHID_FEATURE_REPORT, | ||
| 57 | UHID_OUTPUT_REPORT, | ||
| 58 | UHID_INPUT_REPORT, | ||
| 59 | }; | ||
| 60 | |||
| 61 | struct uhid_input_req { | ||
| 62 | __u8 data[UHID_DATA_MAX]; | ||
| 63 | __u16 size; | ||
| 64 | } __attribute__((__packed__)); | ||
| 65 | |||
| 66 | struct uhid_output_req { | ||
| 67 | __u8 data[UHID_DATA_MAX]; | ||
| 68 | __u16 size; | ||
| 69 | __u8 rtype; | ||
| 70 | } __attribute__((__packed__)); | ||
| 71 | |||
| 72 | struct uhid_output_ev_req { | ||
| 73 | __u16 type; | ||
| 74 | __u16 code; | ||
| 75 | __s32 value; | ||
| 76 | } __attribute__((__packed__)); | ||
| 77 | |||
| 78 | struct uhid_feature_req { | ||
| 79 | __u32 id; | ||
| 80 | __u8 rnum; | ||
| 81 | __u8 rtype; | ||
| 82 | } __attribute__((__packed__)); | ||
| 83 | |||
| 84 | struct uhid_feature_answer_req { | ||
| 85 | __u32 id; | ||
| 86 | __u16 err; | ||
| 87 | __u16 size; | ||
| 88 | __u8 data[UHID_DATA_MAX]; | ||
| 89 | }; | ||
| 90 | |||
| 91 | struct uhid_event { | ||
| 92 | __u32 type; | ||
| 93 | |||
| 94 | union { | ||
| 95 | struct uhid_create_req create; | ||
| 96 | struct uhid_input_req input; | ||
| 97 | struct uhid_output_req output; | ||
| 98 | struct uhid_output_ev_req output_ev; | ||
| 99 | struct uhid_feature_req feature; | ||
| 100 | struct uhid_feature_answer_req feature_answer; | ||
| 101 | } u; | ||
| 102 | } __attribute__((__packed__)); | ||
| 103 | |||
| 104 | #endif /* __UHID_H_ */ | ||
