Re: Epson backend

Svend Daugaard Pedersen (sdp@vip.cybercity.dk)
Sat, 27 Feb 1999 21:53:42 +0100

David Mosberger-Tang wrote:

>Hi Svend,

>Thanks for the report, but for it to be really useful, could you send
>a patch that fixes the two problems you mention? "diff -u" is the
>preferred format. Thanks!

Well! I havn't used 'diff' before :-( (I think it is somewhere in my
computer). And there is another problem. The changes are made in the
ported backend and in this there are some very Amiga specific changes.

But the changes are really small and is listed in this mail.

>--david

>>>>>> On Sat, 27 Feb 1999 21:08:34 +0100, Svend Daugaard Pedersen
><sdp@vip.cybercity.dk> said:

> Svend> During my work on porting the Epson backend to the Amiga I
> Svend> found the following minor bugs:

> Svend> - In the call (line 634)

> Svend> 632 buf = (u_char *) head; 633 if (s->hw->is_scsi) 634
> Svend> receive (s, buf, 4, status); 635 else 636 receive (s, buf, 1,
> Svend> status);

> Svend> it is expected that the last two bytes read from the
> Svend> scanner form a legal 16 bit integer.

> Svend> This is not the case on a M680x0 processor.

I have not made the "final" solution to this problem. Since my version
of the code is to be used on M680x0 I swapped the to bytes in the 16
bit word

wordSwap(head->count);

by using this macro:

#define wordSwap(X) {u_char b;u_char* bp=(u_char*)&(X);b=*bp;*(
bp++)=*bp;*bp=b;}

> Svend> - In line 849 (procedure 'attach')
>
> Svend> dummy_dev.sane.model = (char *) memcpy (str, buf + 16 +
> Svend> 8, 8);

> Svend> 'buf' is not initialized if the scanner is a parallel port
> Svend> scanner. (I have not tested it on a parallel scanner but my
> Svend> C compiler told me that there is a potential problem).

As I said I have not used it on a parallel scanner and I have not corrected
the error.

> Svend> The ported backend has been reported to work with the
> Svend> following SCSI Epson scanners:

> Svend> GT9000, GT8500, GT7000, GT6500 and Perfection636

> Svend> A little addition around line 750 had to be made to make the
> Svend> backend recognize the Perfection scanner.

The lines

if (buf[0] != TYPE_PROCESSOR
|| strncmp (buf + 8, "EPSON", 5) != 0
|| (strncmp (buf + 16, "SCANNER ", 8) != 0
&& strncmp (buf + 14, "SCANNER ", 8) != 0))

are changed to

if( (buf[0] != TYPE_PROCESSOR)
|| strncmp(buf+8,"EPSON",5)
|| (strncmp(buf+16,"SCANNER ",8)
&& strncmp(buf+14,"SCANNER ",8)
&& strncmp(buf+16,"Perfection",10)
)
)

> Svend> Svend Daugaard Pedersen

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

Svend Daugaard Pedersen

may be I should have a look at that diff ;-|

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