[sane-devel] Upgrading to 1.0.7 - snapscan E20 not detected by scanimage

Henning Meier-Geinitz henning@meier-geinitz.de
Tue, 29 Jan 2002 22:24:34 +0100


Hi,

On Tue, Jan 29, 2002 at 08:37:21PM +0100, Oliver Schwartz wrote:
> > In the mustek_usb backend I'm using the following compromise: Try to
> > detect all supported Mustek scanners by "usb vendor product" entries.
> > If this doesn't work (because the kernel doesn't support it), the user
> > must specify the device file and type of scanner manually. So with
> > newer Linux kernels the user doesn't have to modify anything and the
> > backend doesn't interfere with non-Mustek scanners.
> 
> Is it save to call sanei_usb_open(),

No problem. It's just a wrapper to open().

> sanei_usb_get_vendor_product() and 

On Linux this will call an ioctl for the device. It shouldn't collide
with SCSI commands, but I haven't tested it yet. On other paltforms,
nothing is done.

> sanei_usb_close() on a SCSI device node?

No problem (just a simple close).

> If there are no side effects I'll change the behaviour for
> sane-1.0.8. 

If you only use the automatic detection in backend.conf, e.g.:
usb 0x0400 0x1000
there are no problems with SCSI devices because
sanei_usb_attach_matching_devices () only tests the USB devices. Ok,
the user may link /dev/usb/scanner0 to a SCSi device but that's his
own fault.

For manual entries (e.g. /dev/usbscanner) it makes sense to add an
option or similar mechanism to distinguish SCSI from USB scanners.
Looking at the filename *may* work but is not easy. E.g. USB:
usb/scanner, usbscanner, uscanner; SCSI: scanner, sg0, uk0,
scsi/sc0d1l0, b0t0l0, sg0a, gsc0, scg0a, sg/0, ss0, rscsi/c0t0d0.

Bye,
  Henning