1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#ifndef _HIDDEV_H
26#define _HIDDEV_H
27
28#include <uapi/linux/hiddev.h>
29
30
31
32
33
34
35struct hiddev {
36 int minor;
37 int exist;
38 int open;
39 struct mutex existancelock;
40 wait_queue_head_t wait;
41 struct hid_device *hid;
42 struct list_head list;
43 spinlock_t list_lock;
44 bool initialized;
45};
46
47struct hid_device;
48struct hid_usage;
49struct hid_field;
50struct hid_report;
51
52#ifdef CONFIG_USB_HIDDEV
53int hiddev_connect(struct hid_device *hid, unsigned int force);
54void hiddev_disconnect(struct hid_device *);
55void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
56 struct hid_usage *usage, __s32 value);
57void hiddev_report_event(struct hid_device *hid, struct hid_report *report);
58#else
59static inline int hiddev_connect(struct hid_device *hid,
60 unsigned int force)
61{ return -1; }
62static inline void hiddev_disconnect(struct hid_device *hid) { }
63static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
64 struct hid_usage *usage, __s32 value) { }
65static inline void hiddev_report_event(struct hid_device *hid, struct hid_report *report) { }
66#endif
67
68#endif
69