sane-project-website/old-archive/2001-01/0301.html

359 wiersze
11 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-2022-jp">
<TITLE>sane-devel: The aha152x panic of Canon Backend for FB620S</TITLE>
<META NAME="Author" CONTENT="Mitsuru Okaniwa (m-okaniwa@bea.hi-ho.ne.jp)">
<META NAME="Subject" CONTENT="The aha152x panic of Canon Backend for FB620S">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>The aha152x panic of Canon Backend for FB620S</H1>
<!-- received="Sun Jan 28 20:03:09 2001" -->
<!-- isoreceived="20010129040309" -->
<!-- sent="Mon, 29 Jan 2001 13:03:40 +0900" -->
<!-- isosent="20010129040340" -->
<!-- name="Mitsuru Okaniwa" -->
<!-- email="m-okaniwa@bea.hi-ho.ne.jp" -->
<!-- subject="The aha152x panic of Canon Backend for FB620S" -->
<!-- id="001501c089a8$a53ca520$6425530a@necpcuser" -->
<!-- charset="iso-2022-jp" -->
<STRONG>From:</STRONG> Mitsuru Okaniwa (<A HREF="mailto:m-okaniwa@bea.hi-ho.ne.jp?Subject=Re:%20The%20aha152x%20panic%20of%20Canon%20Backend%20for%20FB620S&In-Reply-To=&lt;001501c089a8$a53ca520$6425530a@necpcuser&gt;"><EM>m-okaniwa@bea.hi-ho.ne.jp</EM></A>)<BR>
<STRONG>Date:</STRONG> Sun Jan 28 2001 - 20:03:40 PST
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0302.html">stef: "UMAX 1220P/2000P &amp; HP 320C backend initial release"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0300.html">Alex Belits: "Re: FireWire (i.Link / 1394) support?"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0308.html">Juergen E Fischer: "Re: The aha152x panic of Canon Backend for FB620S"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0308.html">Juergen E Fischer: "Re: The aha152x panic of Canon Backend for FB620S"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#301">[ date ]</A>
<A HREF="index.html#301">[ thread ]</A>
<A HREF="subject.html#301">[ subject ]</A>
<A HREF="author.html#301">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
Hi
<BR>
I modified Canon backend for FB620S and SANE1.0.3.
<BR>
I have added a reset_scanner function and a calibration function as
<BR>
follows.
<BR>
<P>1) a reset_scanner
<BR>
This command resets the scanner.
<BR>
When issuing this Reset command during a scan, follow the procedure below:
<BR>
* Switch to the Standby mode (return to HP).
<BR>
* Execute Reset, then send back the Status.
<BR>
<P>This command sends back an error only in the case of a command parameter
<BR>
error.
<BR>
For other errors(like HP errors), it still sends back the Good status.
<BR>
<P>I modified canon-scsi.c as follows.
<BR>
=================================================
<BR>
static SANE_Status
<BR>
reset_scanner (int fd)
<BR>
{
<BR>
&nbsp;&nbsp;static u_char cmd[6];
<BR>
&nbsp;&nbsp;int status;
<BR>
&nbsp;&nbsp;DBG (31, &quot;&gt;&gt; reset_scanner\n&quot;);
<BR>
<P>&nbsp;&nbsp;memset (cmd, 0, sizeof (cmd));
<BR>
&nbsp;&nbsp;cmd[0] = 0xc1;
<BR>
&nbsp;&nbsp;status = sanei_scsi_cmd2 (fd, cmd, sizeof (cmd), 0, 0, 0, 0);
<BR>
<P>&nbsp;&nbsp;DBG (31, &quot;&lt;&lt; reset_scanner \n&quot;);
<BR>
&nbsp;&nbsp;return (status);
<BR>
}
<BR>
=================================================
<BR>
<P>And modified canon-sane.c as follows.
<BR>
=================================================
<BR>
In sane_get_parameters function
<BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;case OPT_RESET_SCANNER:
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sanei_scsi_open (s-&gt;hw-&gt;sane.name, &amp;s-&gt;fd, sense_handler, 0);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (status == SANE_STATUS_GOOD)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;status = reset_scanner(s-&gt;fd);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (status != SANE_STATUS_GOOD)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;DBG (21, &quot;RESET SCANNER failed\n&quot;);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sanei_scsi_close (s-&gt;fd);
<BR>
&nbsp;s-&gt;fd = -1;
<BR>
&nbsp;return (SANE_STATUS_INVAL);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DBG (21, &quot;RESET SCANNER\n&quot;);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sanei_scsi_close (s-&gt;fd);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DBG (1, &quot;reset scanner: cannot open device file\n&quot;);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s-&gt;fd = -1;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return status;
<BR>
=================================================
<BR>
<P><P>2) a calibration
<BR>
modulated-light data setting and shading.
<BR>
<P>I modified canon-scsi.c as follows.
<BR>
=================================================
<BR>
static SANE_Status
<BR>
execute_calibration (int fd)
<BR>
{
<BR>
&nbsp;&nbsp;static u_char cmd[6];
<BR>
&nbsp;&nbsp;u_char data[2];
<BR>
&nbsp;&nbsp;int status;
<BR>
&nbsp;&nbsp;DBG (31, &quot;&gt;&gt; execute_calibration\n&quot;);
<BR>
<P>&nbsp;&nbsp;memset (cmd, 0, sizeof (cmd));
<BR>
&nbsp;&nbsp;memset (data, 0, sizeof (data));
<BR>
&nbsp;&nbsp;cmd[0] = 0xc2;
<BR>
&nbsp;&nbsp;cmd[4] = 2;
<BR>
&nbsp;&nbsp;status = sanei_scsi_cmd2 (fd, cmd, sizeof (cmd), data, sizeof (data), 0,
<BR>
0);
<BR>
<P>&nbsp;&nbsp;DBG (31, &quot;&lt;&lt; execute_calibration\n&quot;);
<BR>
&nbsp;&nbsp;return (status);
<BR>
}
<BR>
=================================================
<BR>
<P>And modified canon-sane.c as follows.
<BR>
=================================================
<BR>
In sane_get_parameters function
<BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;case OPT_CALIBRATION_NOW:
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sanei_scsi_open (s-&gt;hw-&gt;sane.name, &amp;s-&gt;fd, sense_handler, 0);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (status == SANE_STATUS_GOOD)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;status = execute_calibration(s-&gt;fd);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (status != SANE_STATUS_GOOD)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;DBG (21, &quot;EXECUTE CALIBRATION failed\n&quot;);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sanei_scsi_close (s-&gt;fd);
<BR>
&nbsp;s-&gt;fd = -1;
<BR>
&nbsp;return (SANE_STATUS_INVAL);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DBG (21, &quot;EXECUTE CALIBRATION\n&quot;);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sanei_scsi_close (s-&gt;fd);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DBG (1, &quot;calibration: cannot open device file\n&quot;);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s-&gt;fd = -1;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return status;
<BR>
&nbsp;=================================================
<BR>
I have made the button of &quot;reset_scanner&quot; and &quot;execute_calibration&quot;
<BR>
in the xscanimage.
<BR>
It was run very well.....
<BR>
So, this modification seemed to be successful at first.
<BR>
But when I used xscanimage as follows I found the bug.
<BR>
<P>In xscanimage, during a return to the start position of a light
<BR>
source bar in scanner after the preview, I click the reset_scanner button.
<BR>
Then a light bar in scanner stop halfway.
<BR>
And I click the execute_calibration button.
<BR>
So, the calibration does not run and I have an &quot;aha152x panic&quot;.
<BR>
I must reboot the Linux to run the xscanimage.
<BR>
And X server was broken.
<BR>
<P>The kernel(2.2.16) was not shutdown normally as follows.
<BR>
My computer is note-PC and I use Adaptec Slim SCSI(aha152x).
<BR>
<P>========================================================
<BR>
Shutting down interface eth0
<BR>
Stopping pcmcia SCSI device not inactive - r
<BR>
rq - status = 1, target = 2, pid = 912, state = 4099, owner = 258.
<BR>
Device busy ???
<BR>
target doesn't enter MSGI to identify(phase = 01)
<BR>
<P>aha152x: unknown lun
<BR>
QUEUE STATUS:
<BR>
issue_SC:
<BR>
current_SC:
<BR>
none
<BR>
disconnected_SC:
<BR>
0xc2ee600: target = 2; lun = 0; cmnd = (VENDOR SPECIFIC (0xc2) 00 00 00 02
<BR>
00 00 00 00 00); residual = 0; buffers = 0; phase | disconnected |
<BR>
send_ident |;
<BR>
in other (MESSAGE IN); phaseend; next = 0x00000000
<BR>
enabled interrupts (ENSELDO ENSELDI ENSELINGO ENSWRAP ENSDONE ENSPIORDY
<BR>
ENDMADONE ENSELTIMO ENATNTARG ENPHASEMIS ENBUSFREE ENSCSIPERR ENPHASECHG
<BR>
ENREQINIT)
<BR>
Kernel panic: aha152x panic
<BR>
In interrupt handler - not syncing
<BR>
========================================================
<BR>
<P>I don't know the reason of this bug.
<BR>
This problem is hard.
<BR>
<P>Would anybody help me ?
<BR>
regards,
<BR>
-----------------------------
<BR>
Mitsuru Okaniwa
<BR>
email : <A HREF="mailto:m-okaniwa@bea.hi-ho.ne.jp?Subject=Re:%20The%20aha152x%20panic%20of%20Canon%20Backend%20for%20FB620S&In-Reply-To=&lt;001501c089a8$a53ca520$6425530a@necpcuser&gt;">m-okaniwa@bea.hi-ho.ne.jp</A>
<BR>
tel : (Japan)0566-26-6105
<BR>
-----------------------------
<BR>
<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:%20The%20aha152x%20panic%20of%20Canon%20Backend%20for%20FB620S&In-Reply-To=&lt;001501c089a8$a53ca520$6425530a@necpcuser&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0302.html">stef: "UMAX 1220P/2000P &amp; HP 320C backend initial release"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0300.html">Alex Belits: "Re: FireWire (i.Link / 1394) support?"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0308.html">Juergen E Fischer: "Re: The aha152x panic of Canon Backend for FB620S"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0308.html">Juergen E Fischer: "Re: The aha152x panic of Canon Backend for FB620S"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#301">[ date ]</A>
<A HREF="index.html#301">[ thread ]</A>
<A HREF="subject.html#301">[ subject ]</A>
<A HREF="author.html#301">[ 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 Jan 28 2001 - 20:17:34 PST</EM>
</EM>
</SMALL>
</BODY>
</HTML>