[libhid-discuss] HID Device hang
Charles Lepple
clepple at ghz.cc
Tue Oct 16 12:30:50 UTC 2007
On Oct 16, 2007, at 8:23 AM, ankita prasad wrote:
> I am helping a professor who has written a very basic HID device
> driver for
> his HID device. His code pretty much treats /dev/hiddev0 as a file
> and uses
> ioctl calls to to open a handle to the file and use it to read
> from it and
> write to it.
The /dev/hiddev0 interface is the "kernel HID driver" that libhid
detaches (the module is named "usbhid.ko", or "hid.ko" in earlier
kernels).
> When using this driver, he can read and write to the device but
> after about
> one minute, the device hangs. The only thing that I saw in his code
> is that
> he doesn't explicitly blacklist the HID device from the kernel.
> Could this
> be a reason for the sudden hang?
If you blacklist the HID device in the usbhid driver, you will
prevent the system from creating the /dev/hiddev0 node when the
device is plugged in. You would still be able to see the device with
libhid, since it uses the core USB driver and usbdevfs, but there are
no guarantees as to whether libhid will fare any better - often, when
a USB device hangs, it is a problem with the device firmware.
--
Charles Lepple
More information about the libhid-discuss
mailing list