[sane-devel] Fwd: sanei_usb limitations
Reinhold Kainhofer
reinhold at kainhofer.com
Tue Jan 4 21:01:16 UTC 2011
Am Samstag, 27. November 2010, um 00:10:54 schrieb m. allan noah:
> Reinhold Kainhofer has recently worked up a patch with an alternative
> implementation of your idea- and there was some discussion about yet a
> third mechanism, which relies on a 'setting' function to be called
> prior to transferring the data, much as the existing timeout control
> code works. I think that would be the best choice, not sure if
> Reinhold has gotten a chance to work on it.
I have now updated my patch to also include a callback function to
sanei_usb_open_extended, which is called before all available endpoints are
listed.
Patch is here:
http://codereview.appspot.com/2823041/
The callback function (if given) is called for each combination of
USB_DIR_IN/USB_DIR_OUT and
USB_ENDPOINT_TYPE_CONTROL/USB_ENDPOINT_TYPE_ISOCHRONOUS/USB_ENDPOINT_TYPE_BULK/USB_ENDPOINT_TYPE_INTERRUPT.
If a value >0 is returned, it is used as the default endpoint of that type
(instead of the first encountered endpoint of that type).
The old functionality of an additional argument to each usb read/write
function to explicitly override the endpoint for a single transaction is still
there, so one can now override the default used for all transfers as well as
the endpoint for a single transfer.
Any comments? Of course, I would love to get this into the 1.0.22 release, so
other backends that need different endpoints for different communication types
finally have this functionality available.
Cheers,
Reinhold
--
------------------------------------------------------------------
Reinhold Kainhofer, reinhold at kainhofer.com, http://reinhold.kainhofer.com/
* Financial & Actuarial Math., Vienna Univ. of Technology, Austria
* http://www.fam.tuwien.ac.at/, DVR: 0005886
* LilyPond, Music typesetting, http://www.lilypond.org
More information about the sane-devel
mailing list