On Tue, 12 Jul 2005, Dave Mielke wrote: > [quoted lines by Alan Stern on 2005/07/12 at 09:55 -0400] > > >On the other hand, there are known examples where loading a driver, > >unloading it, and then loading it again will cause just such a > >disagreement to occur. When a driver is unloaded, usbcore sends a > >Set-Interface request to the device. This should set the toggle back to > >0, but on some faulty devices it doesn't. So if the toggle was equal to > >1, and the device failed to set it to 0, and the host thinks it is equal > >to 0, the stage is now set for a lost write. > > > >With usbfs, claiming and releasing an interface (or closing the device > >file) are equivalent to loading and unloading a driver. Hence it's > >possible that you're seeing this phenomenon. > > Is there anything I can do to forceably clear this potential problem so that > the first write will get through?
You could try using the USBDEVFS_RESET ioctl before claiming the interface. That ought to clear the data toggle. Or you could always unplug & replug the device just before running your program. Alternatively, you could change your program so that it repeats the first bulk write when necessary. Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel