aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid/hid-core.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2009-06-12 09:20:55 -0400
committerJiri Kosina <jkosina@suse.cz>2009-06-12 09:20:55 -0400
commita635f9dd83f3382577f4544a96df12356e951a40 (patch)
treec6fa27df6d01c34e304a32c9f423d569f7358346 /drivers/hid/usbhid/hid-core.c
parent8ebf975608aaebd7feb33d77f07ba21a6380e086 (diff)
HID: use debugfs for report dumping descriptor
It is a little bit inconvenient for people who have some non-standard HID hardware (usually violating the HID specification) to have to recompile kernel with CONFIG_HID_DEBUG to be able to see kernel's perspective of the HID report descriptor and observe the parsed events. Plus the messages are then mixed up inconveniently with the rest of the dmesg stuff. This patch implements /sys/kernel/debug/hid/<device>/rdesc file, which represents the kernel's view of report descriptor (both the raw report descriptor data and parsed contents). With all the device-specific debug data being available through debugfs, there is no need for keeping CONFIG_HID_DEBUG, as the 'debug' parameter to the hid module will now only output only driver-specific debugging options, which has absolutely minimal memory footprint, just a few error messages and one global flag (hid_debug). We use the current set of output formatting functions. The ones that need to be used both for one-shot rdesc seq_file and also for continuous flow of data (individual reports, as being sent by the device) distinguish according to the passed seq_file parameter, and if it is NULL, it still output to kernel ringbuffer, otherwise the corresponding seq_file is used for output. The format of the output is preserved. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid/hid-core.c')
-rw-r--r--drivers/hid/usbhid/hid-core.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index ac8049b5f1e..708aa52d075 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -4,8 +4,8 @@
4 * Copyright (c) 1999 Andreas Gal 4 * Copyright (c) 1999 Andreas Gal
5 * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> 5 * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
6 * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc 6 * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
7 * Copyright (c) 2006-2008 Jiri Kosina
8 * Copyright (c) 2007-2008 Oliver Neukum 7 * Copyright (c) 2007-2008 Oliver Neukum
8 * Copyright (c) 2006-2009 Jiri Kosina
9 */ 9 */
10 10
11/* 11/*
@@ -886,11 +886,6 @@ static int usbhid_parse(struct hid_device *hid)
886 goto err; 886 goto err;
887 } 887 }
888 888
889 dbg_hid("report descriptor (size %u, read %d) = ", rsize, n);
890 for (n = 0; n < rsize; n++)
891 dbg_hid_line(" %02x", (unsigned char) rdesc[n]);
892 dbg_hid_line("\n");
893
894 ret = hid_parse_report(hid, rdesc, rsize); 889 ret = hid_parse_report(hid, rdesc, rsize);
895 kfree(rdesc); 890 kfree(rdesc);
896 if (ret) { 891 if (ret) {
@@ -1005,7 +1000,6 @@ static int usbhid_start(struct hid_device *hid)
1005 usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); 1000 usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP);
1006 1001
1007 usbhid_init_reports(hid); 1002 usbhid_init_reports(hid);
1008 hid_dump_device(hid);
1009 1003
1010 set_bit(HID_STARTED, &usbhid->iofl); 1004 set_bit(HID_STARTED, &usbhid->iofl);
1011 1005