libftdi Archives

Subject: Re: Claiming devices has no effect under Linux

From: Thomas Klose <thomas.klose@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 05 Oct 2010 16:52:48 +0200
Am Dienstag, den 05.10.2010, 16:07 +0200 schrieb Thomas Klose: 
> Am Dienstag, den 05.10.2010, 15:57 +0200 schrieb Thomas Jarosch: 
> > On Tuesday, 5. October 2010 15:51:33 Thomas Klose wrote:
> > > Sorry, I do not understand. Does this mean, when a device is
> > > successfully claimed, it always can be used by other instances?
> > > 
> > > If this is the case, is there a possibility to signal the other instance
> > > that the device is already in use, e.g. get usb_claim_interface() to
> > > return -EBUSY?
> > 
> > Sorry, I might be wrong on this one, just rechecked with the man page.
> > Have you tried to trace it with a debugger what is really going on?
> > 
> 
> I just found a interesting thread in the libusb-devel mailing list:
> http://libusb.6.n5.nabble.com/How-to-establish-EXCLUSIVE-instead-of-SHARED-access-to-usb-device-td6878.html
> 
> It may be a bug in libusb. The problem seems to be that calling
> usb_detach_kernel_driver() somehow breaks the claim on a device. I think
> I've seen calls to this function in libftdi.

I tried to run libftdi without the usb_detach function:

        /*
        if (usb_detach_kernel_driver_np(ftdi->usb_dev,
        ftdi->interface) != 0 && errno != ENODATA)
           detach_errno = errno;
        */

Now it works as expected. What is this function needed for, anyway? I
whitch case is it necessary to detach a module explicitly?

Regards, Thomas
        


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread