|
From: Xiaofan C. <xia...@gm...> - 2010-10-06 03:46:32
|
On Wed, Oct 6, 2010 at 12:06 AM, Uwe Bonnes <bo...@el...> wrote: > for FTDI devices, in most cases ftdi_sio is loaded. To talk to the device > via libusb/libftdi, the kernel mode driver needs to be unloaded. However > this defeats exclusive access, as a second open on the device will now see > "usbfs" as the kernel mode driver and the same mechanism that unloaded > ftdi_sio will happily "unload" "usbfs" and give access to the second open(). > Appended patch checks now for "usbfs" driver string and returns another > value in that case. Higher levels may now check the return value and refrain > to call libusb_detach_kernel_driver() and so provide excusive access inside > usbfs/libusb. For the benefits of others, this patch is the result of the discussion here. http://developer.intra2net.com/mailarchive/html/libftdi/2010/msg00618.html Also here. http://libusb.6.n5.nabble.com/How-to-establish-EXCLUSIVE-instead-of-SHARED-access-to-usb-device-td6878.html I just wonder why "usbfs" is returned as the kernel driver. Probably that should be fixed (in the kernel or in libusb). -- Xiaofan |