Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
uinput.h
Go to the documentation of this file.
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 <[email protected]>
21  *
22  * Changes/Revisions:
23  * 0.3 24/05/2006 (Anssi Hannula <anssi.hannulagmail.com>)
24  * - update ff support for the changes in kernel interface
25  * - add UINPUT_VERSION
26  * 0.2 16/10/2004 (Micah Dowty <[email protected]>)
27  * - added force feedback support
28  * - added UI_SET_PHYS
29  * 0.1 20/06/2002
30  * - first public version
31  */
32 #ifndef __UINPUT_H_
33 #define __UINPUT_H_
34 
35 #include <uapi/linux/uinput.h>
36 
37 #define UINPUT_NAME "uinput"
38 #define UINPUT_BUFFER_SIZE 16
39 #define UINPUT_NUM_REQUESTS 16
40 
42 
44  unsigned int id;
45  unsigned int code; /* UI_FF_UPLOAD, UI_FF_ERASE */
46 
47  int retval;
48  struct completion done;
49 
50  union {
51  unsigned int effect_id;
52  struct {
53  struct ff_effect *effect;
54  struct ff_effect *old;
55  } upload;
56  } u;
57 };
58 
59 struct uinput_device {
60  struct input_dev *dev;
61  struct mutex mutex;
64  unsigned char ready;
65  unsigned char head;
66  unsigned char tail;
68  unsigned int ff_effects_max;
69 
73 };
74 #endif /* __UINPUT_H_ */