summaryrefslogtreecommitdiffstats
path: root/include/linux/hid-debug.h
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2009-06-12 15:20:57 +0200
committerJiri Kosina <jkosina@suse.cz>2009-06-12 15:20:57 +0200
commitcd667ce24796700e1a0e6e7528efc61c96ff832e (patch)
tree6279001dbecb476588873402668aa761ee2f4a8f /include/linux/hid-debug.h
parenta635f9dd83f3382577f4544a96df12356e951a40 (diff)
downloadop-kernel-dev-cd667ce24796700e1a0e6e7528efc61c96ff832e.zip
op-kernel-dev-cd667ce24796700e1a0e6e7528efc61c96ff832e.tar.gz
HID: use debugfs for events/reports dumping
This is a followup patch to the one implemeting rdesc representation in debugfs rather than being dependent on compile-time CONFIG_HID_DEBUG setting. The API of the appropriate formatting functions is slightly modified -- if they are passed seq_file pointer, the one-shot output for 'rdesc' file mode is used, and therefore the message is formatted into the corresponding seq_file immediately. Otherwise the called function allocated a new buffer, formats the text into the buffer and returns the pointer to it, so that it can be queued into the ring-buffer of the processess blocked waiting on input on 'events' file in debugfs. 'debug' parameter to the 'hid' module is now used solely for the prupose of inetrnal driver state debugging (parser, transport, etc). Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/linux/hid-debug.h')
-rw-r--r--include/linux/hid-debug.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/linux/hid-debug.h b/include/linux/hid-debug.h
index 516e12c..ec08ac1 100644
--- a/include/linux/hid-debug.h
+++ b/include/linux/hid-debug.h
@@ -24,14 +24,27 @@
#ifdef CONFIG_DEBUG_FS
-void hid_dump_input(struct hid_usage *, __s32);
+void hid_dump_input(struct hid_device *, struct hid_usage *, __s32);
void hid_dump_device(struct hid_device *, struct seq_file *);
void hid_dump_field(struct hid_field *, int, struct seq_file *);
-void hid_resolv_usage(unsigned, struct seq_file *);
+char *hid_resolv_usage(unsigned, struct seq_file *);
void hid_debug_register(struct hid_device *, const char *);
void hid_debug_unregister(struct hid_device *);
void hid_debug_init(void);
void hid_debug_exit(void);
+void hid_debug_event(struct hid_device *, char *);
+
+#define HID_DEBUG_BUFSIZE 512
+
+struct hid_debug_list {
+ char *hid_debug_buf;
+ int head;
+ int tail;
+ struct fasync_struct *fasync;
+ struct hid_device *hdev;
+ struct list_head node;
+ struct mutex read_mutex;
+};
#else
@@ -44,6 +57,7 @@ void hid_debug_exit(void);
#define hid_debug_unregister(a) do { } while (0)
#define hid_debug_init() do { } while (0)
#define hid_debug_exit() do { } while (0)
+#define hid_debug_event(a,b) do { } while (0)
#endif
OpenPOWER on IntegriCloud