sane-project-website/old-archive/2000-05/0057.html

232 wiersze
7.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>sane-devel: Re: problems with Canon scanner</TITLE>
<META NAME="Author" CONTENT="abel deuring (a.deuring@satzbau-gmbh.de)">
<META NAME="Subject" CONTENT="Re: problems with Canon scanner">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Re: problems with Canon scanner</H1>
<!-- received="Sun May 7 11:42:59 2000" -->
<!-- isoreceived="20000507184259" -->
<!-- sent="Sun, 07 May 2000 14:21:32 +0200" -->
<!-- isosent="20000507122132" -->
<!-- name="abel deuring" -->
<!-- email="a.deuring@satzbau-gmbh.de" -->
<!-- subject="Re: problems with Canon scanner" -->
<!-- id="39155FCC.66A35F83@satzbau-gmbh.de" -->
<!-- inreplyto="390EFD59.A0862117@satzbau-gmbh.de" -->
<STRONG>From:</STRONG> abel deuring (<A HREF="mailto:a.deuring@satzbau-gmbh.de?Subject=Re:%20problems%20with%20Canon%20scanner&In-Reply-To=&lt;39155FCC.66A35F83@satzbau-gmbh.de&gt;"><EM>a.deuring@satzbau-gmbh.de</EM></A>)<BR>
<STRONG>Date:</STRONG> Sun May 07 2000 - 05:21:32 PDT
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0058.html">Joachim Ansorg: "Re: gimp plug-in 1.1.21"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0056.html">Henning Meier-Geinitz: "README updates?"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0019.html">abel deuring: "Re: problems with Canon scanner"</A>
<!-- nextthread="start" -->
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#57">[ date ]</A>
<A HREF="index.html#57">[ thread ]</A>
<A HREF="subject.html#57">[ subject ]</A>
<A HREF="author.html#57">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
abel deuring wrote:
<BR>
<P><EM>&gt;
</EM><BR>
<EM>&gt; SANE_Status sanei_scsi_req_enter2 (int fd,
</EM><BR>
<EM>&gt; const void * cmd, size_t cmd_size,
</EM><BR>
<EM>&gt; const void * src, size_t src_size,
</EM><BR>
<EM>&gt; void * dst, size_t * dst_size,
</EM><BR>
<EM>&gt; void **idp);
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; SANE_Status sanei_scsi_cmd2 (int fd,
</EM><BR>
<EM>&gt; const void * cmd, size_t cmd_size,
</EM><BR>
<EM>&gt; const void * src, size_t src_size,
</EM><BR>
<EM>&gt; void * dst, size_t * dst_size);
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; These functions would work like sanei_scsi_req_enter and sanei_scsi_cmd,
</EM><BR>
<EM>&gt; except that *src now contains only the &quot;real data&quot; to be sent to the
</EM><BR>
<EM>&gt; device, while *cmd contains the SCSI command.
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; I could write an implementation for Linux during the next days, but I
</EM><BR>
<EM>&gt; would like to hear if there are other things missing. And of course it
</EM><BR>
<EM>&gt; does not make very much sense to write only the Linux part...
</EM><BR>
<P>ok, attached are diff outputs against sane-1.0.2 for sanei/sanei_scsi.c,
<BR>
include/sane/sanei_scsi.h, backend/canon-scsi.c and backend/sharp.c.
<BR>
&nbsp;
<BR>
The modifications introduce the functions
<BR>
&nbsp;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;SANE_Status sanei_scsi_req_enter2 (int fd,
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const void * cmd, size_t cmd_size,
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const void * src, size_t src_size,
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void * dst, size_t * dst_size,
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void **idp)
<BR>
&nbsp;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;SANE_Status sanei_scsi_req_cmd2 (int fd,
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const void * cmd, size_t cmd_size,
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const void * src, size_t src_size,
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void * dst, size_t * dst_size)
<BR>
&nbsp;
<BR>
Because the SCSI command block and the data to be written to the device
<BR>
are now in different locations, there is no longer the need to guess the
<BR>
command length. This should avoid the need to patch the Linux kernel in
<BR>
order to use Canon scanners.
<BR>
&nbsp;
<BR>
I changed these functions for _all_ operating systems. But since I am
<BR>
not able to test these changes except for Linux, and since I don<6F>t want
<BR>
to mess up Sane<6E>s SCSI library, I did not upload them to the CVS
<BR>
server.
<BR>
&nbsp;
<BR>
But of course I would appreciate tests of the modified SCSI library for
<BR>
the different OSes. Because the old functions sanei_scsi_cmd and
<BR>
sanei_scsi_req_enter now call the new functions sanei_scsi_cmd2 resp.
<BR>
sanei_scsi_enter2, every backend for a SCSI scanner can be used for
<BR>
these tests.
<BR>
&nbsp;
<BR>
The patch for canon-scsi.c uses the new function sanei_scsi_cmd2, where
<BR>
the vendor specfic SCSI commands are called. I am not sure, if I got the
<BR>
changes to the three affected functions (define_scan_mode,
<BR>
get_scan_mode, set_adf_mode) right, especially in define_scan_mode. I
<BR>
don<EFBFBD>t have a Canon scanner at hand, so it is possible that the actual
<BR>
patch even makes things worse...
<BR>
<P>The patch to the Sharp backend simply replaces sanei_scsi_cmd with
<BR>
sanei_scsi_cmd2 at a few points. It doesn<73>t introduce any new
<BR>
functionality, but should simply show, that the new function actually
<BR>
works.
<BR>
&nbsp;
<BR>
The part &quot;#if USE == BSD_INTERFACE&quot; of sanei_scsi.c contains in line
<BR>
2288 a comment, where I did not understand the original source: The size
<BR>
of the data block (without the SCSI command block) to be send to the
<BR>
device was src_size, not src_size - cdb_size, so that the kernel might
<BR>
read past the end of the data, in my understanding. Whatsoever, my
<BR>
changes declare a shorter data block, so either I fixed a bug, or I
<BR>
introduced one.
<BR>
&nbsp;
<BR>
Regarding the part &quot;#if USE == OPENSTEP&quot;, starting at line 2484, it
<BR>
seems that the Openstep SG driver (or hoewever it is called) must guess
<BR>
the length of the SCSI command: There was and is not statement that sets
<BR>
something like &quot;hdr.sr_cdb_size&quot;. Is that correct? If it is, is there a
<BR>
need to set the CDB length for vendor specific commands?
<BR>
&nbsp;
<BR>
Abel
<BR>
<BR><HR NOSHADE>
<UL>
<LI>application/octet-stream attachment: <A HREF="att-0057/01-sanei_scsi.diff">sanei_scsi.diff</A>
</UL>
<!-- attachment="01-sanei_scsi.diff" -->
<P><P><PRE>
--
Source code, list archive, and docs: <A HREF="http://www.mostang.com/sane/">http://www.mostang.com/sane/</A>
To unsubscribe: echo unsubscribe sane-devel | mail <A HREF="mailto:majordomo@mostang.com?Subject=Re:%20problems%20with%20Canon%20scanner&In-Reply-To=&lt;39155FCC.66A35F83@satzbau-gmbh.de&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0058.html">Joachim Ansorg: "Re: gimp plug-in 1.1.21"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0056.html">Henning Meier-Geinitz: "README updates?"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0019.html">abel deuring: "Re: problems with Canon scanner"</A>
<!-- nextthread="start" -->
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#57">[ date ]</A>
<A HREF="index.html#57">[ thread ]</A>
<A HREF="subject.html#57">[ subject ]</A>
<A HREF="author.html#57">[ author ]</A>
</UL>
<!-- trailer="footer" -->
<HR NOSHADE>
<P>
<SMALL>
<EM>
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
: <EM>Sun May 07 2000 - 11:44:26 PDT</EM>
</EM>
</SMALL>
</BODY>
</HTML>