|
From: Xiaofan C. <xia...@gm...> - 2008-10-24 23:24:19
|
On Sat, Oct 25, 2008 at 12:23 AM, Alan Stern <st...@ro...> wrote: > On Fri, 24 Oct 2008, Xiaofan Chen wrote: >> > Is there a simple program to dump the HID report descriptors >> > under Linux? >> >> It turns out lsusb at least partially works. I need to detach the default >> hiddev kernel driver. >> http://forum.microchip.com/tm.aspx?m=364987 Post 19. >> >> Now the question is how to detach hiddev from interface 1. >> libhid-detach-device seems to only work for interface 0. > > You can detach and attach drivers by hand. To unbind hiddev from a > device: > > cd /sys/bus/usb/drivers/hiddev > ls > > Find the filename for the interface you want to unbind. Interface > filenames have the form > > B-P:C.I I could not find interface filenames there. mcuee@Ubuntu804:/sys/bus/usb/drivers/hiddev$ ls bind module new_id uevent unbind mcuee@Ubuntu804:/sys/bus/usb/drivers/hiddev$ dmesg [ 620.961917] usb 1-7: new low speed USB device using ohci_hcd and address 7 [ 621.176180] usb 1-7: configuration #1 chosen from 1 choice [ 621.186221] input: Chicony USB Keyboard as /devices/pci0000:00/0000:00:04.0/usb1/1-7/1-7:1.0/input/input4 [ 621.227350] input,hidraw2: USB HID v1.11 Keyboard [Chicony USB Keyboard] on usb-0000:00:04.0-7 [ 621.239956] input: Chicony USB Keyboard as /devices/pci0000:00/0000:00:04.0/usb1/1-7/1-7:1.1/input/input5 [ 621.292261] input,hiddev97,hidraw3: USB HID v1.11 Device [Chicony USB Keyboard] on usb-0000:00:04.0-7 mcuee@Ubuntu804:/sys/bus/usb/drivers/hiddev$ uname -a Linux Ubuntu804 2.6.24-21-generic #1 SMP Mon Aug 25 17:32:09 UTC 2008 i686 GNU/Linux > where B is the bus number, P is a string of port numbers separated by > periods, C is the configuration value, and I is the interface number. > Having found the filename for the interface you want to unbind, do > > echo -n interface-filename >unbind > > To re-attach the driver, do > > echo -n interface-filename >bind > While I wrote the above, I found it is actually inside /sys/bus/usb/drivers/usbhid. mcuee@Ubuntu804:/sys/bus/usb/drivers/usbhid$ lsusb Bus 001 Device 007: ID 04f2:0760 Chicony Electronics Co., Ltd Bus 001 Device 006: ID ffff:0005 Bus 001 Device 005: ID 046d:c054 Logitech, Inc. Bus 001 Device 004: ID 14c0:0008 Bus 001 Device 003: ID 1947:0033 Bus 001 Device 002: ID 058f:9360 Alcor Micro Corp. 8-in-1 Media Card Reader Bus 001 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 mcuee@Ubuntu804:/sys/bus/usb/drivers/usbhid$ ls 1-3:1.0 1-5:1.0 1-7:1.0 1-7:1.1 bind module new_id uevent unbind So far so good. But then there is error thereafter. Maybe this is a Ubuntu specific problem. mcuee@Ubuntu804:/sys/bus/usb/drivers/usbhid$ sudo echo -n 1-7:1.0 >unbind bash: unbind: Permission denied mcuee@Ubuntu804:/sys/bus/usb/drivers/usbhid$ sudo echo -n 1-7:1.1 >unbind bash: unbind: Permission denied Regards, Xiaofan |