On 2013.03.21 20:06, Ludovic Rousseau wrote: > Maybe LIBUSBX_IMPLEMENTS_DETACH_KERNEL_DRIVER
Works for me. > It would also be cool if libusb_claim_interface() could report a > specific error in case detach is needed. > Something like LIBUSB_ERROR_NEED_DETACH_KERNEL_DRIVER. I think if we could do that, we may not need _detach_kernel_driver() in the first place. It would probably make more sense to just detach on device open and restore on device close, as, if someone wants to access a device, they probably would prefer to have libusb/libusbx sort the prerequisites. If it was easy, we might have seen a patch proposal for that already. That's not to say that it isn't doable, but my guess is that we'd have to make assumptions with regards to which device classes an OS will try to service, and that could become tricky. Then again, patches are always welcome. > I do not like the code of the example [1] that calls > libusb_detach_kernel_driver() for _any_ error code returned by > libusb_claim_interface() Neither do I. That's what I was pointing out above. Using the capability is going to be better than what we have now, but it's still going to be a case of shooting in the dark to find out if detach is the issue or if it's something else. Spending a lot of effort on that specific aspect of the sample didn't seem worth it at the time, especially after I pushed for a more cross-platform friendly libusb_detach_kernel_driver(), that went nowhere. So that why we have what we have here. Regards, /Pete ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel