sane-project-website/old-archive/2000-10/0114.html

152 wiersze
7.0 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: SANE and general USB support</TITLE>
<META NAME="Author" CONTENT="abel deuring (a.deuring@satzbau-gmbh.de)">
<META NAME="Subject" CONTENT="Re: SANE and general USB support">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Re: SANE and general USB support</H1>
<!-- received="Wed Oct 11 09:05:26 2000" -->
<!-- isoreceived="20001011160526" -->
<!-- sent="Wed, 11 Oct 2000 18:18:36 +0200" -->
<!-- isosent="20001011161836" -->
<!-- name="abel deuring" -->
<!-- email="a.deuring@satzbau-gmbh.de" -->
<!-- subject="Re: SANE and general USB support" -->
<!-- id="39E492DC.A10FD697@satzbau-gmbh.de" -->
<!-- inreplyto="Springmail.105.971276415.0.74160200@www.springmail.com" -->
<STRONG>From:</STRONG> abel deuring (<A HREF="mailto:a.deuring@satzbau-gmbh.de?Subject=Re:%20SANE%20and%20general%20USB%20support&In-Reply-To=&lt;39E492DC.A10FD697@satzbau-gmbh.de&gt;"><EM>a.deuring@satzbau-gmbh.de</EM></A>)<BR>
<STRONG>Date:</STRONG> Wed Oct 11 2000 - 09:18:36 PDT
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0115.html">Oliver Neukum: "Re: SANE and general USB support"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0113.html">Jay Higley: "Re: HP ScanJet 3300"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0110.html">cbagwell@sprynet.com: "SANE and general USB support"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0115.html">Oliver Neukum: "Re: SANE and general USB support"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#114">[ date ]</A>
<A HREF="index.html#114">[ thread ]</A>
<A HREF="subject.html#114">[ subject ]</A>
<A HREF="author.html#114">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
<A HREF="mailto:cbagwell@sprynet.com?Subject=Re:%20SANE%20and%20general%20USB%20support&In-Reply-To=&lt;39E492DC.A10FD697@satzbau-gmbh.de&gt;">cbagwell@sprynet.com</A> wrote:
<BR>
<EM>&gt;
</EM><BR>
<EM>&gt; Hi,
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; I'm interested in improving USB support inside of SANE since I have a USB scanner (Acer 640BU). I'd like to see if anyone else is currently working in this area. I must admit I have only looked at version 1.0.3 (not CVS) and only about a months worth of the mailing list archive.
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; I see three main problems effecting current USB scanners in SANE. First, there is no generic support for USB like there is for SCSI (ie sanei_scsi.c). This means that we can not override these functions to always return failure on platforms that do not support USB. At the least, this should mean that any USB scanner drivers will fail to compile on non-Linux platforms when USB kerenl functions are called.
</EM><BR>
<P>(disclaimer: Up to now I had never anything to do with USB devices under
<BR>
Linux, so I might be going to write nosense...) What about to introduce
<BR>
something like sanei_usb.c ? This way, it would at least be possible to
<BR>
write dummy functions for other operating systems than Linux. And
<BR>
perhaps the folks working on *BSD have also done some work for USB
<BR>
support. Newer Macintoshes have a USB interface, and perhaps somebody
<BR>
will port Sane to MacOS X.
<BR>
<P><EM>&gt;
</EM><BR>
<EM>&gt; Next, there needs to be enhanced support in the sanei_config2.c files. They understand a SCSI keyword in config files and will search a /proc directory to find it. The same should be implemented for USB.
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; Lastly, most of the scanner drivers are SCSI oriented and support placing just a device name in the config like like /dev/scanner. The problem here is that we do not do any error checking inside of scsi open() functions to make sure its actually a SCSI device. We also immediately start doing SCSI related ioctl() calls. Since /dev/scanner is a generic link, on systems with USB scanners we start doing SCSI ioctl()'s during scans to see whats out there. This tends to lock up the current versions of the USB kernel code (well, it takes minutes for it to time out anyways).
</EM><BR>
<P>Interesting. Without knowing, where exactly and why this time out
<BR>
occurs, I'd suggest the following:
<BR>
A better error check in sanei_scsi_open could be done by calling stat(2)
<BR>
and readlink(2) for &quot;/dev/scanner&quot; (or whichever device file name),
<BR>
before the device file is actually opened. Another option would be to
<BR>
extend the &quot;else&quot;-part (line 1175) of the &quot;if (0 == ioctl(fd,
<BR>
SG_GET_VERSION_NUM, &amp;sg_version))&quot; (line 1105). There, another SG
<BR>
specific ioctl-call like SG_GET_TIMEOUT could be inserted, just to check
<BR>
if it is successful: If it is not, the device file should be closed, and
<BR>
sanei_scsi_open returns an error.
<BR>
<P><EM>&gt; I'd like to address these 3 issues. Is it OK for me to start hacking the sanei directory or should I discuss some designs with someone?
</EM><BR>
<P>As already said, I don't know much about USB, I'm just wondering about
<BR>
the following: If a scanner has fairly similar commands in a USB version
<BR>
and in a SCSI version, one could think of something roughly similar to
<BR>
the ide-scsi driver (not necessarily as a kernel module; perhaps
<BR>
sanei_scsi.c could be modified to support &quot;SCSI over USB&quot;. Another
<BR>
option would be to introduce another layer between the backend and
<BR>
sanei_scsi.c resp. sanei_usb.c, which simply calls either sanei_scsi_cmd
<BR>
or sanei_usb_cmd and friends, and which could handle the detection, if a
<BR>
SCSI or USB scanner is present). This would keep the backend source code
<BR>
simple.
<BR>
<P>Abel
<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?Subject=Re:%20SANE%20and%20general%20USB%20support&In-Reply-To=&lt;39E492DC.A10FD697@satzbau-gmbh.de&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0115.html">Oliver Neukum: "Re: SANE and general USB support"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0113.html">Jay Higley: "Re: HP ScanJet 3300"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0110.html">cbagwell@sprynet.com: "SANE and general USB support"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0115.html">Oliver Neukum: "Re: SANE and general USB support"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#114">[ date ]</A>
<A HREF="index.html#114">[ thread ]</A>
<A HREF="subject.html#114">[ subject ]</A>
<A HREF="author.html#114">[ 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>Wed Oct 11 2000 - 10:20:26 PDT</EM>
</EM>
</SMALL>
</BODY>
</HTML>