blob: ea7b23d13bfdf47cb9b0f5b80c654a31cf863570 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: GPL-2.0-or-later */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002#ifndef __HID_DEBUG_H
3#define __HID_DEBUG_H
4
5/*
6 * Copyright (c) 2007-2009 Jiri Kosina
7 */
8
9/*
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000010 */
11
12#ifdef CONFIG_DEBUG_FS
13
David Brazdil0f672f62019-12-10 10:32:29 +000014#include <linux/kfifo.h>
15
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000016#define HID_DEBUG_BUFSIZE 512
David Brazdil0f672f62019-12-10 10:32:29 +000017#define HID_DEBUG_FIFOSIZE 512
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000018
19void hid_dump_input(struct hid_device *, struct hid_usage *, __s32);
20void hid_dump_report(struct hid_device *, int , u8 *, int);
21void hid_dump_device(struct hid_device *, struct seq_file *);
22void hid_dump_field(struct hid_field *, int, struct seq_file *);
23char *hid_resolv_usage(unsigned, struct seq_file *);
24void hid_debug_register(struct hid_device *, const char *);
25void hid_debug_unregister(struct hid_device *);
26void hid_debug_init(void);
27void hid_debug_exit(void);
28void hid_debug_event(struct hid_device *, char *);
29
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000030struct hid_debug_list {
David Brazdil0f672f62019-12-10 10:32:29 +000031 DECLARE_KFIFO_PTR(hid_debug_fifo, char);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000032 struct fasync_struct *fasync;
33 struct hid_device *hdev;
34 struct list_head node;
35 struct mutex read_mutex;
36};
37
38#else
39
40#define hid_dump_input(a,b,c) do { } while (0)
41#define hid_dump_report(a,b,c,d) do { } while (0)
42#define hid_dump_device(a,b) do { } while (0)
43#define hid_dump_field(a,b,c) do { } while (0)
44#define hid_resolv_usage(a,b) do { } while (0)
45#define hid_debug_register(a, b) do { } while (0)
46#define hid_debug_unregister(a) do { } while (0)
47#define hid_debug_init() do { } while (0)
48#define hid_debug_exit() do { } while (0)
49#define hid_debug_event(a,b) do { } while (0)
50
51#endif
52
53#endif