Thomas Gleixner | 1a59d1b8 | 2019-05-27 08:55:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Jiri Kosina | c080d89 | 2007-01-25 11:43:31 +0100 | [diff] [blame] | 2 | #ifndef __HID_DEBUG_H |
| 3 | #define __HID_DEBUG_H |
| 4 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | /* |
Jiri Kosina | a635f9d | 2009-06-12 15:20:55 +0200 | [diff] [blame] | 6 | * Copyright (c) 2007-2009 Jiri Kosina |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | */ |
| 11 | |
Jiri Kosina | a635f9d | 2009-06-12 15:20:55 +0200 | [diff] [blame] | 12 | #ifdef CONFIG_DEBUG_FS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
Vladis Dronov | 13054ab | 2019-01-29 11:58:35 +0100 | [diff] [blame] | 14 | #include <linux/kfifo.h> |
| 15 | |
Benjamin Tissoires | a5f04b9 | 2013-04-17 19:38:13 +0200 | [diff] [blame] | 16 | #define HID_DEBUG_BUFSIZE 512 |
Vladis Dronov | 13054ab | 2019-01-29 11:58:35 +0100 | [diff] [blame] | 17 | #define HID_DEBUG_FIFOSIZE 512 |
Benjamin Tissoires | a5f04b9 | 2013-04-17 19:38:13 +0200 | [diff] [blame] | 18 | |
Jiri Kosina | cd667ce | 2009-06-12 15:20:57 +0200 | [diff] [blame] | 19 | void hid_dump_input(struct hid_device *, struct hid_usage *, __s32); |
Benjamin Tissoires | a5f04b9 | 2013-04-17 19:38:13 +0200 | [diff] [blame] | 20 | void hid_dump_report(struct hid_device *, int , u8 *, int); |
Jiri Kosina | a635f9d | 2009-06-12 15:20:55 +0200 | [diff] [blame] | 21 | void hid_dump_device(struct hid_device *, struct seq_file *); |
| 22 | void hid_dump_field(struct hid_field *, int, struct seq_file *); |
Jiri Kosina | cd667ce | 2009-06-12 15:20:57 +0200 | [diff] [blame] | 23 | char *hid_resolv_usage(unsigned, struct seq_file *); |
Jiri Kosina | a635f9d | 2009-06-12 15:20:55 +0200 | [diff] [blame] | 24 | void hid_debug_register(struct hid_device *, const char *); |
| 25 | void hid_debug_unregister(struct hid_device *); |
| 26 | void hid_debug_init(void); |
| 27 | void hid_debug_exit(void); |
Jiri Kosina | cd667ce | 2009-06-12 15:20:57 +0200 | [diff] [blame] | 28 | void hid_debug_event(struct hid_device *, char *); |
| 29 | |
Jiri Kosina | cd667ce | 2009-06-12 15:20:57 +0200 | [diff] [blame] | 30 | struct hid_debug_list { |
Vladis Dronov | 13054ab | 2019-01-29 11:58:35 +0100 | [diff] [blame] | 31 | DECLARE_KFIFO_PTR(hid_debug_fifo, char); |
Jiri Kosina | cd667ce | 2009-06-12 15:20:57 +0200 | [diff] [blame] | 32 | struct fasync_struct *fasync; |
| 33 | struct hid_device *hdev; |
| 34 | struct list_head node; |
| 35 | struct mutex read_mutex; |
| 36 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
Jiri Kosina | c080d89 | 2007-01-25 11:43:31 +0100 | [diff] [blame] | 38 | #else |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
Jiri Kosina | 38b7f49 | 2009-06-26 10:48:34 +0200 | [diff] [blame] | 40 | #define hid_dump_input(a,b,c) do { } while (0) |
Benjamin Tissoires | a5f04b9 | 2013-04-17 19:38:13 +0200 | [diff] [blame] | 41 | #define hid_dump_report(a,b,c,d) do { } while (0) |
Jiri Kosina | 38b7f49 | 2009-06-26 10:48:34 +0200 | [diff] [blame] | 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) |
Jiri Kosina | a635f9d | 2009-06-12 15:20:55 +0200 | [diff] [blame] | 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) |
Jiri Kosina | cd667ce | 2009-06-12 15:20:57 +0200 | [diff] [blame] | 49 | #define hid_debug_event(a,b) do { } while (0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
Jiri Kosina | a635f9d | 2009-06-12 15:20:55 +0200 | [diff] [blame] | 51 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
Jiri Kosina | c080d89 | 2007-01-25 11:43:31 +0100 | [diff] [blame] | 53 | #endif |