[sane-devel] [PATCH,RFC] Add libusb-1.0 support to sanei_usb

Julien BLACHE jb at jblache.org
Sun Feb 15 18:19:37 UTC 2009


"m. allan noah" <kitno455 at gmail.com> wrote:

Hi,

>> I have one question about sanei_usb_init(), as ISTR recent discussions
>> about calling sanei_usb_init() several times. Is that allowed? If yes,
>> there's a slight change that needs to be done (not reiniting libusb).
>
> I've not had a chance to look at the code, but your memory is correct.

OK. I checked the sanei API doc before posting, and it's not
mentionned explicitely in there.

> In order to detect when new devices are installed, a backend currently
> needs to re-call sanei_usb_init during sane_get_devices. I would very
> much like to see sanei_usb_init cut into two properly named functions-
> one that calls the libusb init function, and one that scans the busses

Me too. And then also add a sanei_usb_deinit() function for good
measure.

> for devices. An alternative approach would be to keep the single
> function, but protect the libusb init call with a global. That is less
> clear, but less code to change :)

And we have with libusb-1.0 as I'm setting up a context for sanei
instead of relying on the default context. So we can use the context
for that.


While we're talking sanei_usb, I'd be pretty happy to get rid of the
kernel scanner interface. But it looks like it's also used by BeOS or
OS/2. Can anyone tell if we can get rid of this interface on these
platforms too? One has usbcalls, and the other should have the old
libusb if I'm not mistaken.

JB.

-- 
Julien BLACHE                                   <http://www.jblache.org> 
<jb at jblache.org>                                  GPG KeyID 0xF5D65169



More information about the sane-devel mailing list