>>>>> "Uwe" == Uwe Bonnes <[email protected]> writes:

>>>>> "Thomas" == Thomas Klose <[email protected]> writes:

    Uwe> In your situation, however it is wrong. Ideas how to handle that
    Uwe> situation are welcome.

To clarify the situation.
Device gets plugged, ftdi_sio gets loaded.
First libftdi open calls libusb_detach_kernel_driver() and gets access.
Second libftdi open calls calls again libusb_detach_kernel_driver() and gets
access too.

First try: Make the call to libusb_detach_kernel_driver() 
dependant if a kernel driver is loaded:
+ if (libusb_kernel_driver_active(ftdi->usb_dev, ftdi->interface) == 1)
    if (libusb_detach_kernel_driver(ftdi->usb_dev, ftdi->interface) !=0)
        detach_errno = errno;

This doesn't help, as the second open sees "usbfs" as a valid kernel driver
loaded.

I just sent a patch to libusb-devel, that checks in
libusb_kernel_driver_active() for itself ("usbfs") and returns another
value, so that above libftdi patch works as expected.

Bye 
-- 
Uwe Bonnes                [email protected]

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [email protected]   

Reply via email to