Discussion:
[libhid-discuss] linux usbhid module claiming my device
Gabriel Rossetti
2009-09-09 14:35:12 UTC
Permalink
Hello,

I have a problem where on linux the usbhid module claims my custom
device. I used the hid_force_open() function and it is able to release
the device and claim it but when I try to use hid_interrupt_read() it
says that the device is busy :

NOTICE: hid_force_open(): successfully opened USB device 001/035[0].
TRACE: hid_interrupt_read(): retrieving interrupt report from device
001/035[0] ...
WARNING: hid_interrupt_read(): failed to get interrupt read from device
001/035[0]: could not claim interface 0: Device or resource busy

Does anyone know how to deal with this (hopefully programically)? I use
version 0.2.15+20060325-2.1 (ubuntu 8.04), installed using aptitude.

Thank you,
Gabriel

PS
should I also post on libusb since libhid is built on top of it?
Charles Lepple
2009-09-09 23:37:13 UTC
Permalink
Post by Gabriel Rossetti
Hello,
I have a problem where on linux the usbhid module claims my custom
device. I used the hid_force_open() function and it is able to
release the device and claim it but when I try to use
NOTICE: hid_force_open(): successfully opened USB device 001/035[0].
TRACE: hid_interrupt_read(): retrieving interrupt report from device
001/035[0] ...
WARNING: hid_interrupt_read(): failed to get interrupt read from
device 001/035[0]: could not claim interface 0: Device or resource
busy
Is there any indication that the usbhid module is still claiming the
device after you successfully use hid_force_open()? If so, then
usb_detach_kernel_driver_np() is not doing its job, and it might be a
libusb question.
Post by Gabriel Rossetti
Does anyone know how to deal with this (hopefully programically)? I
use version 0.2.15+20060325-2.1 (ubuntu 8.04), installed using
aptitude.
Thank you,
Gabriel
PS
should I also post on libusb since libhid is built on top of it?
Possibly. I wouldn't advise cross-posting directly - there probably
aren't too many people on the libusb list who know much about libhid.

For reference, the source code to hid_force_open() is here:
http://libhid.alioth.debian.org/doc/hid__opening_8c-source.html#l00241
Gabriel Rossetti
2009-09-30 08:37:24 UTC
Permalink
Post by Charles Lepple
Post by Gabriel Rossetti
Hello,
I have a problem where on linux the usbhid module claims my custom
device. I used the hid_force_open() function and it is able to
release the device and claim it but when I try to use
NOTICE: hid_force_open(): successfully opened USB device 001/035[0].
TRACE: hid_interrupt_read(): retrieving interrupt report from device
001/035[0] ...
WARNING: hid_interrupt_read(): failed to get interrupt read from
device 001/035[0]: could not claim interface 0: Device or resource busy
Is there any indication that the usbhid module is still claiming the
device after you successfully use hid_force_open()? If so, then
usb_detach_kernel_driver_np() is not doing its job, and it might be a
libusb question.
I think it's doing it's job correctly, but the hid driver either
reclaims it or it tries to claim it after libhid has claimed it already.
Post by Charles Lepple
Post by Gabriel Rossetti
Does anyone know how to deal with this (hopefully programically)? I
use version 0.2.15+20060325-2.1 (ubuntu 8.04), installed using aptitude.
Thank you,
Gabriel
PS
should I also post on libusb since libhid is built on top of it?
Possibly. I wouldn't advise cross-posting directly - there probably
aren't too many people on the libusb list who know much about libhid.
http://libhid.alioth.debian.org/doc/hid__opening_8c-source.html#l00241
Loading...