USB device driver not binding to device

Valentina Manea valentina.manea.m at gmail.com
Wed Jan 1 15:00:54 EST 2014


On Tue, Dec 31, 2013 at 1:54 PM, Valentina Manea
<valentina.manea.m at gmail.com> wrote:
> Hi,
>
> I am working on the USB/IP drivers in the staging directory and bumped
> into an issue with one of the drivers.
>
> usbip-host is declared as struct usb_driver (so, an USB interface
> driver). My task was to transform it to struct usb_device_driver - in
> this way, instead of binding each interface to the driver, the whole
> device would be bound to the driver.
>
> The binding is made from userspace via the bind file of the driver [1]
> and using libsysfs. With the old version of the driver, one would
> write something like 1-1:1.0 to bind interface 0 of device with bus ID
> 1-1.
>
> However, with the new version of the driver, using the same syntax for
> device identification (1-1:1.0), this binding fails:
> * libsysfs doesn't give much info about the error
> * echo-ing the ID into bind file as shown in [1] doesn't work in
> either case; on the other hand, I can succesfully unbind the device
> from the default driver (usb-storage in this case) using the same
> mechanism
> * I have a printk in the probe function of the driver - it seems it
> doesn't even get there.
>
> I am missing something but have no clue where to look anymore.
>
> Thanks,
> Valentina
>
> [1] http://lwn.net/Articles/143397/

Just in case anyone ever bumps into the same problem, it seems there
is a generic USB device driver (*device* driver, not *interface*
device driver) that claims all the USB devices. So, one should first
unbind from that driver; echo-ing the bus ID into
/sys/bus/usb/drivers/usb/unbind will do.



More information about the Kernelnewbies mailing list