Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *  Copyright (c) 1999-2000 Vojtech Pavlik
0004  *
0005  *  Sponsored by SuSE
0006  */
0007 /*
0008  * 
0009  * Should you need to contact me, the author, you can do so either by
0010  * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
0011  * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
0012  */
0013 #ifndef _HIDDEV_H
0014 #define _HIDDEV_H
0015 
0016 #include <uapi/linux/hiddev.h>
0017 
0018 
0019 /*
0020  * In-kernel definitions.
0021  */
0022 
0023 struct hiddev {
0024     int minor;
0025     int exist;
0026     int open;
0027     struct mutex existancelock;
0028     wait_queue_head_t wait;
0029     struct hid_device *hid;
0030     struct list_head list;
0031     spinlock_t list_lock;
0032     bool initialized;
0033 };
0034 
0035 struct hid_device;
0036 struct hid_usage;
0037 struct hid_field;
0038 struct hid_report;
0039 
0040 #ifdef CONFIG_USB_HIDDEV
0041 int hiddev_connect(struct hid_device *hid, unsigned int force);
0042 void hiddev_disconnect(struct hid_device *);
0043 void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
0044               struct hid_usage *usage, __s32 value);
0045 void hiddev_report_event(struct hid_device *hid, struct hid_report *report);
0046 #else
0047 static inline int hiddev_connect(struct hid_device *hid,
0048         unsigned int force)
0049 { return -1; }
0050 static inline void hiddev_disconnect(struct hid_device *hid) { }
0051 static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
0052               struct hid_usage *usage, __s32 value) { }
0053 static inline void hiddev_report_event(struct hid_device *hid, struct hid_report *report) { }
0054 #endif
0055 
0056 #endif