Re: Volunteer for back end development - excellent info in this msg

Adrian Perez Jorge (adrianpj@easynews.com)
Tue, 28 Dec 1999 12:28:31 -0800

Dear Mat,
Dear David,

Mathew sienko x7439 (msienko@galaxy.nsc.com):
>Hi David,
>
>I'm glad to see that you are still interested. If you do plan on
>experamenting,
>then perhaps I should what I've been thinking about. I haven't actually
>started working on this yet because we've been quite buisy lately, but
>I hope to start soon.
>
>The merlin chips are all controlled through a register file and everything
>is done by reading or writing these registers. The datasheet describes
>these registers. The backend should then have two parts: functions to
>read and write these registers, and then the SANE API implementation that
>actually uses these functions to controll the scanner. This way, the
>interface can change and all the SANE API's can still be used. (Future
>versions of merlin may use a different interface, but this is still too
>far away to tell.) My first goal is to be able to read and write one
>register at a time. If I get any work done on this, I'll post it to
>the sane mailing list.

I would be very pleased if you, Mat, could tell me who are you trying
to read/write `lm9830' registers. Initialy, I was confused and I
thought HP4200C was using `lm9831'---because it has an USB interface---
and I was trying to read/write <reg address>+<value> to the
`/dev/usbscanner' file. Now, I know I was wrong. I can't believe my
HP4200C scanner is really a parallel port scanner hacked with some USB
interface... (but it's quick!)

Well.. the main problem is: then how this interface works?

I have been tracing (debugger) the Windowze driver (`hpad32.dll').
I have the initial values of `lm9830' registers that this driver
writes (from 08-5f), and I have seen the driver sending the '99 66 cc
33' sequence (switching transparent mode).

Now, I think write/read operations to lm930 registers doesn't use bulk
transfers; the Windoze driver uses `control vendor requests' (note
that I'm not an USB expert at all.), and I think (David, correct me)
Linux usbscanner driver uses bulk transfers to communicate with the
scanner.

>I also have a question that I am hoping you will be able to answer. In
>SANE, the back-ends can be built as shared libraries so that an application
>can easily change back-ends. Would it be easy (or possible) to separate
>the two functionalities I mentioned above into two separate library files?
>Also, can an application load and unload these back-end libraries while
>it is running? I think this would be cool because then an application
>could launch that is not tied to a specific scanner and the user could
>choose which driver to use and, for the merlin driver, choose the I/O
>interface if necessary.
>
>Matt

Well... as far as I have read in the SANE Standard Version (1.01), yes
you can switch sane backends using dynamic linking (See `Attaching to a
SANE backend', Section 3.1).

I don't know if you mean, for example, that developing a sane backend
for `lm9830', using an USB interface like the HP4200C, should also work
with a `lm9830-based' scanner but with a parallel port interface.

If the above is what you mean, I think the best/normal way to do this
is to separate the device communication protocol implementing a kernel
device driver, like the `scanner.o' module. This device driver should
supply a `/dev/<iface>' file, and then the SANE backend would
write/read to this file in an uniform way. This file should be
supplied to the backend as an option. For example, using a parallel
port interface, a module called `ppscanner.o' could support a
`/dev/ppscanner' file, and then, a parameter in `lm9830.conf' for the
`lm9830.so' SANE backend could point to this file. If we were using
an USB inteface, this option should then point to `/dev/usbscanner'.

What do you (all) think about this?

>>
>>
>> Hi Mathew,
>>
>> I really dropped the ball on this one. I had hoped to 'experiment' with
>> my 4200 using the pdf docs from NatSemi...just havn't had time to sit
>>down
>> with it. I've forward this to the sane-devel list since that should be
>> the best source for developers. I did ask Peter if he could recommend
>> anyone and noone came to his mind.
>>
>> Regards,
>> /\/elson
>>

Hey! Fortunately, I could find you, people, in this mailing list! (I
was subscribed only at <linux-usb@suse.com>)

Cheers,

Adrian Perez Jorge
<adrianpj@easynews.com>

------------------------------------------------------------
Free Web space and web based email @EASYNEWS.COM

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com