Discussion:
[libhid-discuss] How to use libhid-detach-device to detach kernel hid driver for a composite device
Xiaofan Chen
2008-10-24 15:41:32 UTC
Permalink
Reference:
http://forum.microchip.com/tm.aspx?m=364987

I have a keyboard which posts as a USB composite device. To dump
the hid report descriptor under Linux, I need to detach the kernel hid driver
in order to use "lsusb -vvv" to dump the HID report descriptor. Somehow
libhid-detach-device can only detach the first interface (interface 0).

Is it possible to patch it to be able to detach other interfaces?
I am not a real programmer though...

Regards,
Xiaofan
Charles Lepple
2008-10-24 19:13:03 UTC
Permalink
Post by Xiaofan Chen
http://forum.microchip.com/tm.aspx?m=364987
The signal-to-noise ratio of that thread is pretty low. What are we
looking at?
Post by Xiaofan Chen
I have a keyboard which posts as a USB composite device. To dump
the hid report descriptor under Linux, I need to detach the kernel hid driver
in order to use "lsusb -vvv" to dump the HID report descriptor. Somehow
libhid-detach-device can only detach the first interface (interface 0).
Is it possible to patch it to be able to detach other interfaces?
I am not a real programmer though...
See http://libhid.alioth.debian.org/doc/
hid__opening_8c.html#1ca48853ebe890459271bdb99b8aaac6

The second parameter to hid_force_open() is the interface number.
--
Charles Lepple
Xiaofan Chen
2008-10-24 23:47:23 UTC
Permalink
Post by Xiaofan Chen
http://forum.microchip.com/tm.aspx?m=364987
The signal-to-noise ratio of that thread is pretty low. What are we looking
at?
Post 14, 19 and 20 in the thread.
Post by Xiaofan Chen
I have a keyboard which posts as a USB composite device. To dump
the hid report descriptor under Linux, I need to detach the kernel hid driver
in order to use "lsusb -vvv" to dump the HID report descriptor. Somehow
libhid-detach-device can only detach the first interface (interface 0).
Is it possible to patch it to be able to detach other interfaces?
I am not a real programmer though...
See
http://libhid.alioth.debian.org/doc/hid__opening_8c.html#1ca48853ebe890459271bdb99b8aaac6
The second parameter to hid_force_open() is the interface number.
So we can patch the file libhid-detach-device to have one more parameter
to do the job. Thanks for the hints.
http://libhid.alioth.debian.org/doc/libhid-detach-device_8c-source.html#l00011

Regards,
Xiaofan

Loading...