]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * User level driver support for input subsystem | |
3 | * | |
4 | * Heavily based on evdev.c by Vojtech Pavlik | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation; either version 2 of the License, or | |
9 | * (at your option) any later version. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, | |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | * GNU General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with this program; if not, write to the Free Software | |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 | * | |
20 | * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> | |
221979aa | 21 | * |
1da177e4 | 22 | * Changes/Revisions: |
e3480a61 BT |
23 | * 0.4 01/09/2014 (Benjamin Tissoires <benjamin.tissoires@redhat.com>) |
24 | * - add UI_GET_SYSNAME ioctl | |
ff462551 AH |
25 | * 0.3 24/05/2006 (Anssi Hannula <anssi.hannulagmail.com>) |
26 | * - update ff support for the changes in kernel interface | |
27 | * - add UINPUT_VERSION | |
1da177e4 LT |
28 | * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>) |
29 | * - added force feedback support | |
30 | * - added UI_SET_PHYS | |
31 | * 0.1 20/06/2002 | |
32 | * - first public version | |
33 | */ | |
607ca46e DH |
34 | #ifndef __UINPUT_H_ |
35 | #define __UINPUT_H_ | |
ff462551 | 36 | |
607ca46e | 37 | #include <uapi/linux/uinput.h> |
ff462551 | 38 | |
1da177e4 LT |
39 | #define UINPUT_NAME "uinput" |
40 | #define UINPUT_BUFFER_SIZE 16 | |
41 | #define UINPUT_NUM_REQUESTS 16 | |
42 | ||
29506415 | 43 | enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED }; |
1da177e4 LT |
44 | |
45 | struct uinput_request { | |
c5b3533a DT |
46 | unsigned int id; |
47 | unsigned int code; /* UI_FF_UPLOAD, UI_FF_ERASE */ | |
1da177e4 LT |
48 | |
49 | int retval; | |
0048e603 | 50 | struct completion done; |
1da177e4 LT |
51 | |
52 | union { | |
c5b3533a | 53 | unsigned int effect_id; |
ff462551 AH |
54 | struct { |
55 | struct ff_effect *effect; | |
56 | struct ff_effect *old; | |
57 | } upload; | |
1da177e4 LT |
58 | } u; |
59 | }; | |
60 | ||
61 | struct uinput_device { | |
62 | struct input_dev *dev; | |
221979aa | 63 | struct mutex mutex; |
29506415 | 64 | enum uinput_state state; |
1da177e4 | 65 | wait_queue_head_t waitq; |
29506415 DT |
66 | unsigned char ready; |
67 | unsigned char head; | |
68 | unsigned char tail; | |
1da177e4 | 69 | struct input_event buff[UINPUT_BUFFER_SIZE]; |
05be8b81 | 70 | unsigned int ff_effects_max; |
1da177e4 LT |
71 | |
72 | struct uinput_request *requests[UINPUT_NUM_REQUESTS]; | |
73 | wait_queue_head_t requests_waitq; | |
0048e603 | 74 | spinlock_t requests_lock; |
1da177e4 | 75 | }; |
1da177e4 | 76 | #endif /* __UINPUT_H_ */ |