kopia lustrzana https://gitlab.com/sane-project/website
99 wiersze
4.8 KiB
HTML
99 wiersze
4.8 KiB
HTML
<!-- received="Thu Dec 2 19:01:35 1999 PST" -->
|
||
<!-- sent="Thu, 02 Dec 1999 22:10:28 -0500" -->
|
||
<!-- name="Douglas Gilbert" -->
|
||
<!-- email="dgilbert@interlog.com" -->
|
||
<!-- subject="Re: Problem with SANE and SCSI scanner" -->
|
||
<!-- id="" -->
|
||
<!-- inreplyto="Problem with SANE and SCSI scanner" -->
|
||
<title>sane-devel: Re: Problem with SANE and SCSI scanner</title>
|
||
<h1>Re: Problem with SANE and SCSI scanner</h1>
|
||
<b>Douglas Gilbert</b> (<a href="mailto:dgilbert@interlog.com"><i>dgilbert@interlog.com</i></a>)<br>
|
||
<i>Thu, 02 Dec 1999 22:10:28 -0500</i>
|
||
<p>
|
||
<ul>
|
||
<li> <b>Messages sorted by:</b> <a href="date.html#25">[ date ]</a><a href="index.html#25">[ thread ]</a><a href="subject.html#25">[ subject ]</a><a href="author.html#25">[ author ]</a>
|
||
<!-- next="start" -->
|
||
<li> <b>Next message:</b> <a href="0026.html">Petter Reinholdtsen: "Cross platform GUI toolkit"</a>
|
||
<li> <b>Previous message:</b> <a href="0024.html">Petter Reinholdtsen: "Re: SANE Net backend suggestion..."</a>
|
||
<!-- nextthread="start" -->
|
||
<!-- reply="end" -->
|
||
</ul>
|
||
<!-- body="start" -->
|
||
Manuel Panea wrote:<br>
|
||
<i>> </i><br>
|
||
<i>> [snip]</i><br>
|
||
<i>> > The failure (EIO) on the sg device handle (4 in this case)</i><br>
|
||
<i>> > indicates the buffer passed to sg's write() was too small.</i><br>
|
||
<i>> > A length of 42 implies a maximum SCSI command length of 6</i><br>
|
||
<i>> > bytes (because the accompanying sg_header structure is 36</i><br>
|
||
<i>> > bytes long). Digging around the canon backend code in</i><br>
|
||
<i>> > sane-1.0.1, it seems to be sending an opcode of 0xd5</i><br>
|
||
<i>> > for "GET SCAN MODE". Such an opcode can only be 10 bytes</i><br>
|
||
<i>> > long (12 bytes if another flag was set but I can see above</i><br>
|
||
<i>> > it is not).</i><br>
|
||
<i>> ></i><br>
|
||
<i>> > Doug Gilbert</i><br>
|
||
<i>> > Linux sg maintainer</i><br>
|
||
<i>> </i><br>
|
||
<i>> Aha! So *you* are the sg maintainer. If you have read my last answer to</i><br>
|
||
<i>> Laura, you know that you are right: sg and sane get confused about the</i><br>
|
||
<i>> SCSI command sizes.</i><br>
|
||
<p>
|
||
The maintainers of various parts of the Linux kernel <br>
|
||
and associated drivers are listed in<br>
|
||
/usr/src/linux/MAINTAINERS . The maintainers are asked to<br>
|
||
monitor relevant newsgroups and let it be known once<br>
|
||
in a while. There may well be maintainers of other free OSes<br>
|
||
also monitoring this group.<br>
|
||
<p>
|
||
<i>> Now why is this so? I was (fortunately) told about this problem by a canon</i><br>
|
||
<i>> backend user who described it as a bug in sg, but now you talk as if it</i><br>
|
||
<i>> were sane's fault. So is it sg's fault or is it sane's fault? (I don't</i><br>
|
||
<i>> think it can be the backend's fault, all I do is try to send the scanner a</i><br>
|
||
<i>> perfectly valid SCSI command.) What should be changed to not have to tell</i><br>
|
||
<i>> the users to "go patch /usr/src/linux/drivers/scsi/sg.c"?</i><br>
|
||
<p>
|
||
Manuel,<br>
|
||
<p>
|
||
The Linux sg driver has been around since 1992 with its<br>
|
||
awkward "sg_header" based interface. It makes many <br>
|
||
assumptions, one of which is that SCSI commands with<br>
|
||
opcodes >= 0xc0 can only be 10 or 12 bytes long. Obviously<br>
|
||
this is why the Canon driver needs or needed that patch.<br>
|
||
<p>
|
||
Things are gradually being improved. From and including<br>
|
||
lk 2.2.10 there is an ioctl() in sg called SG_NEXT_CMD_LEN<br>
|
||
that sets the length of the next SCSI command. That solves<br>
|
||
your immediate problem. The sg version number can be found <br>
|
||
with the ioctl() SG_GET_VERSION_NUM. There is an additional<br>
|
||
interface structure called sg_io_hdr that is being added <br>
|
||
to the sg driver in the linux 2.3 development tree. Abel<br>
|
||
Deuring <<a href="mailto:a.deuring@satzbau-gmbh.de">a.deuring@satzbau-gmbh.de</a>> has developed a Mustek <br>
|
||
backend using it. More information about sg can be found<br>
|
||
at <a href="http://www.torque.net/sg">http://www.torque.net/sg</a> .<br>
|
||
<p>
|
||
Returning to Laura's strace output from yesterday. The<br>
|
||
strace output indicated that a write() called failed<br>
|
||
with an EIO error yet the Sane error message was:<br>
|
||
"open of device canon:/dev/sga failed: Invalid argument".<br>
|
||
With accurate error information and a document like<br>
|
||
/usr/src/linux/Documentation/scsi-generic.txt perhaps<br>
|
||
this problem could have been diagnosed earlier.<br>
|
||
<p>
|
||
Doug Gilbert<br>
|
||
<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">majordomo@mostang.com</a>
|
||
</pre>
|
||
<!-- body="end" -->
|
||
<p>
|
||
<ul>
|
||
<!-- next="start" -->
|
||
<li> <b>Next message:</b> <a href="0026.html">Petter Reinholdtsen: "Cross platform GUI toolkit"</a>
|
||
<li> <b>Previous message:</b> <a href="0024.html">Petter Reinholdtsen: "Re: SANE Net backend suggestion..."</a>
|
||
<!-- nextthread="start" -->
|
||
<!-- reply="end" -->
|
||
</ul>
|