Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  Copyright (c) 2007 Jiri Kosina
0004  */
0005 #ifndef _HIDRAW_H
0006 #define _HIDRAW_H
0007 
0008 #include <uapi/linux/hidraw.h>
0009 
0010 
0011 struct hidraw {
0012     unsigned int minor;
0013     int exist;
0014     int open;
0015     wait_queue_head_t wait;
0016     struct hid_device *hid;
0017     struct device *dev;
0018     spinlock_t list_lock;
0019     struct list_head list;
0020 };
0021 
0022 struct hidraw_report {
0023     __u8 *value;
0024     int len;
0025 };
0026 
0027 struct hidraw_list {
0028     struct hidraw_report buffer[HIDRAW_BUFFER_SIZE];
0029     int head;
0030     int tail;
0031     struct fasync_struct *fasync;
0032     struct hidraw *hidraw;
0033     struct list_head node;
0034     struct mutex read_mutex;
0035 };
0036 
0037 #ifdef CONFIG_HIDRAW
0038 int hidraw_init(void);
0039 void hidraw_exit(void);
0040 int hidraw_report_event(struct hid_device *, u8 *, int);
0041 int hidraw_connect(struct hid_device *);
0042 void hidraw_disconnect(struct hid_device *);
0043 #else
0044 static inline int hidraw_init(void) { return 0; }
0045 static inline void hidraw_exit(void) { }
0046 static inline int hidraw_report_event(struct hid_device *hid, u8 *data, int len) { return 0; }
0047 static inline int hidraw_connect(struct hid_device *hid) { return -1; }
0048 static inline void hidraw_disconnect(struct hid_device *hid) { }
0049 #endif
0050 
0051 #endif