[dev] sanei_scsi.c and Linux versions < 2.2.7

From: Henning Meier-Geinitz (henning@meier-geinitz.de)
Date: Sun Jul 15 2001 - 05:49:05 PDT

  • Next message: Marshall Lake: "Scanning with Mustek"

    Hi,

    I have some comments/questions on the sg buffer size on Linux kernels
    before 2.2.7 (2.2.5 in this case). I got a bug report for this one. I
    know this could be fixed by increasing the buffer size in the kernel
    includes or by telling the backend (mustek in this case) not to use
    more than 32k.

    1) In README there is a comment: "--enable-scsibuffersize and
       SANE_SG_BUFFERSIZE have no effect for the Mustek, Umax and
       Sharp backends.". This is not true, at least for the mustek
       backend. In this backend you can set the buffer size in the config
       file, but if one of the two methods above is used, the buffer size
       is not bigger then the specified. E.g. mustek.conf: buffersize=128
       (on kilobytes), SANE_SG_BUFFERSIZE=32768 --> real (maximum)
       buffer size = 32768.
       
    2) Is there any way to detect from a backend how big the available
       buffersize is? I'm using sanei_scsi_open extended and it tells me
       that 128 k is ok even if the kernel doesn't support it. So the
       question is: Must the user set the size to 32k manually (or modify
       the kernel) or is there some other way?
       
    3) Here is a log from the failing command:

    [mustek] reader_process: buffer 1: entering read request for 65484 bytes (buffer 1)
    [sanei_scsi] sanei_scsi_req_enter2: Command: 28 00 00 00 00 00 00 00 6b 00
    [sanei_scsi] scsi_req_enter: entered 0x4038b008
    [sanei_scsi] sanei_scsi.issue: 0x4038b008
    [sanei_scsi] sanei_scsi.issue: bad write (errno=12) Nicht genügend Hauptspeicher verfügbar -1
    [sanei_scsi] sanei_scsi.issue: SG_BIG_BUF inconsistency? Check file PROBLEMS.
    [sanei_scsi] scsi_req_enter: queue_used: 0, queue_max: 1
    [mustek] reader_process: buffer 1: entered (line 107 of 835, buffer 1)

      Wouldn't it be nicer to return an error from sanei_scsi_req_enter
      instead of ignoring the situation? The error comes up later when
      waiting for the buffer:
      
    [mustek] reader_process: buffer 1: waiting for request to be ready
    [sanei_scsi] sanei_scsi_req_wait: waiting for 0x4038b008
    [sanei_scsi] sanei_scsi.issue: 0x4038b008
    [sanei_scsi] issue: ENOMEM - cannot queue SCSI command. Trying again later.
    [sanei_scsi] sanei_scsi.issue: 0x403ac008
    [sanei_scsi] issue: ENOMEM - cannot queue SCSI command. Trying again later.
    [mustek] reader_process: failed to read data, status: Out of memory, buffer: 1

    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 : Sun Jul 15 2001 - 05:39:01 PDT