|
From: Xiaofan C. <xia...@gm...> - 2010-10-06 05:16:13
|
On Wed, Oct 6, 2010 at 1:05 PM, Xiaofan Chen <xia...@gm...> wrote: > On Wed, Oct 6, 2010 at 11:55 AM, Peter Stuge <pe...@st...> wrote: >> Xiaofan Chen wrote: >>> I just wonder why "usbfs" is returned as the kernel driver. >> >> It *is* the name of the kernel driver. ;) >> >>> Probably that should be fixed (in the kernel or in libusb). >> >> Why is it wrong? >> > > I do not think "usbfs" is a valid kernel driver name. For example, I have never seen "usbfs" returned in libusb-0.1's Linux only usb_get_driver_np(). http://libusb.sourceforge.net/doc/function.usbgetdrivernp.html int usb_get_driver_np(usb_dev_handle *dev, int interface, char *name, int namelen); int usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface); libusb-1.0 API is a bit different. I also feel that the 0.1 API's is nicer here since it can return the driver name. The 1.0 API does not have this functionality and I think it is better to have one extended API to have similar behavior of the 0.1 usb_get_driver_np API. int libusb_kernel_driver_active (libusb_device_handle * dev, int interface) libusb_detach_kernel_driver(libusb_device_handle * dev, int interface) libusb_attach_kernel_driver(libusb_device_handle * dev, int interface) The last one has the behavior "Re-attach an interface's kernel driver, which was previously detached using libusb_detach_kernel_driver().". What if the device can have two types of driver? -- Xiaofan |