On Tue, 5 Aug 2003, Joerg Albert wrote:

> Hi Alan,
> 
> Thanks for the pointers - but I don't understand much of them.
> They are about some future design - is there any _working_ way to use
> usb_reset_device() right now in my case (DFU download, REMAP,
> usb_reset_device)?

There isn't. :-(

>  I grep'd for it in the kernel source and looked at
> scsi_glue.c, but couldn't figure out how it resolves the problem below.
> 
> I currently run in a a scheduler queue task (didn't dare to do it in
> probe() as I have to wait for a second after REMAP):
> 
> struct my_device *dev = ...;
> ...
> dev->udev->descriptor.idProduct++;
> usb_driver_release_interface(dev->calling_driver,
>       dev->interface);
> usb_reset_device(dev->udev);
> 
> dev->interface = &dev->udev->actconfig->interface[0];
> usb_driver_claim_interface(dev->calling_driver,
>       dev->interface, dev);
> 
> which gives back the correct interface descriptors, but when I unplug the
> device the driver's disconnect() is not called.
> I guess the destroy_configuration() inside usb_reset_device() destroyed
> the registration of the interfaces with the driver core.

Yes.  Like I said before, that whole pathway is in bad shape.  It needs to 
be treated as a disconnect from the old device followed by a connect from 
the new device, but it isn't.

> The 2.4.x driver for my device is based on calling usb_scan_devices()
> after usb_reset_device() which called the driver's probe() again.
> usb_scan_devices() was removed in 2.5.x :-(
> 
> Would it help to call the above in the driver's probe()?

Probe() is the right place to do it.  After all, you don't want to bind 
your driver to a device that's going to morph into something else in the 
near future.

But there are locking issues involved as well.  If you want to contribute 
a patch, I'm sure it will be appreciated.  The most relevant source files 
usb.c, hub.c, and message.c in drivers/usb/core/.

Alan Stern



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to