Yep, if the HID driver is the one in your way, removing HID is one 
solution...however just rmmoding the driver isn't a good solution, as kmod 
will re-load the driver when you hotplug a HID device.  If you're never 
going to need the HID driver for any device, you should just not compile 
it in to your kernel...

modifying the hid_core.c file is possible, I think you can add your device 
to the "blacklist" that's contained in there...then the HID driver will 
ignore your device completely...but your program isn't portable anymore, 
and you have to patch any new kernel you move to...

I think using the UsbInterfacePolicy.forceClaim() is the best way to do 
things, and the Linux implementation can keep up with changes the Linux 
kernel makes in how it's done at a low level.  Also, it hopefully will be 
somewhat portable to other OSes...


On Sat, 11 Oct 2003, Aurelien Godin wrote:

>
>In a previous archive, Dan Streetman wrote that :
>>>The most interesting change is the UsbInterfacePolicy.  An interesting
>>>side note to the policy is the 'forceClaim' option, which allows you (on
>>>certain Linux kernels, 2.5 and from 2.4.23-pre2) to remove existing USB
>>>drivers from any usb interface, so you can drive the interface from
>>>userspace.
>Maybe is it a way to help you get the interface released.
>
>If you don't have a recent kernel, I have a TEMPORARY solution. I have
>exactly the same problem and solve it by calling the "rmmod hid" command
>within the java program (using the Runtime and Process classes).
>In my case, the HID driver isn't used by any other module. In yours, you
>should maybe call "rmmod" on all modules that have called the HID driver
>before you can remove it.
>It allows not to modify the hid_core.c file but I insist that it is NOT a
>very elegant solution (moreover, it requires to be connected as root).
>PS : at the end of the java code, the "insmod" command is called to retrieve
>a well-functionning linux system.
>
>Aurelien
>
>-----Message d'origine-----
>De : [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] la part de Aaron
>Metzger
>Envoye : vendredi 10 octobre 2003 23:17
>A : [EMAIL PROTECTED]
>Objet : [javax-usb-devel] HID usage under Linux
>
>
>
>This is a usability question in a Linux environment more than it is an
>API question.
>
>My experience is that I can't "claim" any device with javax-usb that
>has already been claimed by the Linux kernel drivers.  Unfortunately,
>the Linux HID driver claims a lot of devices including the one that I
>would like to control from Java.
>
>Does anyone have any advice as to how to forcefully claim a device
>from Java or how to prevent the Linux HID driver from claiming one
>particular HID device out of the many attached to my system?  I'm
>ready to start hacking hid-core.c unless someone has a more elegant
>solution.
>
>Thanks in advance for any info.
>
>--
>Aaron
>
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: SF.net Giveback Program.
>SourceForge.net hosts over 70,000 Open Source Projects.
>See the people who have HELPED US provide better services:
>Click here: http://sourceforge.net/supporters.php
>_______________________________________________
>javax-usb-devel mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: SF.net Giveback Program.
>SourceForge.net hosts over 70,000 Open Source Projects.
>See the people who have HELPED US provide better services:
>Click here: http://sourceforge.net/supporters.php
>_______________________________________________
>javax-usb-devel mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
>

-- 
Dan Streetman
[EMAIL PROTECTED]
---------------------
186,272 miles per second:
It isn't just a good idea, it's the law!


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
javax-usb-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel

Reply via email to