Loading...
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (c) 2007 Jiri Kosina
4 */
5#ifndef _HIDRAW_H
6#define _HIDRAW_H
7
8#include <uapi/linux/hidraw.h>
9
10
11struct hidraw {
12 unsigned int minor;
13 int exist;
14 int open;
15 wait_queue_head_t wait;
16 struct hid_device *hid;
17 struct device *dev;
18 spinlock_t list_lock;
19 struct list_head list;
20};
21
22struct hidraw_report {
23 __u8 *value;
24 int len;
25};
26
27struct hidraw_list {
28 struct hidraw_report buffer[HIDRAW_BUFFER_SIZE];
29 int head;
30 int tail;
31 struct fasync_struct *fasync;
32 struct hidraw *hidraw;
33 struct list_head node;
34 struct mutex read_mutex;
35};
36
37#ifdef CONFIG_HIDRAW
38int hidraw_init(void);
39void hidraw_exit(void);
40int hidraw_report_event(struct hid_device *, u8 *, int);
41int hidraw_connect(struct hid_device *);
42void hidraw_disconnect(struct hid_device *);
43#else
44static inline int hidraw_init(void) { return 0; }
45static inline void hidraw_exit(void) { }
46static inline int hidraw_report_event(struct hid_device *hid, u8 *data, int len) { return 0; }
47static inline int hidraw_connect(struct hid_device *hid) { return -1; }
48static inline void hidraw_disconnect(struct hid_device *hid) { }
49#endif
50
51#endif
1/*
2 * Copyright (c) 2007 Jiri Kosina
3 */
4/*
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * You should have received a copy of the GNU General Public License along with
10 * this program; if not, write to the Free Software Foundation, Inc.,
11 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
12 */
13#ifndef _HIDRAW_H
14#define _HIDRAW_H
15
16#include <uapi/linux/hidraw.h>
17
18
19struct hidraw {
20 unsigned int minor;
21 int exist;
22 int open;
23 wait_queue_head_t wait;
24 struct hid_device *hid;
25 struct device *dev;
26 spinlock_t list_lock;
27 struct list_head list;
28};
29
30struct hidraw_report {
31 __u8 *value;
32 int len;
33};
34
35struct hidraw_list {
36 struct hidraw_report buffer[HIDRAW_BUFFER_SIZE];
37 int head;
38 int tail;
39 struct fasync_struct *fasync;
40 struct hidraw *hidraw;
41 struct list_head node;
42 struct mutex read_mutex;
43};
44
45#ifdef CONFIG_HIDRAW
46int hidraw_init(void);
47void hidraw_exit(void);
48int hidraw_report_event(struct hid_device *, u8 *, int);
49int hidraw_connect(struct hid_device *);
50void hidraw_disconnect(struct hid_device *);
51#else
52static inline int hidraw_init(void) { return 0; }
53static inline void hidraw_exit(void) { }
54static inline int hidraw_report_event(struct hid_device *hid, u8 *data, int len) { return 0; }
55static inline int hidraw_connect(struct hid_device *hid) { return -1; }
56static inline void hidraw_disconnect(struct hid_device *hid) { }
57#endif
58
59#endif