[sane-devel] CanoScan N650U "scanner.c" vs. "libusb"
Sergey Vlasov
vsu at mivlgu.murom.ru
Fri Mar 22 17:30:40 GMT 2002
On Fri, Mar 22, 2002 at 16:03:09 +0100, Gunther Mayer wrote:
> "scanner.c" as in linux-kernel is misleading, as it does things that
> should be separate. On the long run it creates more problems than it
> solves (it tries to hide/abstract the fact that it is USB from
> user-level application; this is the wrong way)
>
> Essentialy it boils down to
> "scanner.c" = List of Scanner USB_IDs + Some Knowledge about endpoints +
> generics USB routines (read/write)
>
> If a scanner is recognized by "scanner.o" it means nothing !
> The hard work must be done anyway by the user level driver.
>
> Better solution:
> libusb (comparable to "sg"="scsi generic" or "ide taskfile") exposes the
> USB API to user space.
>
> So I decided to use "libusb" and ignore "scanner.c" in my Canon N670U driver,
> see http://home.t-online.de/home/0531896113/merlin670-V0.02.c
Please note that libusb also has some problems:
- Apparently standard kernels in some Linux distributions are not
compiled with the USB filesystem support (usbdevfs), which is required
for libusb to work (even if the USB scanner driver is available).
- By default, using libusb requires root access. It is possible to
reconfigure usbdevfs to allow non-root users to use USB devices, but
this gives access to all USB devices - not only scanners.
More information about the sane-devel
mailing list