Sorry for the stupid question.


I figured it out on my own.

The recommended kernel build procedure discourages the copying of the new kernel header files into usr/src/linux so as not to mess up the corresponding libraries. So, of course, I didn't have the new "usbdevice_fs.h" with the define in it.



Dan and Aurelien:

Thank you for the info regarding the use of UsbInterfacePolicy to allow a "forceClaim".

I have recently upgraded to 2.4.23-pre7 to get a kernel with support for the disconnect behavior.

Apparently, a minor native code change in the reference implementation is also required to enable support for forceClaim in addition to using a recent kernel version.

It appears that "USBDEVFS_DISCONNECT" needs to be defined during the native code compilation.

However, a simple #define is not enough.

The code

void disconnect_interface_driver(JNIEnv *env, int fd, int interface)
{
struct usbdevfs_ioctl *disc_ioctl = NULL;


if (!(disc_ioctl = malloc(sizeof(*disc_ioctl)))) {
log( LOG_CRITICAL, "Out of memory!" );
return;
}


         disc_ioctl->ifno = interface;
         disc_ioctl->ioctl_code = USBDEVFS_DISCONNECT;
         disc_ioctl->data = NULL;

actually makes use of the VALUE of the define to initialize the ioctl_code.

Is "disc_ioctl->ioctl_code" supposed to be set to 1 here or is some other value expected?

Is a direct edit of JavaxUsb.h the intended place to enable the disconnect functionality or is there some other configuration or make file option that I missed?

Thanks.



Dan Streetman wrote:

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.





-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
_______________________________________________
javax-usb-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel

Reply via email to