This question is two-fold:
1- How do you manually detach a driver from a USB device and attach a different one? For example, I have a device that when connected automatically uses the usb-storage driver.
// usbview output
Vendor Id: xxxx
Product Id: xxxx
...
Number of Interfaces: 2
Interface Number: 0
Name: usb-storage
Number of Endpoints: 2
...
Interface Number: 1
Name: (none)
Number of Endpoints: 2
...
I do not want to use the usb-storage driver, so I have an application running on the host in which I use the libusb library to detach the usb-storage driver and then I claim the interface. I then can send data to and from the applications running on my USB device and on my host Linux system.
How do you detach a driver manually outside of an application?
2- How do I automatically assign the driver to attach on device plugin. I currently have a udev rule setup to set the device permissions automatically.
SUBSYSTEM=="usb", ATTR{idVendor}=="xxxx", MODE="0666"
Can I use udev rules to assign drivers to specific interfaces on the USB device? For example, if I wanted the usbnet module to be used on automatically on interface 0 instead of usb-storage, is that possible in udev?
Thanks,
(I'm a little confused about how StackExchange works with it's different sites or if they are all the same. This is a Linux question so it was also posted on Unix & Linux. Forgive me if it shouldn't be posted here too, but StackOverflow also handles Linux, so...)