Re: problems with Canon scanner

From: abel deuring (a.deuring@satzbau-gmbh.de)
Date: Tue May 02 2000 - 09:07:53 PDT

  • Next message: Rene Rebe: "Re: AVISION support for SANE!"

    Douglas Gilbert wrote:
    >
    > abel deuring wrote:
    > >
    > > it is not only a problem of or for the Canon backend, it is also a
    > > problem of the sanei_scsi-library. With the functions sanei_scsi_cmd and
    > > sanei_scsi_req_enter, it is not possible to explicitly set the command
    > > length.
    >
    > Ouch, that seems like a serious shortcoming. This means all pass
    > through mechanisms (e.g. sg, cam) have to guess command lengths.
    >
    > > What would be needed, is either a modified version of these functions
    > > which has the SCSI command length as an additional parameter, or -
    > > similar to the way the SG driver works - an additional function that
    > > sets the length of the next command.
    >
    > > For compatibility, I would prefer the latter, something like
    > > sanei_scsi_set_cmd_len(int fd, int len). This should fix the problems of
    > > the Canon backend for Linux, but I don't know, if or how this can be
    > > handled for the other operating systems supported by Sane.
    >
    > Setting the length of the next command is a bit of a hack brought
    > about by the lack of room for new input values in the sg_header
    > structure. The new sg_io_hdr interface structure for sg takes the
    > command length as input.

    You are right; having "proper" functions would indeed be better. So what
    about the following:

     SANE_Status sanei_scsi_req_enter2 (int fd,
                             const void * cmd, size_t cmd_size,
                             const void * src, size_t src_size,
                             void * dst, size_t * dst_size,
                             void **idp);

     SANE_Status sanei_scsi_cmd2 (int fd,
                             const void * cmd, size_t cmd_size,
                             const void * src, size_t src_size,
                             void * dst, size_t * dst_size);

    These functions would work like sanei_scsi_req_enter and sanei_scsi_cmd,
    except that *src now contains only the "real data" to be sent to the
    device, while *cmd contains the SCSI command.

    I could write an implementation for Linux during the next days, but I
    would like to hear if there are other things missing. And of course it
    does not make very much sense to write only the Linux part...

    Abel

    --
    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 : Tue May 02 2000 - 09:06:54 PDT