On Sat, 3 Aug 2013, Pete Batard wrote: > On 2013.08.03 16:41, Hans de Goede wrote: > >> So, how could we solve 1&2 once and for all? > >> "Simple", we add an extra layer to libusbx that does user-side caching > >> of all the descriptors we need, and tie this caching, along with > >> enumeration, to the newly added hotplug functionality: whenever a device > >> is plugged in, we get libusbx to issue a bunch of calls similar to the > >> ones the OS issues, to fetch the descriptors we are interested in > >> caching (which may result in doubling bus transfers, but unless you're > >> low speed, this will hardly be an issue: on any device plug in, you > >> should expect to have transfers that you have no control on from the OS > >> anyway, so whether these calls are doubled is hardly something to cry > >> foul over). > > > > Strong NACK, we really do not want to do any IO on enumeration at all. > > USB devices tend to be cheap crap, and various operating systems go > > out of there way to not upset the cheap crap, ie the Linux kernels > > uses quite large quirklists for this because some devices crash if > > you try to get string descriptors. > > And the idea here is to duplicate what the OS does. > If the OS uses quirk lists, which I assume are public, then there's no > reason we can't do that too, though I have to wonder how other OSes fare > in that matter... Or we just let whatever crash, i.e. "Don't plug cheap > known problematic crap and expect stability". > Either way is no big deal IMO.
I agree with Hans. In-library caching should be done on-demand, not whenever a new device is enumerated. If the program asks the library for a string descriptor, the back end can get the descriptor from the OS's cache, if one is available. Or it can talk to the device. That's up to the back end. But if the program doesn't ask for a string descriptor, the library shouldn't go out of its way to read it. Alan Stern ------------------------------------------------------------------------------ Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel