Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 #ifndef __HID_DEBUG_H
0003 #define __HID_DEBUG_H
0004 
0005 /*
0006  *  Copyright (c) 2007-2009 Jiri Kosina
0007  */
0008 
0009 /*
0010  */
0011 
0012 #ifdef CONFIG_DEBUG_FS
0013 
0014 #include <linux/kfifo.h>
0015 
0016 #define HID_DEBUG_BUFSIZE 512
0017 #define HID_DEBUG_FIFOSIZE 512
0018 
0019 void hid_dump_input(struct hid_device *, struct hid_usage *, __s32);
0020 void hid_dump_report(struct hid_device *, int , u8 *, int);
0021 void hid_dump_device(struct hid_device *, struct seq_file *);
0022 void hid_dump_field(struct hid_field *, int, struct seq_file *);
0023 char *hid_resolv_usage(unsigned, struct seq_file *);
0024 void hid_debug_register(struct hid_device *, const char *);
0025 void hid_debug_unregister(struct hid_device *);
0026 void hid_debug_init(void);
0027 void hid_debug_exit(void);
0028 void hid_debug_event(struct hid_device *, char *);
0029 
0030 struct hid_debug_list {
0031     DECLARE_KFIFO_PTR(hid_debug_fifo, char);
0032     struct fasync_struct *fasync;
0033     struct hid_device *hdev;
0034     struct list_head node;
0035     struct mutex read_mutex;
0036 };
0037 
0038 #else
0039 
0040 #define hid_dump_input(a,b,c)       do { } while (0)
0041 #define hid_dump_report(a,b,c,d)    do { } while (0)
0042 #define hid_dump_device(a,b)        do { } while (0)
0043 #define hid_dump_field(a,b,c)       do { } while (0)
0044 #define hid_resolv_usage(a,b)       do { } while (0)
0045 #define hid_debug_register(a, b)    do { } while (0)
0046 #define hid_debug_unregister(a)     do { } while (0)
0047 #define hid_debug_init()        do { } while (0)
0048 #define hid_debug_exit()        do { } while (0)
0049 #define hid_debug_event(a,b)        do { } while (0)
0050 
0051 #endif
0052 
0053 #endif