[libhid-discuss] error sending control message
Brent Bushnell
brent at uwink.com
Fri Feb 13 20:27:21 UTC 2009
Thanks Xiaofan.
Interestingly, I can only seem to get the report descriptors for
second of the report descriptors.
[root at host1 usbhid]# lsusb
<snip>
Bus 003 Device 003: ID 154a:0004
<snip>
[root at host1 src]# ./libhid-detach-device 154a:0004
Trying to detach HID with IDs 154a:0004... done.
[root at host1 src]# lsusb -d 154a:0004 -vvv
Bus 002 Device 004: ID 154a:0004
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x154a
idProduct 0x0004
bcdDevice 1.08
iManufacturer 1 ID Innovations Inc.
iProduct 2 Magnetic Card Reader
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 59
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 4 Input Device
bmAttributes 0x80
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Devices
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 1 Keyboard
iInterface 5 HID Keyboard Interface
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.00
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 59
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Devices
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 6 Serial Interface
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.00
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 97
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
[root at host1 usbhid]# dmesg | tail
input: USB HID v1.00 Keyboard [ID Innovations Inc. Magnetic Card
Reader] on usb-0000:00:1d.2-2
hiddev97: USB HID v1.00 Device [ID Innovations Inc. Magnetic Card
Reader] on usb-0000:00:1d.2-2
usb 1-1: USB disconnect, address 4
usb 1-1.1: USB disconnect, address 5
usb 3-1: new low speed USB device using uhci_hcd and address 4
usb 3-1: configuration #1 chosen from 1 choice
input: CHESEN PS2 to USB Converter as /class/input/input5
input: USB HID v1.10 Keyboard [CHESEN PS2 to USB Converter] on
usb-0000:00:1d.2-1
input: CHESEN PS2 to USB Converter as /class/input/input6
input: USB HID v1.10 Mouse [CHESEN PS2 to USB Converter] on
usb-0000:00:1d.2-1
[root at host1 usbhid]# cd /sys/bus/usb/drivers/usbhid
[root at host1 usbhid]# ls
3-1:1.0 3-1:1.1 3-2:1.0 3-2:1.1 4-1:1.0 4-1:1.1 4-2:1.0 bind
new_id unbind
[root at host1 usbhid]# echo -n 3-2\:1.0 > unbind
[root at host1 usbhid]# echo -n 3-2\:1.1 > unbind
[root at host1 usbhid]# lsusb -d 154a:0004 -vvv
Bus 003 Device 005: ID 154a:0004
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x154a
idProduct 0x0004
bcdDevice 1.08
iManufacturer 1 ID Innovations Inc.
iProduct 2 Magnetic Card Reader
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 59
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 4 Input Device
bmAttributes 0x80
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Devices
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 1 Keyboard
iInterface 5 HID Keyboard Interface
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.00
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 59
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Devices
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 6 Serial Interface
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.00
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 97
Report Descriptor: (length is 97)
Item(Global): Usage Page, data= [ 0xa0 0xff ] 65440
(null)
Item(Local ): Usage, data= [ 0x01 ] 1
(null)
Item(Main ): Collection, data= [ 0x01 ] 1
Application
Item(Global): Report ID, data= [ 0x02 ] 2
Item(Local ): Usage, data= [ 0x01 ] 1
(null)
Item(Global): Logical Minimum, data= [ 0x00 ] 0
Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Global): Report Count, data= [ 0x06 ] 6
Item(Main ): Input, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Local ): Usage, data= [ 0x02 ] 2
(null)
Item(Global): Report Count, data= [ 0x07 ] 7
Item(Main ): Output, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Local ): Usage, data= [ 0x03 ] 3
(null)
Item(Global): Report Count, data= [ 0x06 ] 6
Item(Main ): Feature, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Main ): End Collection, data=none
Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
(null)
Item(Local ): Usage, data= [ 0x04 ] 4
(null)
Item(Main ): Collection, data= [ 0x01 ] 1
Application
Item(Global): Report ID, data= [ 0x03 ] 3
Item(Global): Logical Minimum, data= [ 0x00 ] 0
Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Local ): Usage, data= [ 0x20 ] 32
(null)
Item(Local ): Usage, data= [ 0x21 ] 33
(null)
Item(Local ): Usage, data= [ 0x22 ] 34
(null)
Item(Local ): Usage, data= [ 0x28 ] 40
(null)
Item(Local ): Usage, data= [ 0x29 ] 41
(null)
Item(Local ): Usage, data= [ 0x2a ] 42
(null)
Item(Local ): Usage, data= [ 0x38 ] 56
(null)
Item(Global): Report Count, data= [ 0x07 ] 7
Item(Main ): Input, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Local ): Usage, data= [ 0x30 ] 48
(null)
Item(Global): Report Count, data= [ 0x6e ] 110
Item(Main ): Input, data= [ 0x02 0x01 ] 258
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Buffered Bytes
Item(Local ): Usage, data= [ 0x31 ] 49
(null)
Item(Global): Report Count, data= [ 0x6e ] 110
Item(Main ): Input, data= [ 0x02 0x01 ] 258
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Buffered Bytes
Item(Local ): Usage, data= [ 0x32 ] 50
(null)
Item(Global): Report Count, data= [ 0x6e ] 110
Item(Main ): Input, data= [ 0x02 0x01 ] 258
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Buffered Bytes
Item(Local ): Usage, data= [ 0x03 ] 3
(null)
Item(Global): Report Count, data= [ 0x06 ] 6
Item(Main ): Feature, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Main ): End Collection, data=none
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
On Feb 3, 2009, at 7:46 PM, Xiaofan Chen wrote:
> On Wed, Feb 4, 2009 at 9:44 AM, Charles Lepple <clepple at ghz.cc> wrote:
>> On Feb 3, 2009, at 3:25 PM, Brent Bushnell wrote:
>>
>>> For what it's worth, we're having the same issue with a magnetic
>>> stripe reader from ID Innovations. Of special interest also, is
>>> that the report descriptors are unavailable.
>>
>> Apologies if you've been down this road already, but lsusb won't be
>> able to see the report descriptors unless you have detached the
>> kernel's usbhid driver from the interface(s). This is done
>> automatically in usb_force_open(), and only stays in effect until you
>> unplug the device. There is also a libhid-detach-device program in
>> libhid*/src/ that will do just that.
>>
>
> I believe libhid-detach-device only detaches the first interface.
>
> Here is a better method by Alan Stern.
> http://www.nabble.com/How-to-dump-HID-report-descriptor-under-Linux-td19609562.html
>
> Regards,
> Xiaofan
More information about the libhid-discuss
mailing list