Re: Problem with SANE and SCSI scanner

Manuel Panea (mpd@rzg.mpg.de)
Thu, 2 Dec 1999 23:54:02 +0100

-----BEGIN PGP SIGNED MESSAGE-----

On Wed, 1 Dec 1999, Douglas Gilbert wrote:

> Laura DeWitt wrote:
>
> > write(2, "[canon] attach: sending GET SCAN"..., 66[canon] attach: sending GET SCAN MODE for scan control conditions
> > ) = 66
> > write(2, "[canon] get scan mode: cmd[4]=\'0"..., 37[canon] get scan mode: cmd[4]='0x14'
> > ) = 37
> > rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
> > rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
> > rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
> > write(4, "*\0\0\0n\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 42) = -1 EIO (Input/output error)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> The failure (EIO) on the sg device handle (4 in this case)
> indicates the buffer passed to sg's write() was too small.
> A length of 42 implies a maximum SCSI command length of 6
> bytes (because the accompanying sg_header structure is 36
> bytes long). Digging around the canon backend code in
> sane-1.0.1, it seems to be sending an opcode of 0xd5
> for "GET SCAN MODE". Such an opcode can only be 10 bytes
> long (12 bytes if another flag was set but I can see above
> it is not).
>
> Doug Gilbert
> Linux sg maintainer

Aha! So *you* are the sg maintainer. If you have read my last answer to
Laura, you know that you are right: sg and sane get confused about the
SCSI command sizes.

Now why is this so? I was (fortunately) told about this problem by a canon
backend user who described it as a bug in sg, but now you talk as if it
were sane's fault. So is it sg's fault or is it sane's fault? (I don't
think it can be the backend's fault, all I do is try to send the scanner a
perfectly valid SCSI command.) What should be changed to not have to tell
the users to "go patch /usr/src/linux/drivers/scsi/sg.c"?

Manuel Panea Tel. +49 89 3299 1133
Rechenzentrum Garching Fax +49 89 3299 1301
Postfach 1533 E-mail: mpd@rzg.mpg.de
85740 Garching Germany http://www.rzg.mpg.de/~mpd

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
Charset: noconv

iQCVAwUBOEbqgInxRMteJ3RRAQE1AAP/SR7FUhvzyk5jL/QazIaH38z2T1NtD54i
mIv7iDQGKXsA8CCgIqWAbj5TcX9ApfUReJUrPiMgfDQ9nZSw9X1g0yovZsQAUl2D
0mexqMkuzFr6IhWsCHqtIyFfHIAcxDGOOlslhCZdl662xtL5o/LLcxlcVU5Jxy39
EX1vNMCbUVc=
=UgtY
-----END PGP SIGNATURE-----

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com