device filtering support
Segher Boessenkool
segher at kernel.crashing.org
Tue Feb 7 19:30:16 EST 2012
>> If there is anything in our API that requires us to ask the OS for
>> lots more (expensive) information than what is actually used, then
>> we need to change things there (add a new cheaper API). But I've
>> seen no evidence for that yet luckily.
>
> Does the above serve as an evidence?
No; I asked if our API requires us to do all those crazy requests,
not if the current implementation does. It does, we know that :-)
>> Then, filtering. There are two aspects to filtering: it can reduce
>> the amount of communication between libusbx and the OS (if the OS's
>> interfaces allow for that); and it can let the user of the library
>> say up front what devices it cares for (so we don't bother it with
>> uninteresting devices).
>
> That is the main thing I am concerned. Filtering on VID/PID or
> filtering on GUID (under Windows) can help reduce the traffic
> on the bus.
Yes. And it can make our (device open) API nicer as well (for
most users of our library), which is reason enough to have it
in my opinion.
I think we can also get rid of most bus traffic, by not asking
for any descriptors etc. until that info is actually needed.
We'll see. Filtering reduces the amount of traffic, but let's
try to simply get rid of whatever we don't need. I am not sure
we can get rid of everything, with the current APIs; it obviously
also depends on the OS.
Segher
More information about the libusbx
mailing list