[sane-devel] Problem with HP ScanJet 8290 and scsi

abel deuring adeuring at gmx.net
Tue Mar 14 23:18:10 UTC 2006


Marc F. Clemente wrote:
> I have a problem connecting a ScanJet 8290 by scsi.
[...]
> [sanei_scsi] sanei_scsi_open: Host adapter queue depth: 2
> [sanei_scsi] sanei_scsi_open: SG driver can change buffer size at run time
> [sanei_scsi] sanei_scsi_open: low level command queueing enabled
> [sanei_scsi] sanei_scsi_open: using new SG header structure
> [sanei_scsi] sanei_scsi_req_enter2 warning: truncating write data from requested 28 bytes to allowed
> 12 bytes
> [sanei_scsi] sanei_scsi.issue: bad write (errno=90) Message too long -1
> scanimage: sane_start: Error during device I/O
> Exit 9
> 
> 
> What am I doing wrong?

Nothing -- this is a really strange error, caused somewhere either
in sanei_scsi.c or in the avision backend.

>  What's the meaning of "truncating write data from requested 28 bytes..."

Unfortunately, there are two lines in sanei_scsi.c that can print
this warning; my guess is that the second DBG statement with this
text in sanei_scsi.c prints this warning. Both warnings deal with
the possible problem that a backend tries to send more data than can
be passed to the Linux SG driver. The first warning is issued, if a
backend tries to send more SCSI _data_ than possible; the second
warning is issued, if a backend tries to send a too long SCSI
_command_. The maximum size for SCSI commands is 12 bytes, while the
buffer size for data sent to or from the scanner is set to 128 kB.
Hence we have most likely a warning for the latter case.

What really puzzles me is this: The error occurs for the first
command that is sent to the scanner after the call to
sanei_scsi_open. The Avision backend calls sanei_scsi_open in two
places:

- in attach(); in this case the first SCSI command is INQUIRY, and
the size of the command data is set to 6 bytes, if I read avision.c
and avision.h correctly.

- in sane_open(): here, the first SCSI command is RESERVE UNIT
(issued in reserve_unit()), and the size of the command data block
is again properly set to 6.

In other words: I believe that I know roughly where to look for the
error -- but I don't see where or how the CDB size changes from 6 to
28, as printed by the DBG statement in sanei_scsi.c.

Rene, do you have any idea?

Abel



More information about the sane-devel mailing list