On Sun, 7 Jul 2013 10:37:59 -0700, Greg KH wrote:
On Sun, Jul 07, 2013 at 07:17:40PM +0200, pchavent wrote:
Hi.
lsusb doesn't handle 32 bits Usage tags.
I've tried to do a patch but i'm not confident in its
implementation.
Do you have a HID descriptor with a 32bit usage tag? I don't think
anyone has seen these before, are they new?
thanks,
greg k-h
Hi
Sorry, i sent you a wrong patch (i join a better one).
Indeed, i build a device that convert some pwm signals for flight
simulation purpose. I would like to give several "Usage" for each way
(standard joystick, plane simulation, helicopter simulation). So i have
followed the examples in the "Universal Serial Bus HID Usage Tables"
(appendix b page 145) [1].
I know that linux doesn't care about alternative usage tags, but for
debugging my device i would like to be able to see a good Report
Descriptor.
[1] http://www.usb.org/developers/devclass_docs/Hut1_11.pdf
Regards.
From 5cf9e1d37b0df0e261b2c0dd03b01cf7cad53320 Mon Sep 17 00:00:00 2001
From: Paul Chavent <paul.chavent@xxxxxxxx>
Date: Sun, 7 Jul 2013 19:09:32 +0200
Subject: [PATCH] Fix 32 bits usage tags.
---
lsusb.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lsusb.c b/lsusb.c
index 29af933..800f535 100644
--- a/lsusb.c
+++ b/lsusb.c
@@ -2810,8 +2810,14 @@ static void dump_report_desc(unsigned char *b, int l)
case 0x08: /* Usage */
case 0x18: /* Usage Minimum */
case 0x28: /* Usage Maximum */
- printf("%s%s\n", indent,
- names_hutus((hut << 16) + data));
+ if (bsize<=2) {
+ printf("%s%s\n", indent,
+ names_hutus((hut << 16) + data));
+ }
+ else if (bsize<=4) {
+ printf("%s%s\n", indent,
+ names_hutus(data));
+ }
break;
case 0x54: /* Unit Exponent */
--
1.7.12.1