[sane-devel] Re: Avision backend

abel deuring a.deuring@satzbau-gmbh.de
Thu, 17 Jan 2002 20:34:55 +0100


Rene Rebe wrote:

> > > - hpusbscsi+sane+avision will not handle large transfers. It is necessary to
> > > use a large SANE_SG_BUFFERSIZE. Is it easy to fix?
> >
> > use sanei_scsi_open_extended instead of sanei_scsi_open. The former
> > function has one more parameter, the buffer size. On return, you should
> > check, if you got the buffer size you wanted. If
> > sanei_scsi_open_extended returns a too small value for your purposes,
> > you can call an appropriate DBG statement and return an error to the
> > caller.
> 
> Ok. The only problem we have is: that the calibration data seems to
> get rather big (200kB - 400kB?) and it _seems_ that it has to be
> transfered with one SCSI command. (From the windows-log they seem to
> be also using a single command ...). I'm not such a SCSI freak - so is
> it possible to devide a SCSI command into single small ones?

Theoretically, it should be possible to read/write data in smaller
chunks. OTOH, I remeber that Oliver Rauch increased the default SCSI
buffer size for, uuuhhh, was it Irix?, because some Umax scanner wants
to read or write something like calibration data in exactly one block.

But anyway, my point regarding sanei_scsi_open_extended was that this
function gives you better control over the buffer size, at least under
Linux. So, if the scanner allows to read/write the calibration data with
more than command, you can easily adjust the number of required commands
-- and if the scanner needs exactly SCSI command for the data, you can
avoid the usage of environment variable SANE_SG_BUFFERSIZE. Before the
Linux SG driver allowed to set the buffer size at run time, and before I
had set the default Sane buffer size to 128 kB, we had quite a few
questions on the meiling list, how to adjust the buffer size. So, if you
set the proper buffer size without using SANE_SG_BUFFERSIZE, you make
like easier for many users and you avoid some questions.

Abel