Re: Problem with SANE and SCSI scanner

Douglas Gilbert (
Fri, 03 Dec 1999 09:02:36 -0500

abel deuring wrote:
> Manuel Panea wrote:
> > Now for the backend problem at hand: I could of course do those sg ioctl's
> > in the backend, but that should rather be done by sane, not by the
> > backends. Do you perhaps know whether there are any development plans for
> > sane to include support for such ioctl's?
> If you need a quick fix, you might try Douglas's SG driver version 3
> ( in combination with the modifications to
> sanei_scsi.c which I posted some weeks ago on this mailing list. While
> these modifiactions were mainly intended to benefit from other
> improvements in the SG driver (it is possible to omit a buffer in
> sanei_scsi.c for the data read from the scanner), they should also fix
> the problem, that the SG driver must guess the length of SCSI commands.
> (Douglas, please correct me if I am wrong, but I think that with the new
> header structure, the SG driver takes the length of the SCSI command
> from sg_io_hdr.cmd_len.)

That is correct. Unfortunately SCSI 3 16 byte commands are
not yet supported by Linux but with the sg_io_hdr structure
that is not a sg interface restriction (rather a Linux scsi
mid-level restriction that may later be relaxed).

Since the sg "version 3" driver is not even in the Linux 2.3
development tree yet, it is probably a bit premature to ask
people maintaining backends to use it. [Of course I don't mind
if they do and it is probably a better solution than asking
end users to edit Linux device drivers.] The common sane
backend for Linux could however be changed to detect such
things (e.g. a 6 byte 0xd5 command) and if the sg driver
supports SG_NEXT_CMD_LEN then use it and if it doesn't then
return an error.

Doug Gilbert

Source code, list archive, and docs:
To unsubscribe: echo unsubscribe sane-devel | mail