Re: reaction to a smaller buffer size

From: Henning Meier-Geinitz (hmg-ml@gmx.de)
Date: Sat Nov 18 2000 - 13:46:53 PST

  • Next message: Henning Meier-Geinitz: "Re: Patches for saned/net/scanimage/user-authorization...."

    Hi,

    On Sat, Nov 18, 2000 at 10:11:21PM +0100, Oliver Neukum wrote:
    > Hi,
    >
    > I'd like to ask whether that check
    >
    > if (real_buffersize != wanted_buffersize)
    > {
    > DBG(1, "sanei_scsi_open: could not allocate SG buffer memory "
    > "wanted: %i got: %i\n", wanted_buffersize, real_buffersize);
    > sanei_scsi_close(*fdp);
    > return SANE_STATUS_NO_MEM;
    > }
    >
    > in sanei_scsi.c might be removed. It makes using SANE with scsi drivers
    > which don't do scatter/gather very hard.

    I don't understand this fully. With sanei_scsi_open there is no way to
    tell the backend that the buffersize is smaller than expected. What
    happens if the backend sends a bigger buffer than allowed? Is it just
    slowed down or does the SCSI call return with an error?
    sanei_scsi_open already reduces the buffer size if
    proc/sys/kernel/sg-big-buff has a lower value but the backend can't
    find out about it if I understood correctly.

    Why don't you use sanei_scsi_open_extended if it is available for your
    paltform? In this case the backend can try to get a big buffer and
    knows the actual size it is allowed to use.

    Bye,
      Henning

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



    This archive was generated by hypermail 2b29 : Sat Nov 18 2000 - 15:06:48 PST