|
From: Michael P. <mic...@gm...> - 2010-10-11 03:57:33
|
Xiaofan Chen wrote: >> http://libusb.sourceforge.net/api-1.0/group__dev.html#ga76e047ca95da2b32d0e7 455da1804a49 >> libusb_kernel_driver_active () >> 0 if no kernel driver is active >> 1 if a kernel driver is active >> LIBUSB_ERROR_NO_DEVICE if the device has been disconnected >> another LIBUSB_ERROR code on other failure >> >> Uwe's patch add a 2 as the return value to inform the user >> that "usbfs" is the current bound driver. Then the user can >> decide to proceed with the driver detaching or not. Typically >> the user should decide not to do so, but he can do that if >> he really wants to do that. Or you could add another api called "libusb_usbfs_kernel_driver_active ()", or perhaps one that returns the driver name. At least this would allow us not to change an existing api, if that's your concern. But I think there is not a perfect solution without some help from the kernel. Maybe not as drastic as changing whether or not usbfs can detach, though that sounds simpler to implement than taking a string that says which driver not to detach. Perhaps the latter, while more complicated, could be more backward compatible? I don't know. Michael |