sane-project-website/old-archive/2001-05/0052.html

220 wiersze
7.5 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: HP 7400c info / Minolta Scan Dual II</TITLE>
<META NAME="Author" CONTENT="EdHamrick@aol.com (EdHamrick@aol.com)">
<META NAME="Subject" CONTENT="Re: HP 7400c info / Minolta Scan Dual II">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Re: HP 7400c info / Minolta Scan Dual II</H1>
<!-- received="Thu May 3 13:07:27 2001" -->
<!-- isoreceived="20010503200727" -->
<!-- sent="Thu, 3 May 2001 16:16:38 EDT" -->
<!-- isosent="20010503201638" -->
<!-- name="EdHamrick@aol.com" -->
<!-- email="EdHamrick@aol.com" -->
<!-- subject="Re: HP 7400c info / Minolta Scan Dual II" -->
<!-- id="b9.dcd34b0.282316a6@aol.com" -->
<!-- inreplyto="HP 7400c info / Minolta Scan Dual II" -->
<STRONG>From:</STRONG> <A HREF="mailto:EdHamrick@aol.com?Subject=Re:%20HP%207400c%20info%20/%20Minolta%20Scan%20Dual%20II&In-Reply-To=&lt;b9.dcd34b0.282316a6@aol.com&gt;"><EM>EdHamrick@aol.com</EM></A><BR>
<STRONG>Date:</STRONG> Thu May 03 2001 - 13:16:38 PDT
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0053.html">Stephen Williams: "Re: SANE API &amp; file format"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0051.html">Henning Meier-Geinitz: "Re: New backend: UMAX 1220P sane'ification take 1"</A>
<!-- nextthread="start" -->
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#52">[ date ]</A>
<A HREF="index.html#52">[ thread ]</A>
<A HREF="subject.html#52">[ subject ]</A>
<A HREF="author.html#52">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
In a message dated 5/3/2001 4:52:31 AM EST, <A HREF="mailto:Oliver.Neukum@lrz.uni-muenchen.de?Subject=Re:%20HP%207400c%20info%20/%20Minolta%20Scan%20Dual%20II&In-Reply-To=&lt;b9.dcd34b0.282316a6@aol.com&gt;">Oliver.Neukum@lrz.uni-muenchen.de</A>
<BR>
writes:
<BR>
<P><EM>&gt; Our disagreement seems to be rather in the type of scanners that should
</EM><BR>
<EM>&gt; appear as scsi devices to user space.
</EM><BR>
<EM>&gt; If I understand Ed correctly, to him that would be all of them.
</EM><BR>
<P>That's correct - but I'd make it a generic scsi-&gt;usb driver that
<BR>
could easily be modified to add support for other usb peripherals
<BR>
that encapsulate scsi over usb.
<BR>
<P>The reason USB is so messed up on Linux is that too many people
<BR>
took the easy way out instead of planning for the future. For instance,
<BR>
whoever wrote the scanner.c driver didn't even add the capability to
<BR>
ask the device what it's VID/PID is or to allow reading the interrupt
<BR>
channel. As a result, there are a slew of barely working drivers
<BR>
for scanners, and even these are kludges that are poorly tested
<BR>
(i.e. the HP5300 driver doesn't work with the Scan Dual II).
<BR>
<P>The right way to handle USB scanners in the kernel is a single
<BR>
device driver that does scsi-&gt;usb translation.
<BR>
<P><EM>&gt; Firewire is a better design. There is no question about that.
</EM><BR>
<EM>&gt; USB has no common protocol for transfering SCSI commands.
</EM><BR>
<EM>&gt; In fact I know of _six_ incompatible protocols to do that.
</EM><BR>
<P>These are the ones I know of:
<BR>
<P>&nbsp;&nbsp;1) HP/Epson (read/write bulk endpoints)
<BR>
&nbsp;&nbsp;2) Avision
<BR>
&nbsp;&nbsp;3) Acer/AGFA SnapScan
<BR>
&nbsp;&nbsp;4) Nikon LS-40
<BR>
&nbsp;&nbsp;5) Microtek (actually at least 2 different types)
<BR>
&nbsp;&nbsp;6) Canon FB-series
<BR>
<P>For #1, the driver needs to emulate the scsi INQUIRY
<BR>
command based on the VID/PID, but this is only a few
<BR>
lines of code.
<BR>
<P><EM>&gt; The attempt to unify them leads to a monster like usb-storage.
</EM><BR>
<EM>&gt; I wanted to add the microtek protocol to usb-storage, but Matt vetoed that.
</EM><BR>
<P>It's open source - you can add what you want to whatever you
<BR>
want. Working code (if it's more elegant than the code it replaces) rules.
<BR>
<P><EM>&gt; I could trivially merge microtek and hp5300 to a common driver.
</EM><BR>
<EM>&gt; However there would still be the generic driver (scanner.c) and
</EM><BR>
<EM>&gt; the two drivers currently under development for even stranger scanners.
</EM><BR>
<P>The only thing remaining for scanner.c is Epson and HP, and
<BR>
these are better done in the single scsi-&gt;usb driver.
<BR>
<P><EM>&gt; Reducing the number of drivers from 5 to 4 isn't IMHO worth the trouble.
</EM><BR>
<EM>&gt; Unless you go to one, you need to look it up anyway, thus simplicity in
</EM><BR>
<EM>&gt; kernel is more important.
</EM><BR>
<P>Yes, going to one scsi-&gt;usb driver is the way to go (including
<BR>
storage).
<BR>
<P><EM>&gt; As for configuration, loading a driver for your usb scanner is the same
</EM><BR>
<EM>&gt; trouble as loading a driver for the controller your scsi scanner is
</EM><BR>
attached
<BR>
<EM>&gt; to.
</EM><BR>
<P>The problem is that there's too much user-configuration that needs
<BR>
to be done. A user should just run a scanner program, and the
<BR>
scanner program should determine what scanners are connected
<BR>
to the system.
<BR>
<P><EM>&gt; After that for microtek and hp5300 then you can probe as for conventional
</EM><BR>
<EM>&gt; scsi. Generic usb scanners are a problem though.
</EM><BR>
<P>They're only a problem because the user-mode interface to the
<BR>
usb subsystem is so primitive on Linux, and you can't even get
<BR>
the VID/PID of a scanner from user space.
<BR>
<P><EM>&gt; For generic scanners you _could_ go the easy route.
</EM><BR>
<EM>&gt; Emulate INQUIRY based on a table of vend./prod. ids and
</EM><BR>
<EM>&gt; map read/write over usb to SCSI_READ/SCSI_WRITE.
</EM><BR>
<P>Yes, this is what I do in VueScan on Windows and Mac OS.
<BR>
It works quite nicely. Just run VueScan on Windows, Linux
<BR>
or Mac OS with any USB scanner and turn on the log file (a
<BR>
dump of the scsi commands) and you'll see this. VueScan
<BR>
works with scanner.c on Linux, but you have to tell it the
<BR>
device name, the VID and the PID. It doesn't work with
<BR>
Avision scanners (Scan Dual II, 5300C, 7400C) on Linux
<BR>
because scanner.c doesn't allow reading the interrupt
<BR>
pipe.
<BR>
<P><EM>&gt; It can be done. Even the unusual scanners could be handled with vendor
</EM><BR>
<EM>&gt; specific commands. However at some point you end up with a scsi
</EM><BR>
interpreter
<BR>
<EM>&gt; in kernel.
</EM><BR>
<P>It's all very simple table-driven, finite state machine stuff.
<BR>
<P>Regards,
<BR>
Ed Hamrick
<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:%20HP%207400c%20info%20/%20Minolta%20Scan%20Dual%20II&In-Reply-To=&lt;b9.dcd34b0.282316a6@aol.com&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0053.html">Stephen Williams: "Re: SANE API &amp; file format"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0051.html">Henning Meier-Geinitz: "Re: New backend: UMAX 1220P sane'ification take 1"</A>
<!-- nextthread="start" -->
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#52">[ date ]</A>
<A HREF="index.html#52">[ thread ]</A>
<A HREF="subject.html#52">[ subject ]</A>
<A HREF="author.html#52">[ 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>Thu May 03 2001 - 13:07:48 PDT</EM>
</EM>
</SMALL>
</BODY>
</HTML>