I have a USB rocket launcher that I wish to experiment with through libusb
. However, libusb cannot claim the interface; presumably because the output of usb-devices
lists 'usbhid' as the driver for the device.
From reading around on the internet, I've only come to the conclusion that I need to detach this driver from the device so I can use it with libusb. However, I have not found a single definitive way to do that, only several different ideas and bug reports.
So, is there a way to detach the usbhid driver from a device that would be relevant with the kernel and tools supplied with Ubuntu 11.04?
EDIT:
I tried creating the file
/etc/udev/rules.d/10-usbhid.rules
and writing the following:
ATTRS{idVendor}=="0a81", ATTRS{idProduct}=="0701", OPTIONS=="ignore_device"
Saving, then rebooting. The file is still there, but it doesn't appear to be working at all.
EDIT:
Okay, I tried this:
sudo -i
echo -n "0003:0A81:0701.0006" > /sys/bus/hid/drivers/generic-usb/unbind
After that, navigating to /sys/bus/hid/devices/0003:0A81:0701.0006 and ls yields:
drwxr-xr-x 2 root root 0 2011-05-29 15:46 power
lrwxrwxrwx 1 root root 0 2011-05-29 13:19 subsystem -> ../../../../../../../../../bus/hid
-rw-r--r-- 1 root root 4096 2011-05-29 13:19 uevent
It no longer lists a "driver" symlink like it did before, so I would assume that it unbound it. However, all evidence seems to suggest that the driver is still usbhid. For example usb-devices yields:
T: Bus=02 Lev=03 Prnt=07 Port=00 Cnt=01 Dev#= 9 Spd=1.5 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0a81 ProdID=0701 Rev=00.01
S: Manufacturer=Dream Link
S: Product=USB Missile Launcher v1.0
C: #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid
libusb still retuns -1 on usb_claim_interface()....